0

I am just trying to get varnish in front of Glassfish instances, which are load balanced with the mod_jk connector in Apache. But I don't really know how to combine them. The AJP_Ports for instances are e.g. 8009, 8010, 8011. I am not able to access them via the browser, but I can access the normal HTTP ports like 28080. For the 28080 ports I can put varnish in front of them. For the AJP_ports it's not possible.

Do you know a way where I can load balancer glassfish instances which are cached using varnish? Is it impossible to do this with mod_jk?

6
  • 1
    Can you put apache between varnish and your app server? So you have incoming --> varnish --> apache --> app server?
    – KM.
    Jan 31, 2012 at 18:10
  • Hmm. I've thought that the problem is here, that varnish doesn't support https. But doesn't it make sense to put: incoming --> apache --> load balancer --> varnish --> appserver instance ?
    – H6_
    Jan 31, 2012 at 21:15
  • 1
    Ah, but you didn't mention https (-: Typically, you'd want varnish in front of apache. Varnish caches are fast (memory or file) which makes it better at taking a large amounts of incoming traffic than apache or your app server. This eases the load on the components behind it, like apache, app servers, db, etc. What is the reasoning behind your setup (curious mostly)?
    – KM.
    Feb 1, 2012 at 16:00
  • The idea is to get less load on the application server and cache some responses.
    – H6_
    Feb 1, 2012 at 17:33
  • So you're using apache+mod_jk as a load balancer? Here apache will take the hit first, which under high load could be problematic. Varnish in front of apache should be able do the same thing and do it better; you can also use Varnsh as a load balancer ... but you know your setup best and you have to maintain it (-: Looks like you go it working. Good luck!
    – KM.
    Feb 1, 2012 at 19:31

1 Answer 1

0

Ok, what I have done now is to load balance via nginx (see this example). Varnish is running on each instance server in front of the Glassfish instance. And nginx balances over this varnish servers. I don't know if this is the perfect setup but it seems to work.

You must log in to answer this question.

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