Posts Tagged ‘USD’

Compressing PHP Output

October 3rd, 2006 by smp | Comments | Filed in Web Performance, WebPerformance.Org

A little-used or discussed feature of PHP4 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, PHP4 can decrease the size of files transferred to the client by 60% to 80%.

The information given here is known to work on systems running Red Hat 8.0, Apache/1.3.27, Apache/2.0.44 and PHP/4.3.1.

Configuring PHP

The configuration needed to make this work is simple. Check your installed Red Hat RPMS for the following two packages:

  1. zlib
  2. 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.27
./configure –without-mysql –with-apxs=/usr/local/apache/bin/apxs –with-zlib

Apache/2.0.44
./configure –without-mysql –with-apxs2=/usr/local/apache2/bin/apxs –with-zlib

After doing make && make install, PHP4 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 PHP4. 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, PHP4 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.php
File Size: 9415 bytes
Method 1: ob_gzhandler
wget –header=”Accept-Encoding: gzip,*” www.pierzchala.com/resume.php
File Size: 3529 bytes
Method 2: zlib.output_compression
wget –header=”Accept-Encoding: gzip,*” www.pierzchala.com/resume.php
File 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 PHP4 builds.

Tags: , , , , , , , , , ,

New Pen Lust: UniBall Power Tank

July 16th, 2006 by smp | Comments | Filed in Uncategorized

I got the UniBall Power Tank in Golden, and it has replaced all of my other pens. A gel pen with a pressurized tank, it lives up to its reputation to write anywhere and on anything.

Effectively, it is a $2.95 Fisher Space Pen. And how can that be wrong?

Technorati:

Tags: , , , , , ,

Canadian Dollar: Look mama! The demons and hellish minions are playing hockey on that frozen lava!

May 2nd, 2006 by smp | Comments | Filed in Canada

Loonie rises above 90 cents US.

I was 10 years old the last time the Canadian Dollar was worth more than $0.90 USD.

Technorati Tags: , ,

Tags: , , , , , , , ,

Why I Will Not Recommend Gutter Helmet

August 22nd, 2005 by smp | Comments | Filed in Gutter Helmet

Follow the entire saga - The Gutter Helmet Category!


Yet Another UPDATE: Another unpleasant encounter with the “technicians” detailed here.


UPDATE (October 19, 2005): New update on my experience here.


UPDATE (October 6, 2005): More on this topic here.


The Canadian Consulate here in Marlborough, MA needed some new gutters. We decided that since the gutters are at least 30 feet off the ground, we would Install some that needed far less maintenance.

The Gutter Helmet system seemed to suit our needs. So we arranged to meet with the sales guy.

After that meeting, I should have gone with my gut feeling. Think high-pressure car salesman, and you will get the picture. We assume he was an aberration, and about a month ago we set the date for the installation.

We were having the Gutter Helmet team install both new gutters and the helmet system. Second mistake. According to what Samantha described, this team was definitely on the F-List (found out today that this installation team is “no longer with the company”). And they were far from professional in the way that they removed the old gutters and installed the new ones. I am still finding sharp metal pieces, screw, and old gutter hangers around the yard, including 7 or 8 gutter hangers conveniently disposed of in what is very obviously our leaf compost.

As well, we discovered that not all of the straps were installed correctly, the downspouts were not attached to the higher gutter sections. We called, and out came the inspector. This gentleman told Samantha that they have had issues with this installation team…and set up a ticket for them to come and repair their mistakes.

Next problem is that we have an in-ground drainage system to carry water away from the downspouts on the north side of the house and out to somewhere where it will not fill the swimming pool in the basement. It took a third trip for the installation team to put the downspouts into the special end caps we purchase to prevent other crap from getting in the system.

And then, yesterday, during a thunderstorm cloudburst, we notice that there is water dripping down between the gutter and the house. This is definitely sub-optimal. Another call in to the customer service centre, where Samantha is curtly told by the woman on the other end of the line (who, I learned in a later call, is actually the call centre manager!) that some house require flashing and that they don’t install it in order to try and reduce the cost of the project.

This cost us over $3,000. Flashing is $2/foot. Put the flashing on; damn the cost.

Oh, and since I mention the cost, did I mention that we received no rebate or credit for this. Likely Gutter Helmet’s response would be that they repaired their work at no charge to us. My response is that I know a lot of houses in my neighbourhood that need gutters

I know a great roofing company, a great electrician, an amazing mason, and a lousy gutter company.

These companies always give a rebate if you advertise their service with a lawn sign. Maybe I should put an anti-endorsement sign on my lawn. No slander…just clearly stating that I would share my experience with Gutter Helmet with anyone who is considering their service.


Technorati: , , ,

IceRocket: , , ,

Tags: , , , , ,

Office 12: Dinosaurs Evolve? Here’s how!

May 19th, 2005 by smp | Comments | Filed in smp

Over the last few days, there has been the start of Bzzzzz around the sneak peeks people are getting into the new Office 12 for Windows.

I haven’t read them. I don’t care. Guess I am a dinosaur.

On my work laptop, I am very happy with Office 11 (2003). My wife is very happy with Office 10 (2000) on machine.

Who is Office 12 aimed at? Enterprises are going WTF? Another *%^&%%$&% upgrade that is going to cause things to break and new security holes to appear, due to the new complexities that have not been completely tested?

Consumers? Most home users are likely to say that Ofice 97/2000/XP/2003 work fine for them, so why should they shell out a couple of hundred bucks for an upgrade?

I have an idea that will revolutionize the entire Microsoft Office marketing campaign, and put the fear into the entire marketplace.

Give away a LESS complicated, stripped down version “stock” version of Office 12 to anyone who wants it. Should be able to fit it into something like the 60-80 MB that OpenOffice fits into.

That’s right. I have spoken the heresy. The basic Office 12 should be given away for free. If you need/want more advanced connectors/translators/add-ons, they can be purchased and downloaded online for modular prices ($9.95, $19.95, etc).

Why will Microsoft still make gobs of money of this method? Because the core development work for Office 12 is complete. Has been complete for maybe a decade, but at least 6-7 years.

If Microsoft doesn’t consider this free download model, Office 12 will be greeted with the response it deserves from the basic consumers and IT professionals alike: WHO CARES?

OFFICE 12 LINK-O-RAMA!

Office 12 to ease lines of communication | CNET News.com

Office 12 and the New World of Work

Office 12 release confirmed for next year

Office 12 release confirmed for next year

Update: Microsoft reveals more details on ‘Office 12′

Tags: , , , , , , , , , , , , , , , , , , ,

Compressing Output From PHP

April 30th, 2005 by smp | Comments | Filed in smp

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:

  1. zlib
  2. 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.php
File Size: 9415 bytes
Method 1: ob_gzhandler
wget –header=”Accept-Encoding: gzip,*” www.pierzchala.com/resume.php
File Size: 3529 bytes
Method 2: zlib.output_compression
wget –header=”Accept-Encoding: gzip,*” www.pierzchala.com/resume.php
File 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.

Tags: , , , , , , , ,

iPod Headphones

March 28th, 2005 by smp | Comments | Filed in smp

BL Ochman comments on her iPod Headphones. [here]

I’m not sure where she got her Sony headphones, but I have had mine for a couple of years and they are so much better than the ear-buds that came with my iPod Shuffle. I keep thinking that the Pod earbuds should go in the trash…errr, garbage. [I hate it when Americanisms slip into my writing/speaking!]

If you have a hundred bucks burning a hole in your pocket, go with the Etymotic Isolators. I don’t, so the Sony Fontopia’s (in black) work just fine.

Tags: , , , , , , , , , , , ,

Dave Winer on Silicon Valley, and a Rant on California Education Funding

March 28th, 2005 by smp | Comments | Filed in RANTING

Dave Winer notes that Silicon Valley isn’t what it used to be. [here]

Now, with Yahoo getting its mojo back [here and here], and a few other happenings in the Valley, there are some signs of life.

But there is still a lot of vacant real-estate. The office buildings that housed Webvan are still vacant after 3 years, and they have a great view of the Bay and the San Mateo bridge. There is still a vacuum there.

I can’t speak of the lap dogs, as I am a mere prole.

However, I do disagree with the comment Dave W. makes about schools. If he is referring to Colleges and Universities, ok, I agree. But the public school system in the Bay area, and in California in general, is one of the reasons why I was not too upset to move to Massachusetts.

My kids were going into the highly underfunded, if not malnourished and dying, system of non-education in California that resulted from one of the greatest breeders of inequity in the modern world — Proposition 13.

I love this statement from Warren Buffett:

Buffett cited the inequity of property taxes he pays on his homes in Omaha, Neb., and Laguna Beach, Calif., and said the California cap on property taxes imposed by Prop. 13 “makes no sense.”

His $500,000 house in Omaha has a tax bill of $14,401. His $4 million house in Laguna Beach has a tax bill of $2,264. The taxes on his Omaha home increased $1,920 this year, compared with $23 on the Laguna Beach home, he said.

Complain about the other taxes; then remember that your kids are going to schools that are 40th in the US by funding.

I miss the great garden we had. But my kids are learning more by not being in California Public Schools.


Heard this on NPR on the way home tonight. very relevant to this discussion.

Tags: , , , , , , , , , , , , , , , , ,