tcpdump mailing list archives
Re: mmap consumes more CPU
From: "David Laight" <David.Laight () ACULAB COM>
Date: Mon, 12 Nov 2012 14:01:47 -0000
hi, I just checked the two mechanism : (1) Using mmap to fetch packets from kernel to userspace (2) Using recvfrom() call to fetch packets I see top reports (1) 34% memory 20% cpu usage (2) 21% memory 7% cpu usage !
It is worth remembering that the cpu usage reported by top isn't
worth the paper it is printed on for many workloads.
IIRC it is based on the cpu state when the timer interrupt fires.
processes that are scheduled very often, and run for short periods
tend to get mis-counted.
Since the Linux scheduler doesn't get a high-res timestamp everytime
it does a process switch, about the only way to measure idle time
is to put a very low priority process into a counting loop.
Unfortunately the scheduler might make it difficult to make the
processes priority low enough.
David
_______________________________________________
tcpdump-workers mailing list
tcpdump-workers () lists tcpdump org
https://lists.sandelman.ca/mailman/listinfo/tcpdump-workers
Current thread:
- mmap consumes more CPU abhinav narain (Nov 11)
- Re: [Wireshark-dev] mmap consumes more CPU Guy Harris (Nov 08)
- Re: mmap consumes more CPU Guy Harris (Nov 11)
- Re: mmap consumes more CPU David Laight (Nov 18)
- Re: mmap consumes more CPU abhinav narain (Nov 26)
- Re: mmap consumes more CPU Guy Harris (Nov 26)
- Re: mmap consumes more CPU abhinav narain (Nov 26)
