Commit graph

14 commits

Author SHA1 Message Date
aCaB
f238189223 bb#2286 2010-10-14 16:06:43 +02:00
Török Edvin
1514794c49 make STATS a non-bulk command (bb #1732).
This is needed to allow clamdtop to watch in realtime what is happening in
clamd, otherwise STATS would always lag behind 50 other multiscan commands.
2010-02-01 14:38:36 +02:00
Török Edvin
6a5ec1f967 Don't allow bulk requests (multiscan, idsession) to fill more than 50% of the queue. (bb #1732)
This makes clamd responsive to simple (version,contscan,etc.) requests
even during multiscan.
Previously these would get stuck behind a ~100 item queue, and the 1:4 ratio
of executing these commands wasn't working, since the commands weren't in the queue
in the first place.
2010-02-01 14:07:48 +02:00
Török Edvin
80301d0cd6 Fix clamd hang when number of multiscan commands == MaxThreads (bb #1700).
Each multiscan command needs 1 control thread, and 1 (possibly shared) scanner
thread.
If the number of multiscan control threads would be equal to MaxThreads no
progress could be made, since each one would be waiting for 1 free scanner
thread (but none can be spawned since maxthreads was already reached).
As long as there is 1 thread free for scanning, we can have N-1 multiscan
commands active, with N MaxThreads.
2010-01-27 11:56:10 +02:00
aCaB
e0bb54d7d4 win32: s/C_WINDOWS/_WIN32/ in clamd, shared 2009-09-30 00:54:04 +02:00
Török Edvin
0378a9ab77 introduce timeouts for send(), this is needed for IDSESSION to work reliably,
since a buggy client implementation may get stuck in send(), and then clamd
gets stuck in send() -> deadlock. To avoid this we need nonblocking sockets, and
(low) timeouts on send.
Add more tests for clamd protocol, including a stress test for IDSESSION.

git-svn: trunk@4798
2009-02-16 18:27:08 +00:00
Tomasz Kojm
086eab5c26 update old copyright headers
git-svn: trunk@4775
2009-02-13 10:55:45 +00:00
Török Edvin
949c6fe54f merge from clamd-proto branch:
handle multiple %v parameters
    introduce poll_fds that also does the read into a buffer
    introduce thrmgr_group* commands for keeping track of groups of commands
    (multiscan, IDSESSION)
    introduce 2 queues in thrmgr, multiscan queues get lower priority. Commands
    are processed from both queues in a 4:1 ratio to avoid starvation.
    unify reply code: conn_reply*
    unify scanner code into scan_callback that is called from cli_ftw
    multiscan doesn't need stat() now if readdir() provides dt_type
    redesign clamd main loop: there is now an accept thread, and a
    recv()/dispatch thread, +MaxThreads worker (scanner) threads.
    introduce limiting on commands when worker threads are contended.
    introduce IDSESSION, a replacement for the old SESSION command, that allows
    asyncronous (scan) commands and scan replies
    introduce INSTREAM that allows sending the data to scan on same connection
    (vs STREAM that requires another port)
    introduce zCOMMANDS

git-svn: trunk@4755
2009-02-12 16:51:09 +00:00
Török Edvin
deb3031222 mempool statistics support
git-svn: trunk@4344
2008-11-06 14:27:27 +00:00
Török Edvin
aa22174b30 new command STATS
new top-like tool using ncurses: clamdtop

it shows what clamd is currently scanning (and since how long),
including which file(s) multiscan is working on currently,
how many items it has in the queue (and since how long they are waiting),
how many active/idle threads it has,
memory usage statistics,
can monitor local or remote clamd

git-svn: trunk@4324
2008-11-03 19:27:20 +00:00
Tomasz Kojm
5a66732fdc clamd: revert patch from bb#1028 (bb#1113)
git-svn: trunk@4029
2008-07-29 21:35:58 +00:00
Tomasz Kojm
04ba76d2cb minimize memory fragmentation after db reload (bb#1028)
git-svn: trunk@3873
2008-06-02 12:00:37 +00:00
Török Edvin
d6df9ffb5a use pthread_cond_* instead of usleep() in MULTISCAN (bb #758)
enable entconv by default
others.c: fix compiler warning
regex_list.c: remove unused code, because a better solution is scheduled for 0.94 (bb #725)


git-svn: trunk@3627
2008-02-13 10:57:33 +00:00
Sven Strickroth
a99111f050 remove old CVS-stuff and make the repository look more like SVN
git-svn: trunk@2755
2007-02-17 19:02:20 +00:00
Renamed from clamav-devel/clamd/thrmgr.h (Browse further)