Webaccelerator with mod_gzip ? 24
Christian Bjerre writes: "Currently I'm using Squid as an webaccelerator to sit infront of apache and serve static files (.html .js .gif .png .jpg). Squid also serves my dynamic content which is .php files. My goal is to let Squid or another opensource program gzip the html, since I have Squid installed on another machine, where cputime is not an issue. I've been reading page up&down and Squid dosen't seem to support gzip encoding in Webaccelerator mode. I haven't tried feeding it gzipped html, which could be a solution, if there was a way of having Squid handle all content as binary. What do you guys & girls do to minimize bandwidth usage? // chris"
From Tanenbaum... (Score:2, Interesting)
Re:From Tanenbaum... (Score:2, Insightful)
Re:From Tanenbaum... (Score:2, Insightful)
I can get all the bandwidth I want (and a bit more) but I have to pay for it.
All the CPU's I use are overpowered, but I already have paid for the full capacity. This is not the case for my bandwidth, because I have to pay for every bit of data my webserver sends to the internet.
Re:From Tanenbaum... (Score:4, Informative)
FWIW these guys [youngit.org.nz] use php's ob_gzhander [php.net] function and appear to get quite good results.
Dave
Re:From Tanenbaum... (Score:2, Informative)
That should be endorsment enough, right?
Re:From Tanenbaum... (Score:1)
Re:From Tanenbaum... (Score:2, Informative)
Re:From Tanenbaum... (Score:1)
Re:From Tanenbaum... (Score:1)
Use HTTP Properly (Score:4, Interesting)
Squid may well be smart enough to know to cache documents with two different Content-Encoding's as different entities, but if not you just add Vary: Content-Encoding so it does.
(that, at least, is the theory, I'm afraid I can't claim to have read the entire HTTP 1.1 spec, tsk
Have you looked at apache? (Score:4, Informative)
Apache+mod_proxy+mod_cache can also be an httpd accelerator (aka reverse proxy) and I've had great success with it. My original configuration used Squid but several limitations with Squid forced me to investigate the alternatives. I finally settled on Apache and I've been very happy with it. Apache also has better support for 301/302 rewriting (the PassProxyReverse directive) than Squid, and this was a deciding factor for me in dumping Squid and going with Apache.
Internet Explorer (Score:4, Interesting)
I was using tcpflow to monitor the connections, and I noticed something strange. It seems most IE versions (like 5, for instance) append the following string on the request connection:
Accept-Encoding: gzip, deflate
that tells the server it can send compressed data.
Strangely, I notice that if I access the very same site using IE 6 + patch Q312461 on XP, it DOES NOT send such string, thus all my requests return unencrypted.
I checked, and I am not using a proxy, and on advanced options, Use HTTP 1.1 is checked allright.
How can I enable compression ? It *SHOULD* be default. Has somebody else noticed this strange behavior ?
Re:Internet Explorer (Score:1)
Personally though, I think the whole HTTP compression thing is overblown - causes more problems than it solves sometimes, and if you're compressing to please modem users, I'd prefer to simply put a banner on my site saying "Burn your modem, you fewl".
G
Re:Internet Explorer (Score:2)
And, mind you, modem users are not so minority. Not everyone lives in a place where 1 Mbps DSL is available for $50. I wonder I did. Here where I live a 256 Kbps DSL goes for about $50/mo. And don't forget overseas connections, wich are tipically slower, RTT times higher, and sometimes packet loss can happen, what, added to TCP low-start, can be a pain. So a file size reduction is a big plus.
Anyway, the fact remains. APPARENTLY IE 6.0 on XP does not request compressed connections. At least mine doesn't. And I don't see any reason for such.
Re:Internet Explorer (Score:1)
I just ran a test using IE 6.0.2600 Q313675; Q316059; on XP Pro 2600 against an IIS5 server.
It's requesting compression.
Re:Internet Explorer (Score:3, Informative)
I work as the lead programmer for a (somewhat) large e-Business application, and I can honestly say that gzip compression is definitely worth it.
In our case, the application is Java-based. It was a piece of cake to add dynamic gzip compression to the 'main' servlet which every other servlet in the application extends. For us, it was important to see how quickly a page can be sent to our customers. Even a small gain would improve things a lot.
The results? Well - after some testing, we figured out that for any pages greater than 8k in size, it's worth the extra time to compress with gzip. We've saved a bundle in bandwidth costs, and more importantly, customers are happier that they can download their (large - a couple hundred k) reports in a decent timeframe, for example.
I've had no trouble with it either. The only case where it had issues was when the content wasn't textual, such as dynamically-generated PDF documents. The browers didn't know what to do with this, so some care had to be taken to only use gzip on the html and text content. Naturally we check the accept-encoding in the http request headers to make sure it's ok.
Many companies who are our customers don't have T1s, after all. Quite a few have ISDN. The thing is, you can't get them to listen and spend more money on a pipe just so they can use the advanced (bandwidth-intensive) features of your site. Instead, you have to do what you can to accomodate them as much as possible.
The gzip compression actually made the site bearable even on a 28.8. Thus, customers who have faster lines benefit even more, since our own pipe is less clogged as a result too.
We can always throw an extra machine or two into our application server pool (relatively cheap for a simple 1U server). Adding extra bandwidth, though, is expensive and management has already forbidden it for the time being.
Re:Internet Explorer (Score:2, Funny)
By the morning all 88 of my web servers will be running it. If I get problems, I'll send 'em to you
G
Re:Internet Explorer (Score:1)
I never said I'm running mod_gzip. I did say I'm using gzip to compress our output on the site. But it's using Java's build-in gzip packages (java.util.zip.GZIPOutputStream I think).
You shouldn't have any problems though - I'm using mod_gzip on another one of my servers and it hasn't given me any issues.
Edge Serving (Score:2)
what i'm wondering is if that technology conecpt has any other compression novel ideas.
RabbIT proxy (Score:1)
It is really good for low bandwidth connections like Mobile Phone connections (such as 9600 and 14400bps)
It GZIP's both Dynamic and Static content from any source.
I've been using it with Mobile Internet Explorer on my iPAQ via my Mobile phone
It's worth looking into.
You could compress with php. (Score:2, Informative)
There are also a collection of third party class's which you can browse here [resourceindex.com].