# How to see nginx rps (requests per second)

**URL:** <https://www.ruby-forum.com/t/how-to-see-nginx-rps-requests-per-second/215472>\
**Category:** NGINX\
**Created:** [January 5, 2012, 11:02am UTC](https://www.ruby-forum.com/t/how-to-see-nginx-rps-requests-per-second/215472 "2012-01-05T11:02:02Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![luislavena](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/0ea827/32.png) [@luislavena](https://www.ruby-forum.com/u/luislavena)\
**Post date:** [January 5, 2012, 11:02am UTC](https://www.ruby-forum.com/t/how-to-see-nginx-rps-requests-per-second/215472/1 "2012-01-05T11:02:02Z")

</div>

Hi Guys,

I have enable stub module and location /status/ in nginx.conf

All I see just :

Active connections: 1  
server accepts handled requests  
478077 478077 478271  
Reading: 0 Writing: 1 Waiting: 0

How can I know which values is the rps of the nginx server ?

Thanks guys.

Posted at Nginx Forum:

> **[How to see nginx rps (requests per second)](https://forum.nginx.org/read.php?2,220831,220831#msg-220831)**
>
> Hi Guys, I have enable stub module and location /status/ in nginx.conf All I see just : Active connections: 1 server accepts handled requests 478077 478077 478271 Reading: 0 Writing: 1 Waiting: 0 How can I know whi

---

<div class="post-metadata">

**Author:** ![atrus](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/67e7ee/32.png) [@atrus](https://www.ruby-forum.com/u/atrus)\
**Post date:** [January 5, 2012, 11:03am UTC](https://www.ruby-forum.com/t/how-to-see-nginx-rps-requests-per-second/215472/2 "2012-01-05T11:03:17Z")

</div>

## use ApacheBench(ab), http\_load, siege or other performance tools

blog: [http://chenxiaoyu.org](http://chenxiaoyu.org)

2012/1/5 atrus [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![atrus](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/67e7ee/32.png) [@atrus](https://www.ruby-forum.com/u/atrus)\
**Post date:** [January 5, 2012, 11:41am UTC](https://www.ruby-forum.com/t/how-to-see-nginx-rps-requests-per-second/215472/3 "2012-01-05T11:41:45Z")

</div>

Hi,

I beleive the stub module gives the number of requests since nginx was  
last reloaded (or started). To get the number of rps, you have to query  
the stub module each second and substract the old value from the current  
value.

Regards,

Posted at Nginx Forum:

> **[Re: How to see nginx rps (requests per second)](https://forum.nginx.org/read.php?2,220831,220834#msg-220834)**
>
> Hi Guys, I have enable stub module and location /status/ in nginx.conf All I see just : Active connections: 1 server accepts handled requests 478077 478077 478271 Reading: 0 Writing: 1 Waiting: 0 How can I know whi

---

<div class="post-metadata">

**Author:** ![atrus](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/67e7ee/32.png) [@atrus](https://www.ruby-forum.com/u/atrus)\
**Post date:** [January 5, 2012, 3:13pm UTC](https://www.ruby-forum.com/t/how-to-see-nginx-rps-requests-per-second/215472/4 "2012-01-05T15:13:01Z")

</div>

Thanks Yogui.

Is there any other ways to do this automatically instead of manually  
subtract ?! I want to see in live.

Posted at Nginx Forum:

> **[Re: How to see nginx rps (requests per second)](https://forum.nginx.org/read.php?2,220831,220843#msg-220843)**
>
> Hi Guys, I have enable stub module and location /status/ in nginx.conf All I see just : Active connections: 1 server accepts handled requests 478077 478077 478271 Reading: 0 Writing: 1 Waiting: 0 How can I know whi

---

<div class="post-metadata">

**Author:** ![atrus](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/67e7ee/32.png) [@atrus](https://www.ruby-forum.com/u/atrus)\
**Post date:** [January 7, 2012, 2:56pm UTC](https://www.ruby-forum.com/t/how-to-see-nginx-rps-requests-per-second/215472/5 "2012-01-07T14:56:08Z")

</div>

If you’ve logging enabled in some sort, you could use a Visual Log  
Analyzer, I know some of them work for Apache-style logs, but it  
requires the overhead of having logging enabled for your webserver.

Such log-analysers don’t need many resources, as they don’t require any  
interaction with requests served by nginx, they just read the logs nginx  
produces every x seconds.

Posted at Nginx Forum:

> **[Re: How to see nginx rps (requests per second)](https://forum.nginx.org/read.php?2,220831,220905#msg-220905)**
>
> Hi Guys, I have enable stub module and location /status/ in nginx.conf All I see just : Active connections: 1 server accepts handled requests 478077 478077 478271 Reading: 0 Writing: 1 Waiting: 0 How can I know whi

---

<div class="post-metadata">

**Author:** ![atrus](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/67e7ee/32.png) [@atrus](https://www.ruby-forum.com/u/atrus)\
**Post date:** [January 6, 2012, 3:04pm UTC](https://www.ruby-forum.com/t/how-to-see-nginx-rps-requests-per-second/215472/6 "2012-01-06T15:04:47Z")

</div>

On Jan 5, 2012, at 9:12 AM, atrus wrote:

> Is there any other ways to do this automatically instead of manually  
> subtract ?! I want to see in live.

we have some command line ruby/perl scripts that do this, pretty simple.  
If you wanted to do this “in” nginx, I guess the easiest way would be  
using Lua that did a location\_capture of stub\_status and cached the  
value ( using [GitHub - nginxinc/nginx-wiki: ARCHIVED -- Source for the now archived NGINX Wiki section of https://www.nginx.com · GitHub](http://wiki.nginx.org/HttpLuaModule#ngx.shared.DICT)  
maybe).

Or, have a script that polls nginx stub status every x seconds and  
writes it out to a static file that nginx can serve.

I’d rather nginx just provide the raw data and I can slice and dice it  
for my own needs.

–Brian

---

<div class="post-metadata">

**Author:** ![atrus](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/67e7ee/32.png) [@atrus](https://www.ruby-forum.com/u/atrus)\
**Post date:** [January 7, 2012, 3:36pm UTC](https://www.ruby-forum.com/t/how-to-see-nginx-rps-requests-per-second/215472/7 "2012-01-07T15:36:20Z")

</div>

@atrus

Please remember that what you are looking for is a “human” value, as  
opposed to the snapshot type of values the server can reliably provide.  
The reason why nginx does not provide what you are looking for may be  
that the server would have to provide several intervals to satisfy  
everyone (second, millisecond, minute, hour, etc.), and that is neither  
practical nor reliable. Such data could also be misleading, depending on  
your use case. From a server point of view, the best thing to do was to  
give a total number of requests served and let the admins do the math as  
they see fit.

However, the stub status module provides easy-to-read data that you can  
parse with a script in a loop, or such a script could dump the stats in  
a database and you could then read that. That is the best long-term  
solution to your problem. Please remember too that this database does  
not need to be SQL, it could be RRD-based for example, or just plain  
files, whatever suits you best.

Regards,

Posted at Nginx Forum:

> **[Re: How to see nginx rps (requests per second)](https://forum.nginx.org/read.php?2,220831,220908#msg-220908)**
>
> Hi Guys, I have enable stub module and location /status/ in nginx.conf All I see just : Active connections: 1 server accepts handled requests 478077 478077 478271 Reading: 0 Writing: 1 Waiting: 0 How can I know whi

---

<div class="post-metadata">

**Author:** ![atrus](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/67e7ee/32.png) [@atrus](https://www.ruby-forum.com/u/atrus)\
**Post date:** [January 7, 2012, 7:19pm UTC](https://www.ruby-forum.com/t/how-to-see-nginx-rps-requests-per-second/215472/8 "2012-01-07T19:19:33Z")

</div>

atrus wrote in post #1039525:

> Hi Guys,
> 
> I have enable stub module and location /status/ in nginx.conf
> 
> All I see just :
> 
> Active connections: 1  
> server accepts handled requests  
> 478077 478077 478271  
> Reading: 0 Writing: 1 Waiting: 0
> 
> How can I know which values is the rps of the nginx server ?
> 
> Thanks guys.
> 
> Posted at Nginx Forum:  
> [http://forum.nginx.org/read.php?2,220831,220831#msg-220831](http://forum.nginx.org/read.php?2,220831,220831#msg-220831)

If you are just interested in knowing Request per second and if you have  
logging enabled then I would suggest using netcat. you just need to tail  
the log file and then use the netcat to count the lines and it would  
give you the details you need. Since the tail by default updates every 1  
second you will get what you need.
