Percentiles in Performance Testing

by Sujay Prabhu, Senior System Analyst

The page load time is an important aspect of the website user experience. The faster the page loads, the happier the users will be. There are various reasons for slow web page loads. Performance monitoring and testing of API endpoints is one way of understanding how websites and services behave when hundreds or thousands of users access them.

What is Percentile ?

Percentile is the common metric in case of Performance testing. If a backend service's 95 percentile is 30ms, it means 95% of requests have response time of less than 30ms.

How to calculate Percentile ?

Here is the response time for one of the endpoint:

RESPONSE_TIMES

Sort the data based on response times

SORTED_RESPONSE_TIMES

Apply the formula

index = (n * (90/100)) where n = Number of requests
index = (10 * 0.9)
index = 9

In the above table, 9th index value is 4.6

So, 90 percentile for the above set of response times is 4.6

Here I am calculating 90 percentile for fewer data where as in real world applications this number can be in thousands or millions.

What about average response time ?

Average response time is also one of the metrics of performance monitoring and as the name says it is the average value of the response times. This can occasionally be misleading if fewer requests have very high response times.

Consider the above set of records and if the response times were as mentioned below instead of 5.1 and 4.6

AVERAGE_RESPONSE_TIMES

Average response time is 4.34s even though majority of the response time hovers between 2 and 3. Thus with average response time metric, fewer requests can bring difference in how the graph looks

More articles

Operating Kafka in Rails with Karafka: Production Architecture, Consumers, and DLQs (Part 2)

In Part 2, we dive deep into the Sync-Out pipeline—how Rails publishes events to Kafka, how our legacy adapter writes to SQL Server 2009 using TinyTDS, and how Dead-Letter Queues (DLQs) became our lifeline during production incidents. This post covers transaction management, service objects, and operational workflows for handling failures.

Read more

Operating Kafka in Rails with Karafka: Production Architecture, Consumers, and DLQs (Part 1)

This post breaks down our production architecture for event streaming in Rails using Kafka and Karafka—from designing producers and consumer flows to handling failures with DLQs and keeping warehouse databases in sync reliably.

Read more

Ready to Build Something Amazing?

Codemancers can bring your vision to life and help you achieve your goals