Calculating Request per Second (RPS) in Azure

These days I’m on a mission to balance our server sizes in Azure with the actual usage. As part of that it’s very important to know our real RPS (Requests per Second).

When you plug your app to Azure AppInsight many valuable data will be captured and recorded. Azure itself, provides some basic queries for showing some useful charts about your usage. For example, response duration, dependency duration etc. however, there will be a time where you need to run your own specific query in order to make business related decisions. At that stage Azure AppInsight Analytics comes to play with an online query builder/editor to help you run custom queries, draw charts and extract meaningful information.

At this time, I wanted to see our RPS over a particular period. Although if you enable AppInsight live streaming , you will see your live RPS but in my case I needed to draw that chart for the duration of a day in order to find the peeks.

Here is the code for calculating RPS for the past hour:

| where timestamp > ago(1h)
| summarize r = count(appId) by bin(timestamp, 1s)
| render timechart

With some adjustment here is the code and a chart for requests per minute for the past day:

| where timestamp > ago(1d)
| summarize r = count(appId) by bin(timestamp, 1m)
| render timechart

Azure Analytics RPS


Leave a Reply

Your email address will not be published. Required fields are marked *