Friday, October 06, 2006

Statistik Trafik Berdasarkan PID

Posting dari Irfan Habib di LKML berikut melontarkan pertanyaan yang menarik:

Is there any method either kernel or user level which tells me which process is generating how much traffic from a machine. For example if some process is flooding the network, then I would like to know which process (PID ideally), is generating the most traffic.
yang dijawab oleh Jose R. Santos:
A while ago I did a SystemTap script to solve a problem similar to this. It's been siting in my system for a while collecting dust and you currently don't need the embedded C code since the networking.stp tapset has all this script needs(and more), but I should point you in the right direction.
Ternyata ada barang yang bernama SystemTap. Perlu dicoba build di Debian.

Rupanya ada yang memperbandingkan SystemTap (di Linux) vs DTrace (di Solaris) lebih dari setahun yang lalu! Wow, rupanya saya ketinggalan jaman lagi.


Priyadi said...

bisa pake netfilter/iptables. caranya? RTFM :)

btw, lebih berguna cari data traffic berdasarkan UID daripada PID.

andika said...

dari man iptables
NOTE: pid, sid and command matching are broken on SMP :(

preaxz said...

Well ... kalau ada orang yang merasa ketinggalan jaman, tentunya tidak akan lebih ketinggalan jaman selayaknya diriku yang fana ini .. ouch