Using top it's easy to identify processes that are hogging memory and cpu, but ocasionally I see my computer's network activity spike, but I'm unable to determine which process is generating the activity. Where is the right place to look for this information?
You can install several applications to monitor network traffic in real time. NTOP, tcpdump, trafshow, iptraf.
I would go with NTOP or IPTRAF. But that's just a personal taste.
Also, with Linux's netstat you can use the -p flag to see how many connections is a process using.
The package 'ntop' provides a comparable tool to top. The design's a bit different since the kernel doesn't provide excellent statistics via /proc.
Description: display network usage in web browser
ntop displays a summary of network usage by machines on your network in a
web mode, which allows the display to be browsed with a web browser.
Small correction to Pablo Santa Cruz-
On linux: netstat -p gives the pid of the program running on the port. On BSD: netstat -p is used to specify the protocol.
Hello,
You can also take a look at "NetHogs": http://nethogs.sourceforge.net/. Little yet very handy utility. Especially if you want to find out which process is taking the bandwidth.