Multiple instances of varnish

Mike Franon kongfranon at
Thu May 5 18:52:00 CEST 2011

Well what I am trying to do is for example the site is

I have at the f5 check to see if the request is coming from a bot, and
if it is then said it to a pool that points to a different virtual
host on the appache server using a different port, specifically for
bot requests.

Otherwise if is a normal browser request then send
to the main virtual host on port 80

I am trying to see if there is a way with using a single instance

1)  Varnish using VCL to recognize that it is a bot

2)  If it is a bot request, varnish will then use a different backend.


On Thu, May 5, 2011 at 12:22 PM, Stefan Pommerening <pom at> wrote:
> 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
> machines.
> 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
> fragmentation,
> 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.
> Stefan
> --
> Dipl.-Inform. Stefan Pommerening
> Informatik-Büro: IT-Dienste & Projekte, Consulting & Coaching

More information about the varnish-misc mailing list