4

Does anyone have some performance metrics for Varnish in front of 1) Tomcat or 2) Apache with mod_jk (connected to Tomcat). I know that the AJP connector is supposedly faster than HTTP, but I was thinking that Varnish which is lighter and highly optimized could perform better talking direcly to Tomcat. There is also the discussion around static resources (which I think will perform faster with Varnish than Apache, even with mod_cache) and dynamic pages.

1
  • Unfortunately no one has done a benchmark in this area. What I decided was to use Varnish in front of Tomcat7 and Nginx as a SSL wrapper.
    – Adrian Ber
    Nov 25, 2013 at 11:34

1 Answer 1

2
+25

Generally Varnish can deliver a cache hit several orders of magnitude faster than Tomcat - typically TTFB is microseconds for Varnish and milliseconds for Tomcat. So, the performance of the connector (AJP vs HTTP) probably won't matter when Varnish is involved. So, go for the simpler setup - have Tomcat speak directly to Varnish. The marginal effect AJP might have will be completely insignificant.

If you are considering not having Varnish there at all I think the question you should be asking yourself is what the hit rate for the dynamic pages from Tomcat will be. If it is >20% then I think the overall performance increase might be worth the extra complexity, depending on how heavy the pages are.

1
  • So, what you're saying is that Varnish+HTTP will perform better than Apache+AJP? So, if dynamic pages hits are more than 20% than Apache is the way?
    – Adrian Ber
    Oct 16, 2013 at 14:33

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .