Redmine部署使用有一个月了,反馈有时很慢。
1、查看log发现,事务更新后要发送Email,如果连接邮件服务器有问题,会等待超时,导致很慢。
2、解决发送邮件问题后,仍然有时慢,ActiveRecord显示要几百秒。
测试:
1、采用http_load进行测试(只能测试GET,不支持POST。找了windows平台上运行的版本):
D:\App\Coder\http_load>http_load -parallel 8 -s 3000 urls.txt
: byte count wrong080/projects/oad/issues?page=5&query_id=12
: byte count wrong080/projects/oad/issues?page=2&query_id=12
: byte count wrong080/projects/oad/issues?page=2&query_id=33
: byte count wrong080/projects/oad/issues?page=7&query_id=14
: byte count wrong080/projects/oad/issues?page=5&query_id=12
5097 fetches, 8 max parallel, 1.8367e+08 bytes, in 3000.01 seconds
36034.9 mean bytes/connection
1.69899 fetches/sec, 61223.1 bytes/sec
msecs/connect: 0.593747 mean, 31.212 max, 0 min
msecs/first-response: 3452.88 mean, 48662.2 max, 25.022 min
5 bad byte counts
HTTP response codes:
code 200 -- 4763
code 302 -- 329
code 502 -- 5
最多48秒才返回,确实有点慢,但可以接受。
2、apache自带的ab应该也很轻量级的,可以测试POST,但是好像不能对多个POST列表同时测试。 下次试试JMeter。
3、性能优化的影响因素较多,可参考此文。如配置优化mysql,在my.ini里增加:
innodb_buffer_pool_size = 1073741824
# Threads_cached = ON # -> ON
thread_cache_size = 16 # (start at 4)
query_cache_size = 8000000 # (>= 8M)
join_buffer_size = 128000 # (> 128.0K)
tmp_table_size = 16000000 # (> 16M)
max_heap_table_size = 16000000 # (> 16M)
table_open_cache = 800 #(> 800)
#innodb_buffer_pool_size (>= 371M)
thread_concurrency = 8 #(cpu*2)