7

I have GNU/linux Box (linode VPS running Debian) with PHP, Apache, MySQL and Varnish (and app/site that use those) is there a tool that will save or monitor load times of web server responses?

jcubic
  • 230
  • 1
  • 4
  • 15
  • If you're interested in measuring not just how fast the requests are served but also the actual page load speed (including network latency, etc.), something like [Pingdom](http://pingdom.com/) can help you monitor page load times. –  Jun 02 '12 at 06:32

11 Answers11

14

Check out Apache's LogFormat directive. It allows to log the time taken to serve the request (%D and %T). This can be used for monitoring your server's response time. It will for example tell you if your server responds slower after you have made a change.

However, I am not aware of any tool which uses that information to create a report.

Oliver
  • 5,973
  • 24
  • 33
  • 1
    Varnish's logging daemon, varnishncsa, can also log request time as well as whether there was a cache hit or miss. I use the following in my /etc/syconfig/varnishncsa: DAEMON_OPTS="$DAEMON_OPTS -F \"%h \\\"%{X-Forwarded-For}i\\\" %t \\\"%r\\\" %s %b \\\"%{Referer}i\\\" \\\"%{User-agent}i\\\" %{Varnish:time_firstbyte}x %{Varnish:hitmiss}x\"" – Adam Franco Jun 04 '12 at 17:42
5

You'll want to be a little clearer about what you mean by "the time of a response".

If you're interested in Apache's timings, you can use the LogFormat directive to get "the time taken to serve the request" in either seconds (%T) or microseconds (%D).

Docs are here.

nickgrim
  • 4,466
  • 1
  • 19
  • 28
  • time from HTTP request to HTTP response (the time php is running for one request and executing MySQL queries and I also have Varnish so some of them are cached and I'll want to see Varnish response times). – jcubic May 29 '12 at 08:56
5

Nagios or Icinga can do this, as can a number of other tools (Munin comes to mind).

Bart De Vos
  • 17,911
  • 6
  • 63
  • 82
  • no, monitoring software does not have any out-of-the-box methods to monitor load time. – DukeLion May 29 '12 at 09:02
  • @DukeLion, have you ever worked with Nagios? check_url, check_iis, check_bend, ... What more could you need? – Bart De Vos May 29 '12 at 10:01
  • 2
    Sure I did. But eventual checks does not provide solid picture of user experience. – DukeLion May 29 '12 at 10:15
  • You can do serious smoke testing with nagios/icinga. I've implemented it on numerous clients to keep track of response times, how a site reacts, how long users will need to wait to complete a certain task, etc, ... It's as close as you can get without hiring somebody to test it for you. – Bart De Vos May 29 '12 at 11:30
  • Not like that. You can implement gathering of EACH request time or just accurate averages - you'll get a better picture of your server load and good data for fine-tuning and optimizing code. – DukeLion May 29 '12 at 11:46
3

We use zabbix in our shop, you can set it up to monitor a specific page, it will give you ping time, download speed, and response time. It is open source, and although complex, allows you to do fairly complex stuff, including SMS alerts. in built graph creation, and tripwire style security checks (ie. Notify you if the checksum of /etc/passwd changes)

Rqomey
  • 1,055
  • 9
  • 25
2

You can use cacti too. There is a lot of templates and if i remember there are several to test/monitor/graph the load speed of a url.

Regards!

Adrian Perez
  • 169
  • 2
  • 9
1

you can use http://newrelic.com/ to monitor processing time with varnish

you will need this:

/etc/varnish/newrelic.h:

#include <sys/time.h>

struct timeval detail_time;
gettimeofday(&detail_time,NULL);
char start[20]; 
sprintf(start, "t=%lu%06lu", detail_time.tv_sec, detail_time.tv_usec);
VRT_SetHdr(sp, HDR_REQ, "\020X-Request-Start:", start, vrt_magic_string_end);

vcl_recv:

C{
#include </etc/varnish/newrelic.h>
}C
DukeLion
  • 3,259
  • 1
  • 18
  • 19
1

It really depends on what you want to achieve. Internal monitoring can give you a rough idea on the overall performance of your machine and software. If you are asking about remote server monitoring options, then you have a lot of options.

External monitoring really has its advantages and you can get response time per city (depending on the service you are using). There are a lot to choose from, both paid and free. All of them would give you a pretty good idea about the response times. For extra resolution, it is almost certain you'll need to go for a paid account, but you can always start with the free options.

I personally use Websitepulse, but have also tried other services such as Pingdom and Site24x7. What I like about WSP is the number of remote locations I can test from. Another cool thing is their somewhat limited, but free server monitoring for life service. It's the third one down.

If you like, I can run some test for you and let you know how your site performs, from a couple of locations I'm currently paying for.

0

This tools will log and Monitor your web server

Nagios or Icinga

Kishore Jangid
  • 129
  • 1
  • 1
  • 7
0

There's also Mod Firstbyte which will measure the time that your server took to generate the page (not how long it took to generate and download to the browser which %D and %T do)

Noodles
  • 1,386
  • 3
  • 18
  • 29
0

A couple of other services worth checking out are GTmetrix and Stella. They both monitor pages, graph performance, and track historical metrics. The nice thing about these services is that they don't just track page load times, they also track the load time of all the other assets on the page (images, css, js, etc.).

I actually was coming to serverfault to ask if anyone knew of an open source equivalent for tracking loads times of pages and associated assets; then I ran across this thread. Still, if anyone knows of something similar that's open source, please post a comment on this answer. Thanks!

Matt V.
  • 837
  • 1
  • 9
  • 12
0

Smokeping might do what you're looking for - its obviously measuring the latency between your smokeping box and the webserver too, and maybe not so good if you're looking at the response times of your complex cgis (apache logs are better for that), but it's simple, and it makes fun charts.

Tom Newton
  • 4,141
  • 2
  • 24
  • 28