Multiple instances of varnish

Stefan Pommerening pom at
Thu May 5 18:22:05 CEST 2011

Am 05.05.2011 16:26, schrieb Mike Franon:
> Has anyone run multiple instances of varnish on the same server and
> how is the performance overall?
> I am looking into it, because I want to serve up the same url, but
> depending if it is a bot go to a different backend.
> I am trying to figure out the best way to do that.

Hi Mike,
although I am not completely understanding your motivation I still can state
that my current customer had two varnish instances running on several 
Therefore it works :)

The reason was not to run out of file descriptors (I was told...)
Meanwhile I migrated every two instances to a single instance per machine.

Well, performance (with two instances) was ok when you have cpu in mind.
On the other hand it's not very effective to have the same objects in 
two different caches
because virtual memory (and/or file cache of course) isn't shared 
between both instances.
This results in a lower hitrate and the double number of backend requests.

Technically you have to setup two instances using different instance names
using the -n parameter and of course different ports to listen on 
(client req and cli).

A reasonable setup would be to split domain names at the load balancer 
and feed
them to different varnish instances - those could be run on same hardware.
On the other hand you double your overhead memory usage (cache 
spare threads and such).

I personally see no reason why to run more than one varnish instance on 
the same
hardware and I think you can do everything in VCL.



*Dipl.-Inform. Stefan Pommerening
Informatik-Büro: IT-Dienste & Projekte, Consulting & Coaching* <>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the varnish-misc mailing list