Answer the question
In order to leave comments, you need to log in
How to determine the number of requests per second on nginx?
Good day, you need to determine the number of requests per second of the nginx server through the console using the logs, since there are many virtual domains on one server, and determining through status does not make sense. There is a command tail -f /var/log/nginx/mydomain.ru.access.log | pv -lr -i 1 >/dev/null, but it shows everything in real time without stopping the process, but you need to get only 1 response in real time with the process stopping, I couldn’t find anything like that in the documentation for PV, please tell me , maybe there are other options for determining the number of requests, I would be very grateful.
Answer the question
In order to leave comments, you need to log in
cat /var/log/nginx/mydomain.ru.access.log | awk '{print $1}' | uniq -c | sort -rn
34 "2020-11-24T10:44:19+00:00"
21 "2020-11-24T10:36:11+00:00"
21 "2020-11-24T10:29:59+00:00"
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question