check_http inefficient and sometimes times out
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
monitoring-plugins (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
Bionic |
Fix Released
|
Undecided
|
Unassigned | ||
Eoan |
Fix Released
|
Undecided
|
Unassigned | ||
Focal |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
[Impact]
* Based on the test case numbers, and the numbers provided by the end user, it seems that memory reclaiming for the http buffer, in check_http module, is the real issue here. It turns out that, a heavily overloaded servers might be under big memory pressure and having difficulties trying to reclaim heap memory pages (flushing dirty cache/buffers, swapped_cached pages, or worst) for the check_http network buffer.
[Test Case]
* Execute check_http with a 150MB file:
- Unpatched (~ 108 sec)
| $ /usr/lib/
| HTTP OK: HTTP/1.1 200 OK - 162594115 bytes in 108.216 second response time |time=108.
- Patched (~ 0.5 sec)
| $ /usr/lib/
| HTTP OK: HTTP/1.1 200 OK - 162594115 bytes in 0.499 second response time
|time=0.
[Regression Potential]
* Very little but existent for the network receiving buffer logic under check_http module.
* Change is based in an bigger upstream commit and only a minor subset of the upstream patch is being backported.
[Other Info]
* Original Description:
Hi,
We're frequently seeing socket timeouts with some checks using the check_http plugin. It seems this is a known issue with some fixes upstream:
| https:/
| https:/
Think we can backport these fixes?
Related branches
- Christian Ehrhardt (community): Approve
- Canonical Server: Pending requested
- git-ubuntu developers: Pending requested
-
Diff: 172 lines (+118/-1)5 files modifieddebian/changelog (+53/-0)
debian/control (+2/-1)
debian/patches/check_http_socket_timeouts.patch (+29/-0)
debian/patches/exclude-tmpfs-squashfs-tracefs.patch (+30/-0)
debian/patches/series (+4/-0)
- Sergio Durigan Junior (community): Approve
- Canonical Server packageset reviewers: Pending requested
- Canonical Server: Pending requested
-
Diff: 152 lines (+106/-2)5 files modifieddebian/changelog (+41/-0)
debian/control (+2/-1)
debian/patches/check_http_socket_timeouts.patch (+29/-0)
debian/patches/exclude-tmpfs-squashfs-tracefs.patch (+30/-0)
debian/patches/series (+4/-1)
- Bryce Harrington (community): Needs Fixing
- Canonical Server Core Reviewers: Pending requested
-
Diff: 74 lines (+40/-1)4 files modifieddebian/changelog (+8/-0)
debian/control (+2/-1)
debian/patches/16_check_http_socket_timeouts (+29/-0)
debian/patches/series (+1/-0)
- Bryce Harrington (community): Needs Fixing
- Canonical Server Core Reviewers: Pending requested
-
Diff: 63 lines (+38/-0)3 files modifieddebian/changelog (+8/-0)
debian/patches/16_check_http_socket_timeouts (+29/-0)
debian/patches/series (+1/-0)
- Bryce Harrington (community): Needs Fixing
- Canonical Server Core Reviewers: Pending requested
-
Diff: 63 lines (+38/-0)3 files modifieddebian/changelog (+8/-0)
debian/patches/16_check_http_socket_timeouts (+29/-0)
debian/patches/series (+1/-0)
- Bryce Harrington (community): Needs Fixing
- Canonical Server Core Reviewers: Pending requested
-
Diff: 60 lines (+38/-0)3 files modifieddebian/changelog (+8/-0)
debian/patches/14_check_http_socket_timeouts (+29/-0)
debian/patches/series (+1/-0)
tags: | added: server-next |
Changed in monitoring-plugins (Ubuntu Bionic): | |
status: | Confirmed → Triaged |
Changed in monitoring-plugins (Ubuntu Eoan): | |
status: | New → Triaged |
Changed in monitoring-plugins (Ubuntu Groovy): | |
status: | Confirmed → Triaged |
Changed in monitoring-plugins (Ubuntu Focal): | |
status: | New → Triaged |
description: | updated |
no longer affects: | monitoring-plugins (Ubuntu Groovy) |
Changed in monitoring-plugins (Ubuntu Bionic): | |
status: | New → In Progress |
Changed in monitoring-plugins (Ubuntu Eoan): | |
status: | New → In Progress |
Changed in monitoring-plugins (Ubuntu Focal): | |
status: | New → In Progress |
description: | updated |
tags: | added: verification-done-bionic |
tags: | added: verification-done-focal |
Tested in my PPA:
| https:/ /launchpad. net/~hloeung/ +archive/ ubuntu/ nagios- nrpe/+packages
With output:
| $ time ./check_http -I 127.0.0.1 -p 9103 -u /metrics -r haproxy_rate -t 50 156696s; ;;0.000000; 50.000000 size=13239810B;;;0
| HTTP OK: HTTP/1.0 200 OK - 13239810 bytes in 1.157 second response time |time=1.
|
| real 0m1.194s
| user 0m0.045s
| sys 0m0.064s
vs.
| $ time /usr/lib/ nagios/ plugins/ check_http -I 127.0.0.1 -p 9103 -u /metrics -r haproxy_rate -t 50 090071s; ;;0.000000; 50.000000 size=13239139B;;;0
| HTTP OK: HTTP/1.0 200 OK - 13239139 bytes in 14.090 second response time |time=14.
|
| real 0m14.128s
| user 0m4.650s
| sys 0m8.808s