Home  >  Article  >  Database  >  Nginx HttpMemcModule和直接访问memcached效率对比测试

Nginx HttpMemcModule和直接访问memcached效率对比测试

WBOY
WBOYOriginal
2016-06-07 16:42:231010browse

测试环境: net.ipv4.tcp_tw_recycle = 0net.ipv4.tcp_tw_reuse = 0net.ipv4.tcp_timestamps = 1 关于这几个内核参数对应的解释可参考资料:2.12. Reduce TCP performance spikes 测试方案: 测试结果: 结论及建议: 单从本次测试结果来看,HttpMemcMC值得

  • 测试环境:
  • net.ipv4.tcp_tw_recycle = 0 net.ipv4.tcp_tw_reuse = 0 net.ipv4.tcp_timestamps = 1

关于这几个内核参数对应的解释可参考资料:2.12. Reduce TCP performance spikes

  • 测试方案:
  • 测试结果:

 

NginxHttpMemcMC-vs-NativeMC-benchmark-2013091301

NginxHttpMemcMC-vs-NativeMC-benchmark-2013091302

 

 

NginxHttpMemcMC-vs-NativeMC-benchmark-2013091303

NginxHttpMemcMC-vs-NativeMC-benchmark-2013091304

 

结论及建议:

单从本次测试结果来看,HttpMemcMC值得拥有 :)

  • 结果结果更新:

调整上述几个内核参数:

net.ipv4.tcp_tw_recycle = 1 net.ipv4.tcp_tw_reuse = 1 net.ipv4.tcp_timestamps = 1

通过调整内核参数,调整tcp连接复用性提高tcp效率,新的测试结果如下:

备注:由于2次测试案例中,每并发线程请求数不一样,所以你会发现两边的数据无法直接对比,这是我的失误,抱歉。

  • 补充小结:

调整完内核后:
1. 可以发现,,HttpMemc的平均效率只有NativeMC 72.62%;
2. 调整内核tcp参数对提升tcp效率非常有帮助,Failed requests次数完全为0;
3. 由于可以提高memcached连接复用率以及对程序透明的好处,即便HttpMemc性能不如NativeMC,损失并不是非常厉害,仍然是可以接受的;

 

本条目发布于2013/09/14。属于数据库分类,被贴了 HttpMemcModule、InnoDB、memcached、MySQL、Nginx、测试 标签。作者是yejr

 

 

 

 

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn