如果我的服务器有未计量的 100mbps,我如何检查我的带宽现在饱和了多少?
我正在设计一个可在多个上传服务器上运行的 PHP 应用程序 我基本上想做的是使用 Cronjob 从每个子服务器获取报告,并给我: 1- 驱动器上还剩多少空间以及 2- 该服务器的带宽有多少是饱和的(例如,如果一台服务器以全带宽运行,现在使用另一台服务器)
我在 linux 上使用 df 解决的第一个问题,但是如何获得当前带宽饱和度以在我的服务器中使用PHP 应用程序?我应该在linux中使用哪个命令?
谢谢
I'm designing a PHP application that works on several upload servers
What I basically want to do, is to use a Cronjob that fetches reports from each sub-server, and gives me:
1- How much space is left on the drive and
2- How much the bandwidth for that server is saturated (e.g. if a server is running at full bandwidth, use another now)
The first problem I solved with df on linux, but how do I get the current bandwidth saturation to be used in my PHP app? Which command should I use in linux?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以在执行命令时捕获 shell_exec() 的输出,但是我想您已经为 df 做到了这一点。
至于带宽,这是描述的这里。您可以直接在 PHP 中读取这些文件。
You can capture the output of shell_exec() while executing a command, but I figure you already do that for
df
.As for the bandwidth, this is described here. You could read those files directly in PHP.