nginx module ngx_http_log_request_speed can be used to find out which requests on the website are slow. If you want to find out which requests are slow when there are many sites, files and requests, this plug-in is very effective and can be used to find out the requests in the site that take longer to process. , these requests are a large source of high load on the server.
ngx_http_log_request_speed module mainly contains two configuration parameters, log_request_speed_filter and log_request_speed_filter_timeout; log_request_speed_filter is mainly used to turn on or off the recording function, and log_request_speed_filter_timeout sets specific values according to needs.
Third-party module compilation and installation parameters:
1. log_request_speed_filter
Syntax: log_request_speed_filter on | off
Configuration section: http, server, location
This parameter is mainly used to enable or disable the logging function
2. log_request_speed_filter_timeout
Syntax: log_request_speed_filter_timeout [num sec]
Configuration section: http, server, location
Default: 5 seconds
This is not a real timeout, but it means that when the request exceeds the time given here, it will be recorded in the nginx error log. The default value is 5000 microseconds (5 seconds) , if a request is less than 5 seconds, the request will not be recorded in the log, but if it exceeds 5 seconds, the request will be recorded in the nginx error log.
3. Configuration usage example
log_request_speed_filter on;
Define enable logging function
log_request_speed_filter_timeout 5;
Define the request timeout recording time
The above introduces the nginx recording website slow request ngx_http_log_request_speed, including the content of request and speed. I hope it will be helpful to friends who are interested in PHP tutorials.