I am running Drupal 6 with pressflow on Ubuntu 11.04. I installed Varnish http accelerator and Varnish Drupal module. The Varnish is running and the Varnish page at admin/settings/varnish confirms this.
I measured the Time per request before and after installing Varnish with apache bench like this:
ab -n 10 http://my-site.local/
Installing varnish actually increases the Time per request from about 1 second to 1.3 seconds so there must be something wrong in my configuration of Varnish http accelerator.
In php.ini I have set a memory_limit of 512M.
While configuring Varnish to talk with Drupal I followed these instructions given in http://groups.drupal.org/node/25425.
Here is the contents of my /etc/default/varnish
# Configuration file for varnish # # /etc/init.d/varnish expects the variables $DAEMON_OPTS, $NFILES and $MEMLOCK # to be set from this shell script fragment. # # Should we start varnishd at boot? Set to "yes" to enable. START=yes # Maximum number of open files (for ulimit -n) NFILES=131072 # Maximum locked memory size (for ulimit -l) # Used for locking the shared memory log in memory. If you increase log size, # you need to increase this number as well MEMLOCK=82000 # Default varnish instance name is the local nodename. Can be overridden with # the -n switch, to have more instances on a single server. INSTANCE=pressflow # This file contains 4 alternatives, please use only one. ## Alternative 2, Configuration with VCL # # Listen on port 6081, administration on localhost:6082, and forward to # one content server selected by the vcl file, based on the request. Use a 1GB # fixed-size cache file. # DAEMON_OPTS="-a :80 \ -T localhost:6082 \ -f /etc/varnish/default.vcl \ -u varnish -g varnish \ -S /etc/varnish/secret \ -s malloc,256M"
And here is the statistics Varnish module gives after running apache bench few times:
41 Client connections accepted 41 Client requests received 29 Cache hits for pass 12 Cache misses 41 Backend conn. success 12 Backend conn. was closed 12 Backend conn. recycles 1 Fetch with Length 11 Fetch chunked 29 Fetch wanted close 11 N struct sess_mem 2 N struct object 4 N struct objectcore 4 N struct objecthead 10 N worker threads 10 N worker threads created 1 N backends 10 N expired objects 40 Objects sent with write 41 Total Sessions 41 Total Requests 29 Total pass 41 Total fetch 16495 Total header bytes 645600 Total body bytes 41 Session Closed 1 Session Linger 3776 SHM records 899 SHM writes 53 SMA allocator requests 4 SMA outstanding allocations 19984 SMA outstanding bytes 5254284 SMA bytes allocated 5234300 SMA bytes free 41 Backend requests made 1 N vcl total 1 N vcl available 1 N total active purges 1 N new purges added 41 HCB Lookups without lock 3 HCB Lookups with lock 3 HCB Inserts 922 Client uptime