Browse Source

Fix max-connection limit handling/100% cpu usage (fixes #1436)

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2387 152afb58-edef-0310-8abb-c4023f1b3aa9
svn/tags/lighttpd-1.4.21
Stefan Bühler 13 years ago
parent
commit
24d08807c5
  1. 1
      NEWS
  2. 6
      src/server.c

1
NEWS

@ -33,6 +33,7 @@ NEWS
* Allow mod_compress to return 304 (Not Modified); compress ignores the static-file.etags option.(fixes #1884)
* Add option to ignore the "Expect: 100-continue" header instead of returning 417 Expectation failed (closes #1017)
* Use modified etags in mod_compress (fixes #1800)
* Fix max-connection limit handling/100% cpu usage (fixes #1436)
- 1.4.20 - 2008-09-30

6
src/server.c

@ -1298,7 +1298,7 @@ int main (int argc, char **argv) {
/* our server sockets are disabled, why ? */
if ((srv->cur_fds + srv->want_fds < srv->max_fds * 8 / 10) && /* we have enough unused fds */
(srv->conns->used < srv->max_conns * 0.9) &&
(srv->conns->used <= srv->max_conns * 9 / 10) &&
(0 == graceful_shutdown)) {
for (i = 0; i < srv->srv_sockets.used; i++) {
server_socket *srv_socket = srv->srv_sockets.ptr[i];
@ -1311,7 +1311,7 @@ int main (int argc, char **argv) {
}
} else {
if ((srv->cur_fds + srv->want_fds > srv->max_fds * 9 / 10) || /* out of fds */
(srv->conns->used > srv->max_conns) || /* out of connections */
(srv->conns->used >= srv->max_conns) || /* out of connections */
(graceful_shutdown)) { /* graceful_shutdown */
/* disable server-fds */
@ -1350,7 +1350,7 @@ int main (int argc, char **argv) {
if (graceful_shutdown) {
log_error_write(srv, __FILE__, __LINE__, "s", "[note] graceful shutdown started");
} else if (srv->conns->used > srv->max_conns) {
} else if (srv->conns->used >= srv->max_conns) {
log_error_write(srv, __FILE__, __LINE__, "s", "[note] sockets disabled, connection limit reached");
} else {
log_error_write(srv, __FILE__, __LINE__, "s", "[note] sockets disabled, out-of-fds");

Loading…
Cancel
Save