What is Response Time?

One of the primary goals of Software Performance Engineering is to satisfy the response time as defined by Service Level Agreements (SLAs). Response time is one of the simplest concept yet it is not fully understood by many.

Let us take a real world example. You go to a restaurant and place an order for lunch. What is the total time to execute this order? Let’s look at the sequence of events. The waiter spends some time taking your order and then places it as the last item in a queue of orders. When this order reaches the top of the queue one of the cooks takes this order and cooks the dish and when it is ready the waiter brings it to your table. So the total time for your order is the sum of processing time ( time to take order + cooking time) and the wait time ( time the order was in the queue).

Response time can be defined as the total time taken to perform an action. This total time could include time processing the action ( in the app server, database, client etc.) and the time spent waiting ( network, IO, memory..). In Software Performance Engineering, Response Time can be surmised as sum of processing time and wait time.

Lets take an example from software engineering. In unix there is a utility “time” or “timex” for measuring the elapsed time for a particular process. We will be looking at a granular level, analyzing a particular process within a system and not the response time for a particular action through the whole solution. Let’s say your application process is “myapp”, you can run the time command on that application as below.

>time myapp
4.6 real 0.5 user 0.8 sys

The output shows that the elapsed time ( real time or the response time perceived by the user) for running the “myapp” process is 4.6 seconds. The total CPU time for running this process is 1.3 CPU seconds, out of which 0.5 cpu seconds is spent in user mode and 0.8 cpu second in system mode (kernel). Where is the rest of the time? How do you account for 3.3 seconds.

Time could have been spent performnig I/O operation some of which is attributed to system time, but time spent by disk drives, network interfaces, terminal controller, or other hardware is not accounted for by the “time” command. Time could have been also spent running jobs on behalf of other users ( context switching) or waiting for memory. Many different components contribute to a program’s elapsed time.

Some of the notable elements for the breakup of elapsed time is as follows

  1. User CPU Time : The amount of time the CPU spends running user’s program in user state ( executing library function but excluding time spent in kernel).
  2. System CPU Time: The amount of time the CPU spends in the system state ( amount of time executing kernel code ).
  3. I/O time: The amount of time the I/O Subsystem spends servicing I/O requests by the process.
  4. Network time: The amount of time the I/O Subsystem spends servicing the netwrok requests that the job issues.
  5. Time spent running other programs: As the load increases, the CPU will spent less time on a particular program and will be switching between programs to give them some slice of time.
  6. Virtual Memory: Ideally all the programs remain in the system’s memory, but when the memory is overloaded and not all program’s can exist in the memory, the system starts paging memory to and from the disk therby increasing the time spent servicing memory request.

The bottom line is  Response time = Processing Time + Wait Time.

Oracle has also changed the way they collect and report performance. The impetus is on wait time. Oracle introduced Oracle Wait Interface ( OWI) in 7.0.12 but it has really matured 10g onwards. This interface provides wait time metrics for numerous events. Mostly the response time degrades significantly due to high wait time and if you can reduce the wait time you can really improve the response times. I will cover OWI in a different post. Also there are system tools ( sar, iostat etc.) which give good indication of the wait time at the system level, those will also be covered in a different post.

Refernces: System Performance Tuniong (Mike Loukides, O’Reilly)


Tags: , , , , , , , , , , , , , , , ,

7 Responses to “What is Response Time?”

  1. MCSA Says:

    An interesting dialogue is price comment. I think that you must write extra on this matter, it won’t be a taboo topic but generally persons are not sufficient to talk on such topics. To the next. Cheers

  2. Mariella Barrack Says:

    Aw, this was a really great post. In theory I?d like to write like this also ? taking time and real effort to make

  3. Gavin Powelson Says:

    I’ m amazed next to how copious the sea life looked in this clip, consciousness the Japanese overwhelm and kill endangered species like fin and blue whales, blue? fin tuna, sharks, whales, dolphins, Dall’s Porpoises, (which Japanese overtake as whale meat), scarce sea horses, not to mention Bengal tigers, giant salamanders, ect. If they’re not roughly slaughtering these helpless animals, they’re selling them by the black market representing zoos and such…

  4. Franklyn Tostado Says:

    I just had very lagging online game all the time and i acquired delay up to 800ms to 1000ms . I truly satisfied to make use of Reducelag since recently. It lessen ping my own online game to 180ms to 200ms. Currently i can play and assist my group with better performance.

  5. go right here Says:

    I do accept as true with all the concepts you’ve introduced on your post. They are really convincing and will definitely work. Nonetheless, the posts are too quick for novices. May you please lengthen them a little from next time? Thanks for the post.

  6. Imogene Nedman Says:

    It’s really a nice and useful piece of information. I’m glad that you just shared this useful information with us. Please stay us up to date like this. Thanks for sharing.

  7. Grace Coomey Says:

    I am also writing to let you know of the wonderful encounter our daughter experienced reading your site. She came to find many details, with the inclusion of what it is like to possess a very effective giving character to get many others completely have an understanding of certain multifaceted issues. You actually did more than our expectations. Many thanks for providing those important, trusted, educational as well as fun thoughts on the topic to Lizeth.

Leave a Reply