Tracking request queue time on New Relic RPM with Varnish
The nice folks at New Relic have added an under-hyped feature to RPM which allows for the tracking of the time a given request spent in the server's work queue before processing began. This information in crucial in determining when you need to add more workers. It only requires that your front-end add an X-Request-Start
header containing the epoch time in microseconds when the request was received. They offer a patch for NginX and a one-line config change for Apache.
But what about the new hotness, Varnish?
That's what. Save this to /etc/varnish/newrelic.h
and include it in your vcl_recv
declaration.