Fred Wilson found this. I have been wondering how I could add my Amazon Associates information more easily.
I love having my mind read.
And to prove it works, buy Why Business People Sound Like Idiots. I just finished it. It helps to remind me that everything I try to do at work is right; that being myself, as insane and interactive as I like to be, works.
On to the Purple Cow…then Blink…
Author: spierzchala
-
Amazon Associates Bookmarklet
-
Apache and mod_rewrite: More Zombified Idiots Dispatched
I have been seeing a large number of hits with the following User-Agent string in my logs lately:
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.5) Gecko/20031007 Firebird/0.7
- Firebird hasn’t existed as a browser for a very long time
- A build date of October 7, 2003???
- From 3 separate IP Addresses
This Apache REWRITE rule took care of this issue.
RewriteCond %{HTTP_USER_AGENT} .*Gecko\/20031007.* RewriteRule ^.*$ http://www.pierzchala.com:9080/ [R,L,NS]Try the URL…it points to this iptables rule.
/sbin/iptables -A INPUT -p tcp -i eth0 -s 0/0 --dport 9080 -j DROP
I love Linux!
-
Nothing Interesting…Gotta A Secret?
Is there anything interesting going on? Is anyone doing anything interesting?
Bored…bored…BORED
Sigh!
Anyone got a secret they want to share? -
Kathy Sierra on the Geography of Context
Kathy Sierra writes on the geography of context. The main takeaway: North Americans remove objects from their context; Asians always consider the whole picture.
A thought-provoking reminder of our differences as a species. I am defiitely guilty of removing objects from their context and looking at them in isolation.However, working with computer systems on a daily basis is one method that I find for helping maintain contextual grounding.
Ok…the above sentence was hideous. What I meant to say is that workig with complex Internet systems forces a person to always think of devices, applications and configurations in the context that they exist.
In fact, that is the main failing inside most of the organizations that I work with. There is no overarching understanding of how all of the systems work together.
So, the culture of context can exist within an organization. I gravitate towards people who are able to bring in the whole picture.
Who do you spend time with? Isolationists or Inclusionists? -
Happy Birthday, Dave Winer
Dave Winer, Happy Birthday. You’re 50..and I’m not.
Unabashed attempts to drive traffic… -
Ideas: Culture of Life?
This has been rattling around in my head for a day or so.
Bush and his cadre are promoting a culture of preserved life, not a culture of sustained life.
Think about it and comment.
Eschaton points out the hypocrisy in this quote:…Gov. Bush has appointed two more secretaries to lead DCF since the agency initially mishandled Moesha’s case under Ms. Kearney, but an unfair practice of valuing some lives more than others continues to hurt some of the neediest and most fragile Floridians. In 2003, after failing to protect a severely mentally retarded woman from being raped while in state custody, DCF fought to save the woman’s fetus. Similarly, late last month, after failing to protect a 13-year-old in state custody from becoming pregnant, DCF fought to save the girl’s fetus. While the state was fighting fiercely to save the unborn, it continued quietly fighting — using private lawyers — to avoid financial responsibility for a living child, one irreversibly harmed while dependent on the state for protection.
-
No, I haven’t lost my mind!
In case you are wondering where the megs of Web performance information that I have posted has come from, I have decided to move my articles into the content-management system I call a blog, so that I can more effectively manage them.
It is also in-keeping with my philosophy of promoting Web performance.
Enjoy the new stuff! -
Performance Improvement From Caching and Compression
This paper is an extension of the work done for another article that highlighted the performance benefits of retrieving uncompressed and compressed objects directly from the origin server. I wanted to add a proxy server into the stream and determine if proxy servers helped improve the performance of object downloads, and by how much.
Using the same series of objects in the original compression article[1], the CURL tests were re-run 3 times:
- Directly from the origin server
- Through the proxy server, to load the files into cache
- Through the proxy server, to avoid retrieving files from the origin.[2]
eries of three tests was repeated twice: once for the uncompressed files, and then for the compressed objects.[3]
As can be seen clearly in the plots below, compression caused web page download times to improve greatly, when the objects were retrieved from the source. However, the performance difference between compressed and uncompressed data all but disappears when retrieving objects from a proxy server on a corporate LAN.

Instead of the linear growth between object size and download time seen in both of the retrieval tests that used the origin server (Source and Proxy Load data), the Proxy Draw data clearly shows the benefits that accrue when a proxy server is added to a network to assist with serving HTTP traffic.
Uncompressed Pages
MEAN DOWNLOAD TIME Total Time Uncompressed — No Proxy 0.256 Total Time Uncompressed — Proxy Load 0.254 Total Time Uncompressed — Proxy Draw 0.110 Compressed Pages
MEAN DOWNLOAD TIME Total Time Compressed — No Proxy 0.181 Total Time Compressed — Proxy Load 0.140 Total Time Compressed — Proxy Draw 0.104 The data above shows just how much of an improvement is gained by adding a local proxy server, explicit caching descriptions and compression can add to a Web site. For sites that do force a great of requests to be returned directly to the origin server, compression will be of great help in reducing bandwidth costs and improving performance. However, by allowing pages to be cached in local proxy servers, the difference between compressed and uncompressed pages vanishes.
Conclusion
Compression is a very good start when attempting to optimize performance. The addition of explicit caching messages in server responses which allow proxy servers to serve cached data to clients on remote local LANs can improve performance to even a greater extent than compression can. These two should be used together to improve the overall performance of Web sites.
[1] The test set was made up of the 1952 HTML files located in the top directory of the Linux Documentation Project HTML archive.
[2] All of the pages in these tests announced the following server response header indicating its cacheability: Cache-Control: max-age=3600
[3] A note on the compressed files: all compression was performed dynamically by mod_gzip for Apache/1.3.27. -
Compressing Output From PHP
A little-used or discussed feature of PHP is the ability to compress output from the scripts using GZIP for more efficient transfer to requesting clients. By automatically detecting the ability of the requesting clients to accept and interpret GZIP encoded HTML, PHP can decrease the size of files transferred to the client by 60% to 80%.
Configuring PHP
The configuration needed to make this work is simple. I use a Linux distro that relies on RPMS, so I check for the following two packages:
- zlib
- zlib-devel
For those not familiar with zlib, it is a highly efficient, open-source compression library. This library is used by PHP uses to compress the output sent to the client.
Compile PHP4 with your favourite ./configure statement. I use the following:Apache/1.3.x ./configure --with-apxs=/usr/local/apache/bin/apxs --with-zlib Apache/2.0.x ./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-zlib
After doing make && make install, PHP should be ready to go as a dynamic Apache module. Now, you have to make some modifications to the php.ini file. This is usually found in /usr/local/lib, but if it’s not there, don’t panic; you will find some php.ini* files in the directory where you unpacked PHP. Simply copy one of those to /usr/local/lib and rename it php.ini.
Within php.ini, some modifications need to be made to switch on the GZIP compression detection and encoding. There are two methods to do this.Method 1: output_buffering = On output_handler = ob_gzhandler zlib.output_compression = Off
Method 2: output_buffering = Off output_handler = zlib.output_compression = On
Once this is done, PHP will automatically detect if the requesting client accepts GZIP encoding, and will then buffer the output through the gzhandler function to dynamically compress the data sent to the client.
So?
The winning situation here is that for an expenditure of $0 (except your time) and a tiny bit more server overhead (you’re probably still using fewer resources than if you were running ASP on IIS!), you will now be sending much smaller, dynamically generated html documents to your clients, reducing your bandwidth usage and the amount of time it takes to download the files.
How much of a size reduction is achieved? Well, I ran a test on my Web server, using WGET to retrieve the file. The configuration and results of the test are listed below.Method 0: No Compression
wget www.pierzchala.com/resume.phpFile Size: 9415 bytes Method 1: ob_gzhandler
wget –header=”Accept-Encoding: gzip,*” www.pierzchala.com/resume.phpFile Size: 3529 bytes Method 2: zlib.output_compression
wget –header=”Accept-Encoding: gzip,*” www.pierzchala.com/resume.phpFile Size: 3584 bytes You will have to experiment with the method that give the most efficient balance between file size and overhead and processing time on your server.
A 62% reduction in transferred file size without affecting the quality of the data sent to the client is a pretty good return for 10 minutes of work. I recommend including this procedure in all of your future PHP builds. -
mod-gzip Compile Instructions
The last time I attempted to compile mod_gzip into Apache, I found that the instructions for doing so were not documented clearly on the project page. After a couple of failed attempts, I finally found the instructions buried at the end of the ChangeLog document.
I present the instructions here to preserve your sanity.
Before you can actually get mod_gzip to work, you have to uncomment it in the httpd.conf file module list (Apache 1.3.x) or add it to the module list (Apache 2.0.x).
Now there are two ways to build mod_gzip: statically compiled into Apache and a DSO-File for mod_so. If you want to compile it statically into Apache, just copy the source to Apache src/modules directory and there into a subdirectory named ‘gzip’. You can activate it via a parameter of the configure script.
./configure --activate-module=src/modules/gzip/mod_gzip.a make make install
This will build a new Apache with mod_gzip statically built in.
The DSO-Version is much easier to build.make APXS=/path/to/apxs make install APXS=/path/to/apxs /path/to/apachectl graceful
The apxs script is normally located inside the bin directory of Apache.