我的VPS在过去的2天里一直在高负荷状态,无法弄清楚问题所在。 这里是更多有关vps的信息。 VPS作为HTTP(Apache),Mysql,Proftp Server,stream量不大,每天约有300-500次访问。
uname -a
Linux cforum 2.6.32-431.29.2.el6.x86_64 #1 SMP Tue Sep 9 21:36:05 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
运行时间
07:07:15 up 5 days, 4:05, 1 user, load average: 31.88, 44.97, 58.48
top -b -n 1
top - 07:08:00 up 5 days, 4:06, 1 user, load average: 34.33, 43.79, 57.44 Tasks: 324 total, 1 running, 323 sleeping, 0 stopped, 0 zombie Cpu(s): 2.4%us, 3.1%sy, 0.0%ni, 58.5%id, 35.8%wa, 0.0%hi, 0.0%si, 0.1%st Mem: 1016280k total, 1006536k used, 9744k free, 536k buffers Swap: 2097148k total, 1539640k used, 557508k free, 409436k cached PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 5591 root 20 0 15156 1372 884 R 0.8 0.1 0:00.01 top 1 root 20 0 19232 160 20 S 0.0 0.0 0:00.44 init 2 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kthreadd 3 root RT 0 0 0 0 S 0.0 0.0 0:00.00 migration/0 4 root 20 0 0 0 0 S 0.0 0.0 0:02.53 ksoftirqd/0 5 root RT 0 0 0 0 S 0.0 0.0 0:00.00 migration/0 6 root RT 0 0 0 0 S 0.0 0.0 0:57.89 watchdog/0 7 root 20 0 0 0 0 S 0.0 0.0 0:33.08 events/0 8 root 20 0 0 0 0 S 0.0 0.0 0:00.00 cgroup 9 root 20 0 0 0 0 S 0.0 0.0 0:00.00 khelper 10 root 20 0 0 0 0 S 0.0 0.0 0:00.00 netns 11 root 20 0 0 0 0 S 0.0 0.0 0:00.00 async/mgr 12 root 20 0 0 0 0 S 0.0 0.0 0:00.00 pm 13 root 20 0 0 0 0 S 0.0 0.0 0:00.00 xenwatch 14 root 20 0 0 0 0 S 0.0 0.0 0:00.00 xenbus 15 root 20 0 0 0 0 S 0.0 0.0 0:02.15 sync_supers 16 root 20 0 0 0 0 S 0.0 0.0 0:02.32 bdi-default 17 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kintegrityd/0
完整的顶部输出
iostat的
Linux 2.6.32-431.29.2.el6.x86_64 (cforum) 10/02/2014 _x86_64_ (1 CPU) avg-cpu: %user %nice %system %iowait %steal %idle 2.44 0.00 3.10 35.90 0.08 58.48 Device: tps Blk_read/s Blk_wrtn/s Blk_read Blk_wrtn xvda 104.86 1182.53 4376.56 526606250 1948973680 xvdd 0.00 0.00 0.00 456 0
免费-m
total used free shared buffers cached Mem: 992 984 8 0 1 173 -/+ buffers/cache: 809 183 Swap: 2047 1431 616
df -h
Filesystem Size Used Avail Use% Mounted on /dev/xvda1 30G 7.1G 21G 26% / tmpfs 497M 0 497M 0% /dev/shm
vmstat的
procs -----------memory---------- ---swap-- -----io---- --system-- -----cpu----- rb swpd free buff cache si so bi bo in cs us sy id wa st 0 99 1467144 8076 2096 157136 32 32 594 2187 85 14 2 3 58 36 0
我怎样才能find问题的地方?
立即跳出来的是,你的系统正在交换相当多 – 这可以很容易地解释高负载 – 特别是便宜的VPS(这在我看来,它可能是基于内存规格的) – 常常是瓶颈IO 。
我会做的第一件事(只提供你提供的信息) – 就是在这个问题上投入更多的内疚。 如果这不是一个选项,你可以用VM.SWAPPINESS来玩这个问题“不那么糟糕” – 但是由于你的SWAP比较大,那么你的可用内存我怀疑你会得到很多。
也许你可以调整MySQL使用[很less]的内存 – 我为你search这个 。
这在VPS上是非常典型的。
您可以联系您的VPS提供商并请求转移到另一台服务器。 如果他们有点体面,他们会做这个没有任何问题。 我已经在过去的成功与此:)