HttpLogRequestSpeed

Contents

ngx_http_log_request_speed

The ngx_http_log_request_speed module is helping you to find the heavy requests of your webpage. I originally wrote the module for myself to be able to find the urls of our website that take long time to process, which are probably also the heavy ones that generate a lot of load on the server. By analyzing the slow request logs we can get hints on which parts of the website that we should probably recheck for their efficiency.

Directives

log_request_speed_filter

This directive enables the log_request_speed filter for the location/server/http block you specify it in.

log_request_speed_filter_timeout

syntax:log_request_speed_filter_timeout [num milisec]

default:5000

context:location, server, http

The timeout defines how long a request at least has to take to get logged. If the timeout is for example set to 5000 miliseconds, a request that takes 4000 miliseconds won't get a request speed log entry, a 6000 miliseconds taking one will get logged.

Usage

When a request gets to the log request speed filter and takes at least the defined timeout there will be an error log entry like the following: