当前位置: 技术问答>linux和unix
机器经常死机(停了服务),大家有什么办法,来指导一下
来源: 互联网 发布时间:2016-01-15
本文导语: 死机的主要原因是 swapfree 变成了 0,原来这是 4G 的,但运行一段时间,可能一个星期或者半个月或者更长时间,就会变成 0 了,再之后就会停了 http vsftp ssh 等服务,但 ping 依然是正常的! shell> more /proc/me...
死机的主要原因是 swapfree 变成了 0,原来这是 4G 的,但运行一段时间,可能一个星期或者半个月或者更长时间,就会变成 0 了,再之后就会停了 http vsftp ssh 等服务,但 ping 依然是正常的!
shell> more /proc/meminfo
MemTotal: 2054240 kB
MemFree: 92728 kB
Buffers: 14984 kB
Cached: 1363852 kB
SwapCached: 0 kB
Active: 1227868 kB
Inactive: 534152 kB
HighTotal: 0 kB
HighFree: 0 kB
LowTotal: 2054240 kB
LowFree: 92728 kB
SwapTotal: 4096564 kB
SwapFree: 4096564 kB
Dirty: 204528 kB
Writeback: 0 kB
Mapped: 396748 kB
Slab: 131124 kB
Committed_AS: 1714512 kB
PageTables: 50544 kB
VmallocTotal: 536870911 kB
VmallocUsed: 265536 kB
VmallocChunk: 536604831 kB
HugePages_Total: 0
HugePages_Free: 0
Hugepagesize: 2048 kB
使用 top 显示信息:
shell > top
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
7423 apache 16 0 175m 15m 9216 S 4.0 0.8 0:00.56 httpd
7410 apache 15 0 175m 16m 9296 S 1.0 0.8 0:00.46 httpd
7467 apache 16 0 174m 14m 9260 S 1.0 0.7 0:00.23 httpd
7315 apache 15 0 173m 14m 9028 S 0.7 0.7 0:00.60 httpd
7317 apache 16 0 175m 15m 9280 S 0.7 0.8 0:00.68 httpd
7319 apache 16 0 175m 15m 9280 S 0.7 0.8 0:00.66 httpd
7327 apache 16 0 175m 15m 9180 S 0.7 0.8 0:00.47 httpd
7332 apache 15 0 175m 16m 9300 S 0.7 0.8 0:00.57 httpd
7334 apache 16 0 175m 16m 9284 S 0.7 0.8 0:00.71 httpd
7337 apache 15 0 174m 14m 9256 R 0.7 0.7 0:00.44 httpd
7353 apache 15 0 174m 14m 9260 S 0.7 0.7 0:00.44 httpd
7356 apache 16 0 175m 16m 9280 S 0.7 0.8 0:00.55 httpd
7359 apache 16 0 175m 16m 9348 S 0.7 0.8 0:00.60 httpd
7370 apache 15 0 174m 15m 9260 S 0.7 0.7 0:00.36 httpd
7382 apache 16 0 175m 15m 9280 S 0.7 0.8 0:00.52 httpd
7386 apache 16 0 175m 15m 9220 S 0.7 0.8 0:00.49 httpd
7396 apache 15 0 175m 16m 9228 S 0.7 0.8 0:00.49 httpd
7401 apache 15 0 173m 13m 8680 S 0.7 0.7 0:00.32 httpd
7404 apache 15 0 175m 15m 9280 S 0.7 0.8 0:00.29 httpd
7409 apache 16 0 173m 13m 8680 S 0.7 0.7 0:00.35 httpd
7421 apache 16 0 174m 14m 9260 S 0.7 0.7 0:00.32 httpd
7422 apache 15 0 174m 14m 9260 S 0.7 0.7 0:00.33 httpd
7431 apache 16 0 174m 15m 9192 S 0.7 0.8 0:00.26 httpd
7441 apache 16 0 174m 15m 9224 S 0.7 0.8 0:00.38 httpd
7444 apache 15 0 174m 14m 9256 S 0.7 0.7 0:00.31 httpd
7448 apache 15 0 174m 15m 9236 S 0.7 0.8 0:00.37 httpd
7449 apache 16 0 175m 16m 9240 S 0.7 0.8 0:00.33 httpd
7460 apache 15 0 174m 14m 9268 S 0.7 0.7 0:00.24 httpd
7462 apache 16 0 174m 14m 9260 S 0.7 0.7 0:00.23 httpd
7469 apache 16 0 175m 15m 9276 S 0.7 0.8 0:00.30 httpd
7473 apache 16 0 173m 13m 8676 S 0.7 0.7 0:00.23 httpd
7474 apache 16 0 175m 15m 9228 S 0.7 0.8 0:00.33 httpd
7477 apache 16 0 175m 16m 9244 S 0.7 0.8 0:00.38 httpd
7318 apache 15 0 175m 15m 9216 S 0.3 0.8 0:00.64 httpd
7320 apache 15 0 173m 14m 9140 S 0.3 0.7 0:00.59 httpd
7321 apache 15 0 175m 15m 9280 S 0.3 0.8 0:00.62 httpd
7325 apache 15 0 175m 15m 9280 S 0.3 0.8 0:00.48 httpd
......
系统环境:
Xeon 5110 + 2G + sata 硬盘
Linux AS 4
Apache + MySQL + PHP + VSftp
但数据库不是本机的
其实有两台机器都会出现这样的情况,数据库都不是本机的
大家说机器为什么会这样呢?
shell> more /proc/meminfo
MemTotal: 2054240 kB
MemFree: 92728 kB
Buffers: 14984 kB
Cached: 1363852 kB
SwapCached: 0 kB
Active: 1227868 kB
Inactive: 534152 kB
HighTotal: 0 kB
HighFree: 0 kB
LowTotal: 2054240 kB
LowFree: 92728 kB
SwapTotal: 4096564 kB
SwapFree: 4096564 kB
Dirty: 204528 kB
Writeback: 0 kB
Mapped: 396748 kB
Slab: 131124 kB
Committed_AS: 1714512 kB
PageTables: 50544 kB
VmallocTotal: 536870911 kB
VmallocUsed: 265536 kB
VmallocChunk: 536604831 kB
HugePages_Total: 0
HugePages_Free: 0
Hugepagesize: 2048 kB
使用 top 显示信息:
shell > top
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
7423 apache 16 0 175m 15m 9216 S 4.0 0.8 0:00.56 httpd
7410 apache 15 0 175m 16m 9296 S 1.0 0.8 0:00.46 httpd
7467 apache 16 0 174m 14m 9260 S 1.0 0.7 0:00.23 httpd
7315 apache 15 0 173m 14m 9028 S 0.7 0.7 0:00.60 httpd
7317 apache 16 0 175m 15m 9280 S 0.7 0.8 0:00.68 httpd
7319 apache 16 0 175m 15m 9280 S 0.7 0.8 0:00.66 httpd
7327 apache 16 0 175m 15m 9180 S 0.7 0.8 0:00.47 httpd
7332 apache 15 0 175m 16m 9300 S 0.7 0.8 0:00.57 httpd
7334 apache 16 0 175m 16m 9284 S 0.7 0.8 0:00.71 httpd
7337 apache 15 0 174m 14m 9256 R 0.7 0.7 0:00.44 httpd
7353 apache 15 0 174m 14m 9260 S 0.7 0.7 0:00.44 httpd
7356 apache 16 0 175m 16m 9280 S 0.7 0.8 0:00.55 httpd
7359 apache 16 0 175m 16m 9348 S 0.7 0.8 0:00.60 httpd
7370 apache 15 0 174m 15m 9260 S 0.7 0.7 0:00.36 httpd
7382 apache 16 0 175m 15m 9280 S 0.7 0.8 0:00.52 httpd
7386 apache 16 0 175m 15m 9220 S 0.7 0.8 0:00.49 httpd
7396 apache 15 0 175m 16m 9228 S 0.7 0.8 0:00.49 httpd
7401 apache 15 0 173m 13m 8680 S 0.7 0.7 0:00.32 httpd
7404 apache 15 0 175m 15m 9280 S 0.7 0.8 0:00.29 httpd
7409 apache 16 0 173m 13m 8680 S 0.7 0.7 0:00.35 httpd
7421 apache 16 0 174m 14m 9260 S 0.7 0.7 0:00.32 httpd
7422 apache 15 0 174m 14m 9260 S 0.7 0.7 0:00.33 httpd
7431 apache 16 0 174m 15m 9192 S 0.7 0.8 0:00.26 httpd
7441 apache 16 0 174m 15m 9224 S 0.7 0.8 0:00.38 httpd
7444 apache 15 0 174m 14m 9256 S 0.7 0.7 0:00.31 httpd
7448 apache 15 0 174m 15m 9236 S 0.7 0.8 0:00.37 httpd
7449 apache 16 0 175m 16m 9240 S 0.7 0.8 0:00.33 httpd
7460 apache 15 0 174m 14m 9268 S 0.7 0.7 0:00.24 httpd
7462 apache 16 0 174m 14m 9260 S 0.7 0.7 0:00.23 httpd
7469 apache 16 0 175m 15m 9276 S 0.7 0.8 0:00.30 httpd
7473 apache 16 0 173m 13m 8676 S 0.7 0.7 0:00.23 httpd
7474 apache 16 0 175m 15m 9228 S 0.7 0.8 0:00.33 httpd
7477 apache 16 0 175m 16m 9244 S 0.7 0.8 0:00.38 httpd
7318 apache 15 0 175m 15m 9216 S 0.3 0.8 0:00.64 httpd
7320 apache 15 0 173m 14m 9140 S 0.3 0.7 0:00.59 httpd
7321 apache 15 0 175m 15m 9280 S 0.3 0.8 0:00.62 httpd
7325 apache 15 0 175m 15m 9280 S 0.3 0.8 0:00.48 httpd
......
系统环境:
Xeon 5110 + 2G + sata 硬盘
Linux AS 4
Apache + MySQL + PHP + VSftp
但数据库不是本机的
其实有两台机器都会出现这样的情况,数据库都不是本机的
大家说机器为什么会这样呢?
|
交换空间耗尽有两种可能,一个是程序配置错误,另外一个是分区配置不合理。
你最好先检查Apache和数据库设置的缓冲是不是太大了,再有就是想法增加swap分区的数量。
你最好先检查Apache和数据库设置的缓冲是不是太大了,再有就是想法增加swap分区的数量。
|
洪水攻击。。。