hipages / php-fpm_exporter

A prometheus exporter for PHP-FPM.
Apache License 2.0
579 stars 111 forks source link

added timeouts to avoid memory leaking #328

Open damoon opened 9 months ago

damoon commented 9 months ago

In case the fcgi client does not get a response, without the timeout, it will never free the waitgroup in the Update function and never free the mutex in the Collect function. This stops the metrics endpoint from responding. Requests will get queued until the process gets killed with out of memory. To prevent this, first a timeout was added for the fcgi client and second a timeout and limit was added for the incoming requests.

This issue was also reported in #253.

frvade commented 7 months ago

@estahn could you please help with the review and merge here maybe 🙏 The related issue is very actual because it leads to repeating OOM killer alerts

damoon commented 5 months ago

i rebased this to allow for merging. any chance this could be reviewed?