nginx php占cpu高,nginx 占用CPU高 - 网站服务器 - LinuxTone | 运维专家网论坛 - 最棒的Linux运维与开源架构技术交流社区! - Powered by Di...

本帖最后由 jack_cap 于 2011-7-8 13:58 编辑

nginx 配置fastcgi缓存后 运行一段时间后 网站访问很慢

fastcgi配置

fastcgi_cache_path /usr/local/webserver/nginx/fastcgi_cache levels=1:2 keys_zone=TEST:10m               inactive=5m;

fastcgi_cache  TEST;

fastcgi_cache_valid  200 302 10m;

fastcgi_cache_valid  301 1h;

fastcgi_cache_valid  any 1m;

fastcgi_cache_min_uses 1;

fastcgi_cache_use_stale error timeout invalid_header http_500;

fastcgi_cache_key   http://$host$request_uri;

top 图

top - 09:48:01 up 15 days,  6:23,  1 user,  load average: 5.20, 3.57, 1.68

Tasks: 135 total,   7 running, 128 sleeping,   0 stopped,   0 zombie

Cpu(s): 23.0%us, 77.0%sy,  0.0%ni,  0.0%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st

Mem:   4037424k total,  4005688k used,    31736k free,    11748k buffers

Swap:  8193140k total,    29740k used,  8163400k free,  3110980k cached

PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND

2344 www       25   0 87112  26m  944 R 52.9  0.7   3:00.25 nginx

2345 www       25   0 87876  27m  944 R 46.6  0.7   2:02.18 nginx

2346 www       25   0 87816  27m  952 R 33.3  0.7   2:04.64 nginx

2347 www       25   0 61660 1360  556 R 33.3  0.0   1:55.31 nginx

15408 www       25   0 87080  26m  824 R 32.6  0.7   2:54.90 nginx

3207 www       16   0  234m  23m  17m S  0.3  0.6   0:03.50 php-cgi

1 root      15   0 10352  580  544 S  0.0  0.0   0:01.26 init

2 root      RT  -5     0    0    0 S  0.0  0.0   0:00.03 migration/0

3 root      34  19     0    0    0 S  0.0  0.0   0:24.96 ksoftirqd/0

4 root      RT  -5     0    0    0 S  0.0  0.0   0:00.00 watchdog/0

5 root      RT  -5     0    0    0 S  0.0  0.0   0:00.01 migration/1

6 root      34  19     0    0    0 S  0.0  0.0   0:00.23 ksoftirqd/1

7 root      RT  -5     0    0    0 S  0.0  0.0   0:00.00 watchdog/1

8 root      10  -5     0    0    0 S  0.0  0.0   0:00.06 events/0

9 root      10  -5     0    0    0 S  0.0  0.0   0:00.06 events/1

10 root      10  -5     0    0    0 S  0.0  0.0   0:00.01 khelper

49 root      10  -5     0    0    0 S  0.0  0.0   0:00.01 kthread

54 root      10  -5     0    0    0 S  0.0  0.0   0:02.86 kblockd/0

55 root      10  -5     0    0    0 S  0.0  0.0   0:00.07 kblockd/1

56 root      14  -5     0    0    0 S  0.0  0.0   0:00.00 kacpid

167 root      14  -5     0    0    0 S  0.0  0.0   0:00.00 cqueue/0

168 root      14  -5     0    0    0 S  0.0  0.0   0:00.00 cqueue/1

171 root      10  -5     0    0    0 S  0.0  0.0   0:00.00 khubd

173 root      10  -5     0    0    0 S  0.0  0.0   0:00.00 kseriod

247 root      15   0     0    0    0 S  0.0  0.0   0:00.00 khungtaskd

250 root      10  -5     0    0    0 S  0.0  0.0   2:09.73 kswapd0

251 root      14  -5     0    0    0 S  0.0  0.0   0:00.00 aio/0

252 root      14  -5     0    0    0 S  0.0  0.0   0:00.00 aio/1

405 root      12  -5     0    0    0 S  0.0  0.0   0:00.00 kpsmoused

436 root      11  -5     0    0    0 S  0.0  0.0   0:00.00 ata/0

437 root      14  -5     0    0    0 S  0.0  0.0   0:00.00 ata/1

438 root      14  -5     0    0    0 S  0.0  0.0   0:00.00 ata_aux

error.log

2011/07/08 09:38:35 [alert] 2347#0: ignore long locked inactive cache entry b226444cefde7310da28a7ff92d196db, count:2

2011/07/08 09:40:03 [error] 2345#0: *15167 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 124.126.178.250, server: www.xxx.com, request: "GET /dede/index.php HTTP/1.1", upstream: "fastcgi://unix:/dev/shm/php-cgi.sock:", host: "www.xxx.com"

2011/07/08 09:42:08 [alert] 2342#0: worker process 2343 exited on signal 11

2011/07/08 09:48:09 [alert] 2342#0: cache manager process 2347 exited on signal 9

2011/07/08 09:48:09 [alert] 2342#0: worker process 15408 exited on signal 9

2011/07/08 09:48:09 [alert] 2342#0: worker process 2346 exited on signal 9

2011/07/08 09:48:09 [alert] 2342#0: worker process 2345 exited on signal 9

2011/07/08 09:48:09 [alert] 2342#0: worker process 2344 exited on signal 9

是什么原因造成的呢

还有反映一个问题本来想上传图片呢 可是试了N次失败告终

10f410e9d20f63a22b684fc8b5d08ae6.gif

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值