[HN Gopher] Accurate, low-overhead per process bandwidth monitor...
       ___________________________________________________________________
        
       Accurate, low-overhead per process bandwidth monitoring in 40 lines
       of bpftrace
        
       Author : silviot
       Score  : 59 points
       Date   : 2021-04-15 10:49 UTC (12 hours ago)
        
 (HTM) web link (www.gcardone.net)
 (TXT) w3m dump (www.gcardone.net)
        
       | thomashabets2 wrote:
       | Nice. I have done similar for measuring per-device bandwidth of
       | USB devices with bpftrace:
       | 
       | https://blog.habets.se/2020/08/Measuring-USB-with-bpftrace.h...
        
       | effie wrote:
       | Not working on 4.19.                   # bpftrace socktraf.bt
       | 12.12-160: syntax error, unexpected struct
        
       | tkinom wrote:
       | After I see app's bandwidth usage, if I want to block that app's
       | traffic, what's the best way to do that?
        
         | effie wrote:
         | You have to run the app with dedicated UID, then
         | iptables -I OUTPUT -m owner --uid-owner <UID> -j DROP
         | ip6tables -I OUTPUT -m owner --uid-owner <UID> -j DROP
        
       ___________________________________________________________________
       (page generated 2021-04-15 23:02 UTC)