views:

1869

answers:

4

Currently, I've got an expensive license for a reverse proxy server in an environment that is mostly Tomcat.

I'm thinking of one or both of the following upgrades.

  1. Using Squid instead of the expensive licensed product.

  2. Using some Apache2 settings for caching. Right now, I'm vague on the details, but perhaps mod_proxy will work here?

Where should I invest my time? What's a good, low-risk reverse proxy approach?

+6  A: 

Depending on what you want to cache and if you can easily determine this by different paths.

Assume that all files you want to cache are local files anyway, it might be a good idea to use a rewrite rule to map directly to the files instead of serving them on the tomcat server.

A Squid approach is probably better when you cannot determine which subdirectories contain cachable files (e.g. when they are generated by a servlet)

Another possibility that you may want to evaluate is Varnish to enable caching for more complicated setups.

In any variant, be sure to check that your web application generates proper URLs for redirects and within the html code, otherwise you will get problems when URLs point to the internal name of the proxied servers.

To answer your question, I would suggest evaluating the apache2 approach first.

Alex Lehmann
+1  A: 

Pound is a simple and effective (non-caching) reverse proxy (among its other functions). Pound is distributed under the GPL, but it looks like you'll need Linux to run it.

To quote the home page:

Quite a few people have reported using Pound successfully in production environments. The largest volume reported to date is a site with an average of about 30M requests per day, peaking at over 600 requests/sec.

gimel
note that Pound doesn't implement caching
Alex Lehmann
+7  A: 

You should definitely look for free and Open-Source solutions first.

  • nginx is a high-performance reverse proxy server.
  • ncache adds caching to nginx (the hottest URLs will be served from memory directly, the rest from disk).
  • Alternatively, the nginx memcached module provides memory-only caching for memcached, which is distributable over multiple servers.
  • In addition, repcached can be used to replicate memcached data automatically, which is useful for failover and upgrades without downtime.
  • Memcachedb adds disk persistence abilities (in addition to in-memory caching) to the mix, at least useful as failover slave for repcached.

Varnish is indeed a compelling caching layer for nginx and a powerful alternative to squid and the mentioned caching components.

A: 

Membrane Monitor and Router are open source and can be used for free. The installation just takes a minute. The impact on the latency is very low and the memory footprint is about 20 MB for the router only. Both are written in Java and can be extended by a spring configuration.

baranco