Drupal 7 开发内部培训资料, 分头诗人

内网压力测试的问题

赞成!
0
否决!

ab -c 1000 -n 10000  http://v1.test.com/search
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking v1.aiyou-dev.com (be patient)
Completed 1000 requests
Completed 2000 requests
Completed 3000 requests
Completed 4000 requests
Completed 5000 requests
Completed 6000 requests
Completed 7000 requests
Completed 8000 requests
Completed 9000 requests
Completed 10000 requests
Finished 10000 requests

Server Software:        nginx
Server Hostname:        v1.aiyou-dev.com
Server Port:            80

Document Path:          /group/search
Document Length:        166 bytes

Concurrency Level:      1000
Time taken for tests:   3.103 seconds
Complete requests:      10000
Failed requests:        50
   (Connect: 0, Receive: 0, Length: 50, Exceptions: 0)
Write errors:           0
Non-2xx responses:      9953
Total transferred:      4546933 bytes
HTML transferred:       3084598 bytes
Requests per second:    3223.16 [#/sec] (mean)
Time per request:       310.254 [ms] (mean)
Time per request:       0.310 [ms] (mean, across all concurrent requests)
Transfer rate:          1431.20 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0   37 316.9      0    3001
Processing:     0   39 137.5     25    2924
Waiting:        0   38 137.5     25    2924
Total:          9   76 342.3     26    3002

Percentage of the requests served within a certain time (ms)
  50%     26
  66%     33
  75%     35
  80%     37
  90%     78
  95%    116
  98%    143
  99%   3001
100%   3002 (longest request)

node表就有1W多条数据

og_membership表2W多点数据

users表不到1W的数据

我把内网的数据,全部搞成和外网的数据一样,图片都一致了,上面的是内网压力测试结果。

但放到外网去,并发数在200多,就报502错误,卡得不行了。外网做了基础的memcache缓存,apc缓存,

针对匿名用户做了boost缓存,

我也检查了慢查询日志,发现大部分慢查询是与系统自带的查询有关,这些我怎么更改呢?

请问大家在优化方面,有什么经验吗?谢谢分享!

4 个回答

赞成!
0
否决!

优化方面,我们圈子的赵高欣同学挺有经验的,你也可以咨询一下他。另外,你是用nginx吗?如果不是,试一下换nginx,可能会有所好转。

赞成!
0
否决!

我们是用的nginx的,请问赵兄能看到这个问题么?非常感激。

赞成!
0
否决!

提速还是主要做好缓存; 前端静态页面试试看用varnish来缓存,用boost依然对硬盘io有不少压力。另外要多检查下高访问量页面的缓存是否有效,有些页面的缓存可能会被模块破坏。

赞成!
0
否决!

好的,已经做了memcache缓存