From 035986c48939a109c298aabade4c03ca2e1b0a64 Mon Sep 17 00:00:00 2001 From: Anton Tolchanov Date: Sat, 21 Sep 2024 10:12:59 +0200 Subject: [PATCH] Document sleep(0) warning in README --- README.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/README.md b/README.md index 8f03fa1..2181a7c 100644 --- a/README.md +++ b/README.md @@ -427,6 +427,21 @@ issue: * Debian 11 (bug [#994178](https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=994178)) * Ubuntu 20.04 and 21.04 (bug [#1893753](https://bugs.launchpad.net/ubuntu/+source/nginx/+bug/1893753)) +### ngx.sleep(0) called without delayed events patch + +You might see the following warning logged by nginx when metrics are being +collected: + +> [warn] ngx.sleep(0) called without delayed events patch, this will hurt performance + +This is a side effect of a performance optimization added for OpenResty. While +generating metric data, the library aims to occasionally yield control back to +the nginx event loop to avoid blocking the worker process and causing increased +latency for other in-flight requests. + +This warning is displayed when the library is used with nginx that lacks +OpenResty patches and can safely be ignored. + ## Troubleshooting ### Make sure that nginx lua module is enabled