cPanel 上的 CPU 使用情况
我有一个“JustHost”主机,但我遇到了 PHP 类的问题。 如下:Just Host 提供无限的托管空间和无限的带宽,但根据我们的条款,我们将暂停任何超出我们 10% CPU/MEM/MySQL 政策的网站。
他们暂停了我的帐户,原因 ,我做了一个自定义类来查找 CPU 使用情况
<?php
$LoadAvg = substr(file_get_contents('/proc/loadavg'), 0, 4);
echo $LoadAvg > 10 ? "Server busy, try again later." : "$LoadAvg % CPU USAGE";
?>
我的问题是: 该类将显示整个服务器的总CPU使用率还是仅显示我的cPanel?
非常感谢!
I have a host to 'JustHost' and I had a problem with a PHP-Class. They have suspended my account with the following reason: Just Host offer unlimited hosting space and unlimited bandwidth, but as per our terms we will suspend any website which exceeds our 10% CPU/MEM/MySQL policy.
Well, I made a custom class to find the CPU-Usage
<?php
$LoadAvg = substr(file_get_contents('/proc/loadavg'), 0, 4);
echo $LoadAvg > 10 ? "Server busy, try again later." : "$LoadAvg % CPU USAGE";
?>
My question is:
The class will show the total CPU Usage of the entire server or only my cPanel ?
Thank you very much!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
它将向您显示托管在其特定服务器上的所有站点的 CPU 使用情况。
It will show you the cpu usage of all sites hosted on that particular server of theirs.
平均负载并不等于 CPU 利用率。衡量的是争用 CPU 时间的进程数量。
在共享服务器上,很难精确测量 CPU 利用率。
Load averages do not equate to CPU utilization. What is measures is the number of processes in contention for CPU time.
On a shared server, its hard to get a precise measurement of CPU utilization.
据我所知,WHM CPanel 是一种 PHP 语言的 Web 应用程序,用于控制系统,它有一些工具可供 Web 服务器管理员跟踪帐户(用户或组)并自动进行 DNS 设置并执行一些虚拟目录和安装通过网站等提供一些附加软件。
我的观点是,我们不能将操作系统(例如 Cent OS Linux)与操作系统分开来查看其 CPU 平均值。您看到的是该特定服务器的总体 CPU 使用情况。
As i know ,WHM CPanel is some kind of Web Application in PHP Language for Controlling system witch have some tools for Web Server Administrator to keep track of accounts(Users or Groups) and make automated of DNS setting and do some Virtual-Directories and Install some additional software through a Website and so on .
My point is it is not some thing we could divide from OS for example Cent OS Linux to see it's CPU average . what you saw was overall CPU usage of that specific Server .
我不知道这是否有帮助,但为了让我的 CPanel 用户可以使用每日 CPU / RAM 消耗,我制作了简单的脚本 shell,创建名为
-cpu.html
的每日文件,并将其放入用户public_html
中。该脚本位于:http://50dh.info/create-daily-cpu-peruser .txt
如果限制提高,您可以轻松添加暂停。
I don't know if this helps, but in order to make daily CPU / RAM consumption available for my CPanel users I make simple script shell that creates daily file named
<login>-cpu.html
, and put it in userpublic_html
.The script is available at: http://50dh.info/create-daily-cpu-peruser.txt
You can easily add suspension if limit are raised.