nginx records website slow requests ngx_http_log_request_speed httprequest setrequestproperty on reques

WBOY
Release: 2016-07-29 08:54:50
Original
1544 people have browsed it

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:

request,request是什么意思,400 bad request,bad request,paste request here,@requestmapping,xmlhttprequest,invalid request,httpservletrequest,request code error,request的用法,requestfocus,httprequest,setrequestproperty,on reques


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

request,request是什么意思,400 bad request,bad request,paste request here,@requestmapping,xmlhttprequest,invalid request,httpservletrequest,request code error,request的用法,requestfocus,httprequest,setrequestproperty,on reques


2. log_request_speed_filter_timeout

Syntax: log_request_speed_filter_timeout [num sec]
Configuration section: http, server, location
Default: 5 seconds

request,request是什么意思,400 bad request,bad request,paste request here,@requestmapping,xmlhttprequest,invalid request,httpservletrequest,request code error,request的用法,requestfocus,httprequest,setrequestproperty,on reques

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

request,request是什么意思,400 bad request,bad request,paste request here,@requestmapping,xmlhttprequest,invalid request,httpservletrequest,request code error,request的用法,requestfocus,httprequest,setrequestproperty,on reques

').addClass('pre-numbering').hide(); $(this).addClass('has-numbering').parent().append($numbering); for (i = 1; i ').text(i)); }; $numbering.fadeIn(1700); }); });

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.

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!