views:

4075

answers:

8

Hi folks

We need a web content accelerator for static images to sit in front of our Apache web front end servers

Our previous hosting partner used Tux with great success and I like the fact it's part of Red Hat Linux which we're using, but its last update was in 2006 and there seems little chance of future development. Our ISP recommends we use Squid in reverse caching proxy role.

Any thoughts between Tux and Squid? Compatibility, reliability and future support are as important to us as performance.

Also, I read in other threads here about Varnish; anyone have any real-world experience of Varnish compared with Squid, and/or Tux, gained in high-traffic environments?

Cheers

Ian

UPDATE: We're testing Squid now. Using ab to pull the same image 10,000 times with a concurrency of 100, both Apache on its own and Squid/Apache burned through the requests very quickly. But Squid made only a single request to Apache for the image then served them all from RAM, whereas Apache alone had to fork a large number of workers in order to serve the images. It looks like Squid will work well in freeing up the Apache workers to handle dynamic pages.

+1  A: 

both Squid and nginx are specifically designed for this. nginx is particularly easy to configure for a server farm, and can also be a frontend to FastCGI.

Javier
nginx's caching facilities are limited, in comparison with squid and varnish.
Frank Farmer
+1  A: 

I've only used squid and can't compare. We use squid to cache an entire site on a server in the USA (all data gets pulled from a machine in Germany). It was pretty easy to set up and works nicely. I've found the documentation to be kind of lacking unless you already know what to look for.

_Lasar
+1  A: 

We are about to roll out a varnish 2.01 server in front of an IIS 6 installation. The only caveats we've had was with our SSL (as varnish can't handle SSL). So we've also installed Nginx to handle those requests.

In all our testing we've shown a 66% percent increase in the amount of traffic the site can handle.

My only gripe is that varnish doesn't handle cookies well, and the documentation is still a bit scattered.

MkUltra
Can you elaborate on "varnish doesn't handle cookies well"?
Frank Farmer
http://www.code-emitter.com/blog/2008/10/added-varnish-just-works/varnish won't cache a page if it has cookies.
Daniel
Caches generally don't cache pages with cookies. The assumption is that if you set a cookie then you expect to do something *different* with that request based on the contents of the cookie. Otherwise, there's no point to setting cookies. If you want to serve cached, then remove the cookie in your varnish configuration.
tylerl
+7  A: 

In my experience varnish is much faster than squid, but equally importantly it's much less of a black box than squid is. Varnish gives you access to very detailed logs that are useful when debugging problems. It's configuration language is also much simpler and much more powerful that squid's.

scooterXL
that sounds very interesting. what are you using varnish for. can you mention a little of what task? I'm interested in the context of your comments.
Fire Crow
A: 

We use Varnish on http://www.mangahigh.com and have been able to scale from around 100 concurrent pre-varnish to over 560 concurrent post-varnish (server load remained at 0 at this point, so there's plenty of space to grow!). Documentation for varnish could be better, but it is quite flexible once you get used to it.

Varnish is meant to be a lot faster than Squid (having never used Squid, I can't say for certain) - and http://users.linpro.no/ingvar/varnish/stats-2009-05-19 shows Twitter, Wikia, Hulu, perezhilton.com and quite a number of other big names also using it.

Richy C.
+3  A: 

@Daniel, @MKUltra, to elaborate on varnish's supposed problems with cookies, there are really any. It is completely normal NOT to cache a page if it returns a cookie with it. Cookies are mostly meant to be used to distinguish different user preferences, so I don't think one would want to cache these (especially if you they include some secret information like a session id or a password!).

If you server sends cookies with your .js and images, that's a problem on your backend side, not on Varnish's side. As referenced by @Daniel (link provided), you can force the caching of these files anyway, thanks to the really cool language/DSL integrated in Varnish...

Luc Stepniewski
A: 

For what it's worth, I recently set up nginx as a reverse-proxy in front of Apache on a 6-year-old low-power webserver (running Fedora Core 2) which was under a mild DDoS attack (10K req/sec). Pages loading was snappy (<100ms) and system load stayed low at around 20% CPU utilization, and very little memory consumption. The attack lasted 1 week, and visitors saw no ill effects.

Not bad for over half a million hits per minute sustained. Just be sure to log to /dev/null.

tylerl
A: 

If you're looking to push static images and a lot of them, you may want to look at some basics first.

Your application should ensure that all correct headers are being passed, Cache-Control and Expires for example. That should result in the clients browsers caching those images locally and cutting down on your request count.

Use a CDN (if it's in your budget), this brings the images closer to your clients (generally) and will result in a better user experience for them. For the CDN to be a productive investment you'll again need to make sure all your necessary caching headers are properly set, as per the point I made in the previous paragraph.

After all that if you are still going to use a reverse proxy, I recommend using nginx in proxy mode, over Varnish and squid. Yes Varnish is fast, and as fast as nginx, but what you're wanting to do is really quite simple, Varnish comes into it's own when you want to do complex caching, and ESI. So Keep It Simple, Stupid. nginx will do your job very nicely indeed.

I have no experience with Tux, so I can't comment on it sorry.

flungabunga