I have done this on websites running Tomcat, Wordpress, Drupal on both large installations and smaller ones. And decided to put a sample on how it affects Midcom/Midgard.
I did some preliminary tests on how it would work on this blog using one of my testservers for Varnish. Some small and simple rules made the website almost 3 times as fast. And this Varnish installation is not that optimized.
One of the things todo is to cache images .. we do that in vcl_fetch in the vcl code.
if (req.url ~ "\.(jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|pdf|txt|tar|wav|bmp|rtf|flv|swf|html|htm)$") {
if (beresp.status == 200) {
remove beresp.http.Cache-Control;
remove beresp.http.Set-Cookie;
remove beresp.http.expires;
set beresp.http.magicmarker = "1";
set beresp.http.Cache-Control = "max-age=604800";
set beresp.ttl = 1d;
set beresp.cacheable = true;
}
}
Im using an unconfigured Siege on /blog for about 20 seconds.
Before Varnish:
Lifting the server siege... done. Transactions: 53 hits Availability: 100.00 % Elapsed time: 20.28 secs Data transferred: 1.53 MB Response time: 4.43 secs Transaction rate: 2.61 trans/sec Throughput: 0.08 MB/sec Concurrency: 11.58 Successful transactions: 53 Failed transactions: 0 Longest transaction: 12.66 Shortest transaction: 0.72
After Varnish:
Lifting the server siege... done. Transactions: 170 hits Availability: 100.00 % Elapsed time: 20.11 secs Data transferred: 4.88 MB Response time: 1.21 secs Transaction rate: 8.45 trans/sec Throughput: 0.24 MB/sec Concurrency: 10.19 Successful transactions: 170 Failed transactions: 0 Longest transaction: 5.58 Shortest transaction: 0.52
