Blog

Is The System Actually Running Slow?

When a user says that “the system is slow” we would like to know: Is the system actually running slow or is it a matter of perception?

Is the chronometer distorted or does the system, in fact, prevent the user from working in a normal way?

Nothing beats numbers when we’re in search of conclusions about the system’s true behavior. Something that proves quite useful in revealing the response time of web applications is to enable what is known as “time taken.” It’s used not only for performance tests but also, and mainly, for systems in production.

Basically, we indicate what it is that we want to be recorded on the access_log. What is usually recorded here is the moment at which a resource was accessed. We have the option to request that the information of the “user-agent” be saved (to know from what browser, or even from what device, the access occurred), in addition to the size of the resource sent, the http response code (200 indicating OK, 4XX indicating error on the client side, 5XX indicating error on the server side, and 3XX indicating, in general, a redirection), as well as the time elapsed from the receipt of the request to the return of a response.

This is something quite simple to configure. For example, in Tomcat, we must modify the “server.xml” by including, in the end, the following information:

<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
prefix="access_log." suffix=".txt"
pattern="%h %l %u %t &quot;%r&quot; %s %b &quot;%{Referer}i&quot; &quot;%{User-Agent}i&quot; %D" />

The part where we indicate what should be saved is the one defined in “pattern.” To know the meaning of each parameter, there is a reference here, but, in advance, you should know that the %D (or %T) is what we have to add for the response time, or time taken, to be saved.

After we have an access log with all this information, we can use one of the many tools available for viewing. There are two alternatives to mention, one is commercial (Apache Log Viewer) and the other is open source (AccessLog Viewer by Abstracta).

If we get these accurate measures of each request, we can be sure about the time taken by the server. If those values differ greatly from the user perception, we still need to avoid possible subjectivities in the response times reported by users, so, we can do that by measuring the time taken in the browser (with tools like Fiddler or PageSpeed) and comparing results.

 


Recommended for You

How to Optimize E-commerce Website Performance for Black Friday
How to Execute Performance Tests with Fewer Problems

8 / 436