Monday, December 30, 2013

Understanding TIME in performance testing i.e. Total Response Time, Latency, Server Response Time, Client/Browser/Rendering Time etc

Welcome back Performance testers!
Today we will talk on some basics of performance testing.
In every performance testing, the central theme is the TIME and every possible effort is made to reduce this, as much as possible.
So lets talk different terminologies related to time in performance testing.

We will take a simple example to understand the basics, instead of going into boring definitions.

My example is about two friends Mr. A and Mr. B who are chatting using their mobile phone.


1) A sends a message to B at suppose zeroth time.

2) Due to congestion in n/w, mobile towers etc the message reaches after 1 sec to B
Network Delay/Latency: This 1 sec delay in n/w is called Latency. So we see latency is property of n/w. Means if B lives far away in other state then the hops between towers will be more and thus more will be the latency and vise-versa. Important thing here is that this latency can be reduced to a certain extent (by improving infrastructure etc) but can never be zero and there will be a minimum limit of it for any n/w. [at max it can be reduced upto the time taken by universal constant i.e. speed of light :) I will talk more on latency in separate post]

3) Now the message reaches to B and he opens the message and starts reading and understanding the text. This takes him 5 sec ( to read, understand & be ready to reply)
Server response time: This 5 sec is the time taken by Mr. B (or server ) to understand the message/question and be ready to respond is called Server response time.
Ok, so now B send a pic along with the reply.

4) Again the inevitable latency add the delay of 1 sec :)

5) Now A hears a beep in his mobile, which means that the reply has been reached to B's mobile.
Total response time/Turn Around Time: So the total time of 1 sec(latency)+5 sec (server res time)+1 sec (latency) = 7 sec is total response time or Turn around time.
Technical def: Time between the first byte sent by client to server and the last byte received by the client from server is called Total Response time.

6) Now the pic is received on A's mobile but when A opens the picture then it takes 2 sec to load it on the picture viewer of the mobile.
Browser/Client/Rendering time: Now this 2 sec is the time taken by mobile picture viewer app to load the pic although the picture was already downloaded on the mobile.
I know, it can be a little confusing here to understand whether it should be added in Total Res time or should be kept separate.
The res time to download the pic is already included when the mobile gives a message beep (means response has reached mob) and when we try to see the pic then actually its the app/browser of the mobile which takes time to load the pic.
In other way, we can say if we improve the mobile efficiency (i.e. processing power, RAM etc) then we can reduce this client time. So actually its a property of the device on which you are viewing the message.

What do we tune during the performance test?
A) Mainly we are worried about the Server response time, which is nothing but Application under test (AUT) and we try to reduce the time taken by it.
B) Reducing the latency time is actually performance tuning the network and not application (which needs an exclusive/isolated load test). Again we can't reduce this beyond certain limit.
C) Reducing Client/Browser/Rendering time does not come under scope of performance testing/tuning as it will vary for different devices.

Hope you get the concept!
Please do post your reply in case you have any queries or if there is any conceptual mistake in my explanation...

No comments:

Post a Comment