git-svn: trunk@5025
Török Edvin authored on 2009/04/06 19:26:15... | ... |
@@ -1,3 +1,8 @@ |
1 |
+Mon Apr 6 12:32:44 EEST 2009 (edwin) |
|
2 |
+------------------------------------- |
|
3 |
+ * docs/man/clamd.conf.5.in, etc/clamd.conf, shared/optparser.c: fix |
|
4 |
+ documentation of formula to reflect reality. |
|
5 |
+ |
|
1 | 6 |
Mon Apr 6 12:26:04 EEST 2009 (edwin) |
2 | 7 |
------------------------------------- |
3 | 8 |
* clamconf/clamconf.c, docs/man/clamd.conf.5.in, etc/clamd.conf, |
... | ... |
@@ -945,6 +945,8 @@ int recvloop_th(int *socketds, unsigned nsockets, struct cl_engine *engine, unsi |
945 | 945 |
#if !defined(C_WINDOWS) && defined(RLIMIT_NOFILE) |
946 | 946 |
if (getrlimit(RLIMIT_NOFILE, &rlim) == 0) { |
947 | 947 |
/* don't warn if default value is too high, silently fix it */ |
948 |
+ unsigned maxrec; |
|
949 |
+ int max_max_queue; |
|
948 | 950 |
unsigned warn = optget(opts, "MaxQueue")->active; |
949 | 951 |
const unsigned clamdfiles = 6; |
950 | 952 |
/* Condition to not run out of file descriptors: |
... | ... |
@@ -952,16 +954,16 @@ int recvloop_th(int *socketds, unsigned nsockets, struct cl_engine *engine, unsi |
952 | 952 |
* CLAMDFILES is 6: 3 standard FD + logfile + 2 FD for reloading the DB |
953 | 953 |
* */ |
954 | 954 |
opt = optget(opts,"MaxRecursion"); |
955 |
- unsigned maxrec = opt->numarg; |
|
956 |
- int max_max_queue = rlim.rlim_cur - maxrec * max_threads - clamdfiles + max_threads; |
|
955 |
+ maxrec = opt->numarg; |
|
956 |
+ max_max_queue = rlim.rlim_cur - maxrec * max_threads - clamdfiles + max_threads; |
|
957 | 957 |
if (max_queue < max_threads) { |
958 | 958 |
max_queue = max_threads; |
959 | 959 |
if (warn) |
960 | 960 |
logg("^MaxQueue value too low, increasing to: %d\n", max_queue); |
961 | 961 |
} |
962 | 962 |
if (max_max_queue < max_threads) { |
963 |
- logg("^MaxThreads * MaxRecursion is too high: %d, open file descriptor limit is: %d\n", |
|
964 |
- maxrec*max_threads, rlim.rlim_cur); |
|
963 |
+ logg("^MaxThreads * MaxRecursion is too high: %d, open file descriptor limit is: %lu\n", |
|
964 |
+ maxrec*max_threads, (unsigned long)rlim.rlim_cur); |
|
965 | 965 |
max_max_queue = max_threads; |
966 | 966 |
} |
967 | 967 |
if (max_queue > max_max_queue) { |
... | ... |
@@ -136,7 +136,7 @@ It is recommended to have this value at least twice MaxThreads if possible. |
136 | 136 |
.br |
137 | 137 |
\fBWARNING: you shouldn't increase this too much to avoid running out of file descriptors, |
138 | 138 |
the following condition should hold: |
139 |
-MaxThreads*MaxRecursion + MaxQueue < RLIMIT_NOFILE.\fR |
|
139 |
+MaxThreads*MaxRecursion + MaxQueue - MaxThreads + 6 < RLIMIT_NOFILE.\fR |
|
140 | 140 |
RLIMIT_NOFILE is the maximum number of open file descriptors (usually 1024), set |
141 | 141 |
by \fBulimit -n\fR. |
142 | 142 |
.br |
... | ... |
@@ -129,7 +129,7 @@ LocalSocket /tmp/clamd.socket |
129 | 129 |
# It is recommended to have this value at least twice MaxThreads if possible. |
130 | 130 |
# WARNING: you shouldn't increase this too much to avoid running out of file descriptors, |
131 | 131 |
# the following condition should hold: |
132 |
-# MaxThreads*MaxRecursion + MaxQueue < RLIMIT_NOFILE (usual max is 1024) |
|
132 |
+# MaxThreads*MaxRecursion + (MaxQueue - MaxThreads) + 6< RLIMIT_NOFILE (usual max is 1024) |
|
133 | 133 |
# |
134 | 134 |
# Default: 100 |
135 | 135 |
#MaxQueue 200 |
... | ... |
@@ -197,7 +197,7 @@ const struct clam_option clam_options[] = { |
197 | 197 |
|
198 | 198 |
{ "ReadTimeout", NULL, 0, TYPE_NUMBER, MATCH_NUMBER, 120, NULL, 0, OPT_MILTER, "Waiting for data from clamd will timeout after this time (seconds).\nValue of 0 disables the timeout.", "300" }, |
199 | 199 |
|
200 |
- { "MaxQueue", NULL, 0, TYPE_NUMBER, MATCH_NUMBER, 100, NULL, 0, OPT_CLAMD, "Maximum number of queued items (including those being processed by MaxThreads threads)\nIt is recommended to have this value at least twice MaxThreads if possible.\nWARNING: you shouldn't increase this too much to avoid running out of file descriptors,\n the following condition should hold:\n MaxThreads*MaxRecursion + MaxQueue < RLIMIT_NOFILE (usual max is 1024)\n", "200" }, |
|
200 |
+ { "MaxQueue", NULL, 0, TYPE_NUMBER, MATCH_NUMBER, 100, NULL, 0, OPT_CLAMD, "Maximum number of queued items (including those being processed by MaxThreads threads)\nIt is recommended to have this value at least twice MaxThreads if possible.\nWARNING: you shouldn't increase this too much to avoid running out of file descriptors,\n the following condition should hold:\n MaxThreads*MaxRecursion + MaxQueue - MaxThreads + 6 < RLIMIT_NOFILE (usual max is 1024)\n", "200" }, |
|
201 | 201 |
|
202 | 202 |
{ "IdleTimeout", NULL, 0, TYPE_NUMBER, MATCH_NUMBER, 30, NULL, 0, OPT_CLAMD, "This option specifies how long (in seconds) the process should wait\nfor a new job.", "60" }, |
203 | 203 |
|