S: We've been through this before with you - the getpid() and gettimeofday() calls are very expensive (resource intensive) under FreeBSD.
Try the attached patch (and let me know ASAP) - it adds a --disable-mutexextrainfo parameter to do what it says, which should eliminate most of the getpid()/gettimeofday() calls. Check ntop.8 for more... -----Burton -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Stanley Hopcroft Sent: Friday, October 17, 2003 8:09 PM To: [EMAIL PROTECTED] Subject: [Ntop-dev] Re: Ntop CPU Hog on FreeBSD: problem is (unsuprisingly) load related - with ~ 128 kbps => CPU > 50%. Dear Ladies and Gentlemen, The problem reported and unreported earlier about excessive CPU usage of 17 Oct 2003 CVS vs ntop 2.2 on FreeBSD 4.8-RELEASE-p13 (RELEASE + security fixes; not STABLE) is related to network load: the CPU usage climbs massively when ntop is monitoring a 128 kbps stream (ssh file transfer). The topology is Central Site ------ 128 kbps WAN --- test site (10 Mbps switched) | | ntop (getting mirrored traffic) Tssyd File transfer (scp) - of the the bzip2 compressed ntop source to the test site. pc09011> scp ntop-cvs.tar.bz2 tssyd:build/ ntop-cvs.tar.bz2 100% |*************************************************************************** ************************************************| 2570 KB 01:27 pc09011> With 2.2, ntop hardly puffs thruought the file transfer: tssyd# perl -e 'foreach (1..100) { @x=`top -b`; print @x[0..10], "\n"; sleep 30 }' last pid: 92106; load averages: 0.06, 0.01, 0.00 up 7+20:12:34 10:53:40 23 processes: 1 running, 21 sleeping, 1 zombie Mem: 25M Active, 15M Inact, 15M Wired, 4216K Cache, 15M Buf, 2416K Free Swap: 250M Total, 756K Used, 249M Free PID USERNAME PRI NICE SIZE RES STATE TIME WCPU CPU COMMAND 92100 anwsmh 2 0 5376K 1708K select 0:02 1.72% 1.71% sshd 92059 nobody 2 0 16432K 9456K poll 0:06 0.39% 0.39% ntop 78 root 2 0 2584K 876K select 1:37 0.00% 0.00% sshd last pid: 92107; load averages: 0.03, 0.01, 0.00 up 7+20:13:04 10:54:10 19 processes: 1 running, 17 sleeping, 1 zombie Mem: 24M Active, 14M Inact, 15M Wired, 4216K Cache, 15M Buf, 3520K Free Swap: 250M Total, 756K Used, 249M Free PID USERNAME PRI NICE SIZE RES STATE TIME WCPU CPU COMMAND 92059 nobody 2 0 16432K 9456K poll 0:07 0.05% 0.05% ntop 78 root 2 0 2584K 876K select 1:37 0.00% 0.00% sshd 69 root 2 0 1296K 572K select 0:42 0.00% 0.00% ntpd With 2.2.95: Mem: 24M Active, 12M Inact, 15M Wired, 5820K Cache, 15M Buf, 4300K Free Swap: 250M Total, 756K Used, 249M Free PID USERNAME PRI NICE SIZE RES STATE TIME WCPU CPU COMMAND 92131 nobody 2 0 16660K 9752K poll 1:10 1.46% 1.46% ntop 78 root 2 0 2584K 884K select 1:38 0.00% 0.00% sshd 69 root 2 0 1296K 572K select 0:42 0.00% 0.00% ntpd last pid: 92175; load averages: 0.23, 0.18, 0.08 up 7+20:20:52 11:01:58 22 processes: 3 running, 19 sleeping Mem: 25M Active, 12M Inact, 15M Wired, 5820K Cache, 15M Buf, 3172K Free Swap: 250M Total, 756K Used, 249M Free PID USERNAME PRI NICE SIZE RES STATE TIME WCPU CPU COMMAND 92131 nobody 31 0 16660K 9764K RUN 1:22 35.50% 35.50% ntop 92172 anwsmh 28 0 5376K 1692K RUN 0:01 1.54% 1.12% sshd 92175 root 29 0 1868K 844K RUN 0:00 7.00% 0.34% top last pid: 92176; load averages: 0.56, 0.27, 0.12 up 7+20:21:23 11:02:29 22 processes: 2 running, 20 sleeping Mem: 25M Active, 12M Inact, 15M Wired, 5820K Cache, 15M Buf, 3172K Free Swap: 250M Total, 756K Used, 249M Free PID USERNAME PRI NICE SIZE RES STATE TIME WCPU CPU COMMAND 92131 nobody 42 0 16660K 9764K RUN 1:43 60.45% 60.45% ntop 92172 anwsmh 2 0 5376K 1692K select 0:02 2.29% 2.15% sshd 78 root 2 0 2584K 884K select 1:38 0.00% 0.00% sshd last pid: 92177; load averages: 0.54, 0.29, 0.13 up 7+20:21:53 11:02:59 22 processes: 2 running, 20 sleeping Mem: 25M Active, 12M Inact, 15M Wired, 5820K Cache, 15M Buf, 3168K Free Swap: 250M Total, 756K Used, 249M Free PID USERNAME PRI NICE SIZE RES STATE TIME WCPU CPU COMMAND 92131 nobody 42 0 16660K 9768K RUN 2:03 64.45% 64.45% ntop 92172 anwsmh 2 0 5376K 1692K select 0:03 2.52% 2.49% sshd 78 root 2 0 2584K 884K select 1:38 0.00% 0.00% sshd Yours sincerely. -- ------------------------------------------------------------------------ Stanley Hopcroft ------------------------------------------------------------------------ '...No man is an island, entire of itself; every man is a piece of the continent, a part of the main. If a clod be washed away by the sea, Europe is the less, as well as if a promontory were, as well as if a manor of thy friend's or of thine own were. Any man's death diminishes me, because I am involved in mankind; and therefore never send to know for whom the bell tolls; it tolls for thee...' from Meditation 17, J Donne. _______________________________________________ Ntop-dev mailing list [EMAIL PROTECTED] http://listgateway.unipi.it/mailman/listinfo/ntop-dev
BMS0381-disablemutexextra.patch
Description: Binary data
