fix documentation, fix warnings.

git-svn: trunk@5025
0.95
Török Edvin 16 years ago
parent 7d444fd93b
commit da3e0e4036
  1. 5
      ChangeLog
  2. 10
      clamd/server-th.c
  3. 2
      docs/man/clamd.conf.5.in
  4. 2
      etc/clamd.conf
  5. 2
      shared/optparser.c

@ -1,3 +1,8 @@
Mon Apr 6 12:32:44 EEST 2009 (edwin)
-------------------------------------
* docs/man/clamd.conf.5.in, etc/clamd.conf, shared/optparser.c: fix
documentation of formula to reflect reality.
Mon Apr 6 12:26:04 EEST 2009 (edwin)
-------------------------------------
* 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
#if !defined(C_WINDOWS) && defined(RLIMIT_NOFILE)
if (getrlimit(RLIMIT_NOFILE, &rlim) == 0) {
/* don't warn if default value is too high, silently fix it */
unsigned maxrec;
int max_max_queue;
unsigned warn = optget(opts, "MaxQueue")->active;
const unsigned clamdfiles = 6;
/* Condition to not run out of file descriptors:
@ -952,16 +954,16 @@ int recvloop_th(int *socketds, unsigned nsockets, struct cl_engine *engine, unsi
* CLAMDFILES is 6: 3 standard FD + logfile + 2 FD for reloading the DB
* */
opt = optget(opts,"MaxRecursion");
unsigned maxrec = opt->numarg;
int max_max_queue = rlim.rlim_cur - maxrec * max_threads - clamdfiles + max_threads;
maxrec = opt->numarg;
max_max_queue = rlim.rlim_cur - maxrec * max_threads - clamdfiles + max_threads;
if (max_queue < max_threads) {
max_queue = max_threads;
if (warn)
logg("^MaxQueue value too low, increasing to: %d\n", max_queue);
}
if (max_max_queue < max_threads) {
logg("^MaxThreads * MaxRecursion is too high: %d, open file descriptor limit is: %d\n",
maxrec*max_threads, rlim.rlim_cur);
logg("^MaxThreads * MaxRecursion is too high: %d, open file descriptor limit is: %lu\n",
maxrec*max_threads, (unsigned long)rlim.rlim_cur);
max_max_queue = max_threads;
}
if (max_queue > max_max_queue) {

@ -136,7 +136,7 @@ It is recommended to have this value at least twice MaxThreads if possible.
.br
\fBWARNING: you shouldn't increase this too much to avoid running out of file descriptors,
the following condition should hold:
MaxThreads*MaxRecursion + MaxQueue < RLIMIT_NOFILE.\fR
MaxThreads*MaxRecursion + MaxQueue - MaxThreads + 6 < RLIMIT_NOFILE.\fR
RLIMIT_NOFILE is the maximum number of open file descriptors (usually 1024), set
by \fBulimit -n\fR.
.br

@ -129,7 +129,7 @@ LocalSocket /tmp/clamd.socket
# It is recommended to have this value at least twice MaxThreads if possible.
# WARNING: you shouldn't increase this too much to avoid running out of file descriptors,
# the following condition should hold:
# MaxThreads*MaxRecursion + MaxQueue < RLIMIT_NOFILE (usual max is 1024)
# MaxThreads*MaxRecursion + (MaxQueue - MaxThreads) + 6< RLIMIT_NOFILE (usual max is 1024)
#
# Default: 100
#MaxQueue 200

@ -197,7 +197,7 @@ const struct clam_option clam_options[] = {
{ "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" },
{ "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" },
{ "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" },
{ "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" },

Loading…
Cancel
Save