如何快速估计Linux VPS的月流量使用情况
如何快速估计/估算Linux VPS的月流量使用情况?一定要安装流量监控软件才能做到吗?当然不是,deepvps 告诉您一个非常方便、准确的办法,不用安装MRTG等流量监控软件,就可以估算您1个月需要多少流量。 方法如下:
首先您执行一次ifconfig -a命令,找到RX bytes:1973174498 (1.8 GiB) TX bytes:125331670357 (116.7 GiB),记录下来。
[root@deepvps]# ifconfig -a
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:9009 errors:0 dropped:0 overruns:0 frame:0
TX packets:9009 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:556436 (543.3 KiB) TX bytes:556436 (543.3 KiB)venet0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
inet addr:127.0.0.1 P-t-P:127.0.0.1 Bcast:0.0.0.0 Mask:255.255.255.255
UP BROADCAST POINTOPOINT RUNNING NOARP MTU:1500 Metric:1
RX packets:46206817 errors:0 dropped:0 overruns:0 frame:0
TX packets:85906088 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:1973174498 (1.8 GiB) TX bytes:125331670357 (116.7 GiB)
然后,相隔24小时,再执行一次ifconfig -a命令,找到RX bytes:2283947894 (2.1 GiB) TX bytes:144706254769 (134.9 GiB)
[root@deepvps]# ifconfig -a
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:9009 errors:0 dropped:0 overruns:0 frame:0
TX packets:9009 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:556436 (543.3 KiB) TX bytes:556436 (543.3 KiB)venet0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
inet addr:127.0.0.1 P-t-P:127.0.0.1 Bcast:0.0.0.0 Mask:255.255.255.255
UP BROADCAST POINTOPOINT RUNNING NOARP MTU:1500 Metric:1
RX packets:53386450 errors:0 dropped:0 overruns:0 frame:0
TX packets:99272586 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:2283947894 (2.1 GiB) TX bytes:144706254769 (134.9 GiB)
很明显,后者比前者多了134.9-116.7 = 18.2GB,这就说明24小时的流出流量TX是18.2GB,一个月大概就是18*31=560GB流量。怎么样,估算Linux vps的流量很方便吧!顺便说一下RX是流入流量,对90%作网站的linux vps来说,一般都很小,可忽略不计。
[复制本文链接发送给您的好友]
共有2条评论 [点此发言]