ports/176438: nrpe2 consuming cpu when handling new connections
Kajetan Staszkiewicz
kajetan.staszkiewicz at innogames.de
Tue Feb 26 11:30:01 UTC 2013
>Number: 176438
>Category: ports
>Synopsis: nrpe2 consuming cpu when handling new connections
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Tue Feb 26 11:30:00 UTC 2013
>Closed-Date:
>Last-Modified:
>Originator: Kajetan Staszkiewicz
>Release: 9.1-RELEASE
>Organization:
InnoGames GmbH
>Environment:
FreeBSD xxxxxxx 9.1-RELEASE FreeBSD 9.1-RELEASE #10 r247265M: Mon Feb 25 14:58:39 CET 2013 root at xxxxx:/usr/obj/usr/src/sys/IGLB3 amd64
>Description:
When nrpe2 built with SSL support accepts a new connection, it enters a loop waiting for SSL handshake. If no handshake occurs but the tcp connection is established, the loop consumes all available cpu time.
1004 /* keep attempting the request if needed */
1005 while(((rc=SSL_accept(ssl))!=1) && (SSL_get_error(ssl,rc)==SSL_ERROR_WANT_READ));
I've observed this behavior on FreeBSD 9.0 and 9.1, I was told it happens also on 6.x.
This does not happen on nrpe2 running on Debian. Running strace/gdb on the process shows that in Linux it is waiting on read(), while on FreeBSD it iterates the loop over and over very fast.
>How-To-Repeat:
`telnet localhost 5666` is enough to observe 100% cpu usage in top.
>Fix:
A dirty hack is to add usleep(100000) in the aforementioned loop.
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list