首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何修复/解决0.OS6VPS上很高的服务器负载

如何修复/解决0.OS6VPS上很高的服务器负载
EN

Server Fault用户
提问于 2014-10-02 04:19:30
回答 2查看 138关注 0票数 0

从过去的2天开始,我的VPS一直处于高负荷状态,我不知道问题出在哪里。这里有更多关于vps的信息。VPS的作用是HTTP(Apache)、Mysql、服务器,流量不多,每天大约有300-500次访问。

uname -a

代码语言:javascript
复制
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

正常运行时间

代码语言:javascript
复制
 07:07:15 up 5 days,  4:05,  1 user,  load average: 31.88, 44.97, 58.48

top -b -n 1

代码语言:javascript
复制
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

代码语言:javascript
复制
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

代码语言:javascript
复制
             total       used       free     shared    buffers     cached
Mem:           992        984          8          0          1        173
-/+ buffers/cache:        809        183
Swap:         2047       1431        616

df -h

代码语言:javascript
复制
Filesystem      Size  Used Avail Use% Mounted on
/dev/xvda1       30G  7.1G   21G  26% /
tmpfs           497M     0  497M   0% /dev/shm

vmstat

代码语言:javascript
复制
procs -----------memory---------- ---swap-- -----io---- --system-- -----cpu-----
 r  b   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

怎样才能找到问题出在哪里?

EN

回答 2

Server Fault用户

发布于 2014-10-02 04:43:41

立即跳出来的是,您的系统正在进行相当大的交换--这可以很容易地解释高负载的原因--尤其是廉价的VPS(在我看来,这可能是基于内存规格的VPS)--常常受到IO的阻碍。

我要做的第一件事是只有你提供的信息 --在这个问题上抛出更多的内存。如果这不是一个选项,你可能可以使用VM.SWAPPINESS使问题“不那么严重”-但随着你的交换更大,那么你的可用内存,我怀疑你会从中得到很多。

也许您可以调优MySQL以使用很多更少的内存--我为您搜索了

票数 1
EN

Server Fault用户

发布于 2014-10-02 08:10:43

这在VPS上是很典型的。

您可以联系您的VPS提供程序并请求迁移到另一台服务器。如果他们有点体面,他们会这样做,没有任何问题。我曾经在这方面取得过成功:)

票数 0
EN
页面原文内容由Server Fault提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://serverfault.com/questions/632951

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档