0

I'm creating a command line script in php that will use a lot of bandwidth so I want to monitor available bandwidth to balance the size of sending data. (Automatic TCP balancing it's not enough cause it can send a lot of data)

I'll be working under linux, I already use '/proc/meminfo' to monitor ram but I haven't found a general command(no external package) to monitor bandwidth.

I was thinking to monitor latency of a ping to google.com, but I'm not sure how to do it, any ideas?

Cœur
  • 37,241
  • 25
  • 195
  • 267
Nemesis
  • 22
  • 1
  • 4
  • What does the latency of a ping have to do with the bandwidth? – arkascha Feb 13 '15 at 17:58
  • There are some apache modules dealing with bandwidth control, so if you use apache as your http server it might make sense to look into those. – arkascha Feb 13 '15 at 18:00
  • If the bandwidth is full the ping won't arrive, or will be strongly delayed – Nemesis Feb 13 '15 at 18:00
  • But that a) does say nothing about the bandwidth but only if the network throughput is close to its limit and b) such a delay could have millons of other reasons and c) that actually depends on the network management of the system. – arkascha Feb 13 '15 at 18:02
  • I know it's not the best measure but I couldn't figure out another way. Apache modules are useless because is a server-side script that can run on his own – Nemesis Feb 13 '15 at 18:06
  • Then I'd say you have to use the systems own network interface management. You ran read quite a bunch of information alone from the `proc` pseudo file system. Also there are custom traffic shaping solutions. You can do all that from php, if you have to. But I'd say: first find a clean solution to get the information you are looking for, next think about using that from php. – arkascha Feb 13 '15 at 18:08

0 Answers0