Recommended Services
› Amazon Web Services
› LeanCloud
› New Relic
› ClearDB
noqwerty
V2EX  ›  云计算

请问有办法确定是什么程序跑了服务器的流量吗

  •  
  •   noqwerty · May 2, 2019 · 6895 views
    This topic created in 2751 days ago, the information mentioned may be changed or developed.

    续费的时候发现今天一天上下行各跑了 150 多 G 流量,跟我这一年加起来的流量差不多了。。试着翻了 /var/log/syslog 也没发现什么有用的信息(全是 ufw block 日志),想请教一下大家,还有什么日志文件或者其他方法可以确定这些流量是哪个进程跑的吗?

    今天流量

    去年流量

    15 replies  •  2019-05-18 01:51:11 +08:00
    KasuganoSoras
    KasuganoSoras
    May 2, 2019❤️1
    1
    iptraf-ng
    noqwerty
    noqwerty
    OP
    May 2, 2019
    2
    @KasuganoSoras #1 大概看了一下,这个装上之后可以监控,但是没法让我知道之前是什么进程跑了流量呀。
    oott123
    oott123
    May 2, 2019
    3
    已经过去的事情就没有办法啦
    noqwerty
    noqwerty
    OP
    May 2, 2019
    4
    @oott123 #3 实时监控的话我之前是用 iftop,过去了就没办法了只能没事就看看争取抓到吧,哈哈
    luozic
    luozic
    May 2, 2019 via iPhone
    5
    有网关好说,没有? 可以看网卡日志,如果这也没有? 看医生。
    noqwerty
    noqwerty
    OP
    May 2, 2019
    6
    @luozic #5 NetworkManager 日志是空的,syslog 也没看到相关日志,看来只能玄学 debug 了
    lff0305
    lff0305
    May 2, 2019❤️2
    7
    自己随便用什么语言写个脚本,对于每个进程的 PID,cat /proc/%d/net/dev
    能看到这个进程在不同网卡的进出流量
    noqwerty
    noqwerty
    OP
    May 2, 2019 via Android
    8
    @lff0305 有空尝试一下,谢谢!
    sleepm
    sleepm
    May 3, 2019 via Android
    9
    ntopng
    pcmid
    pcmid
    May 3, 2019 via Android
    10
    你没跑什么 udp 的程序吧
    noqwerty
    noqwerty
    OP
    May 3, 2019
    11
    @sleepm #9 跟 1 楼提到的工具类似,也不能看过去的流量情况
    noqwerty
    noqwerty
    OP
    May 3, 2019
    12
    @pcmid #10 没,问题找到了,之前开的内网穿透被一个师弟拿来传文件了,一共跑了我快 400G
    kelvinblood
    kelvinblood
    May 3, 2019 via iPad
    13
    内网穿透用无限流量的机器做吧。
    tvirus
    tvirus
    May 17, 2019
    14
    @noqwerty 你这是哪家的 vps ?监控界面挺不错嘛。
    noqwerty
    noqwerty
    OP
    May 18, 2019
    15
    @tvirus #14 upcloud,国内好像比较小众
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   5023 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 47ms · UTC 02:25 · PVG 10:25 · LAX 18:25 · JFK 21:25
    ♥ Do have faith in what you're doing.