summaryrefslogtreecommitdiff
path: root/src/server.c
diff options
context:
space:
mode:
authorstbuehler <stbuehler@152afb58-edef-0310-8abb-c4023f1b3aa9>2009-04-09 21:10:25 +0000
committerstbuehler <stbuehler@152afb58-edef-0310-8abb-c4023f1b3aa9>2009-04-09 21:10:25 +0000
commit1d2d8ae69f74ffc86cb1fd1bb917c8ec94e17602 (patch)
treec0625d9373151207dc1ec71c90bc332f6acb251d /src/server.c
parentfe2880f05df4f2ee25aa73349eb82122d788a5d0 (diff)
downloadlighttpd-1d2d8ae69f74ffc86cb1fd1bb917c8ec94e17602.tar.gz
merge: Use/enforce sane max-connection values (#1803)
git-svn-id: svn://svn.lighttpd.net/lighttpd/trunk@2453 152afb58-edef-0310-8abb-c4023f1b3aa9
Diffstat (limited to 'src/server.c')
-rw-r--r--src/server.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/server.c b/src/server.c
index 3d37e29d..b053a9c3 100644
--- a/src/server.c
+++ b/src/server.c
@@ -1416,15 +1416,16 @@ int main (int argc, char **argv, char **envp) {
}
/* set max-conns */
- if (srv->srvconf.max_conns > srv->max_fds) {
- /* we can't have more connections than max-fds */
- srv->max_conns = srv->max_fds;
+ if (srv->srvconf.max_conns > srv->max_fds/2) {
+ /* we can't have more connections than max-fds/2 */
+ log_error_write(srv, __FILE__, __LINE__, "sdd", "can't have more connections than fds/2: ", srv->srvconf.max_conns, srv->max_fds);
+ srv->max_conns = srv->max_fds/2;
} else if (srv->srvconf.max_conns) {
/* otherwise respect the wishes of the user */
srv->max_conns = srv->srvconf.max_conns;
} else {
- /* or use the default */
- srv->max_conns = srv->max_fds;
+ /* or use the default: we really don't want to hit max-fds */
+ srv->max_conns = srv->max_fds/3;
}
if (HANDLER_GO_ON != plugins_call_init(srv)) {