Docker Community Forums

Share and learn in the Docker community.

How to check http request per second made to an nginx test server

Hi guys! New to Docker here.

I am trying to figure out how I can view the requests made per second from the access log for my Docker nginx container. I made multiple concurrent requests to the server, and running docker logs [container_id] omitted stacks of the following:

$remote_addr - $remote_user [$time_local] "$request" $status $body_bytes_sent "$http_referer" "$http_user_agent"

This is fine. I just can’t seem to find a way to determine the requests/second made to the server. Is there a way to calculate this or are there any commands that I need to run in order to access some kind of file?

Please advise. Note I don’t (or rather is not allowed) want to use ApacheBench, I would only like to determine the req/sec by using the access log.

Thank you!

Edit nginx.conf file:

vi nginx.conf

Add or append the following in context location:

location /nginx_status {
# Turn on stats
stub_status on;
access_log off;
# only allow access from 192.168.1.5 #
allow 192.168.1.5;
deny all;
}
Save and close the file. Reload nginx server:

service nginx reload

OR

nginx -s reload