Slide 1

Slide 1 text

Varnish vs Memcached 2016.12.02 社内勉強会 @nakamura_tsuyo4

Slide 2

Slide 2 text

agenda 2 ▹ What is Varnish? ▹ Benchmark Memcached and Varnish ▸ System Configuration ▸ Benchmark Results ▹ Summary

Slide 3

Slide 3 text

Varnish Varnish HTTP Cache … https://varnish-cache.org/ 3 Poul-Henning Kamp

Slide 4

Slide 4 text

Varnish ▹ History ▸ 2006 … Version1.0 ▸ 2008 … Version2.0 ▸ 2011 … Version3.0 ▸ 2014 … Version4.0 ▸ 2016 … Version5.0 4 ▹ HTTPアクセラレーター ▸ 同類のプロダクトで Squid cacheとかある ▸ Squidより10~20倍高速 by wiki

Slide 5

Slide 5 text

memcached ▹ Version 1.4.4 ▹ CentOS 6.3でdefault入る ▹ Nginx 1.10.1 Benchmark memcached and Varnish (configration) varnish ▹ Version 2.1.5 ▹ CentOS 6.3でdefaultで入る ▹ Nginx 1.10.1 5

Slide 6

Slide 6 text

Benchmark memcached and Varnish (configration) 6 ngx_http_memcached_moduleでnginxと memcachedをつなぐ Nginxのproxy設定でvarnishとつなぐ ▹ どちらの環境もあらかじめCacheデータは作成しておく ▸ Cacheデータはhttp://www.yahoo.co.jpのhtmlデータ memcached varnish http http

Slide 7

Slide 7 text

Benchmark Metrics HTTP load testing tool https://github.com/tsenart/vegeta 7

Slide 8

Slide 8 text

Benchmark Metrics ▹ 秒間100リクエストを20sec実施 ▸ Memcached ⬩ echo "GET https://192.168.33.10" | vegeta attack -rate=100 -duration=20s -insecure | tee results_memcached.bin | vegeta report ▸ Varnish ⬩ echo "GET http://192.168.33.10:8000" | vegeta attack -rate=100 -duration=20s -insecure | tee results_varnish.bin | vegeta report 8

Slide 9

Slide 9 text

Benchmark Results 9

Slide 10

Slide 10 text

Benchmark Results 10

Slide 11

Slide 11 text

Benchmark Results 11 memcached varnish

Slide 12

Slide 12 text

Summary ▹ 今回のBenchmarkではvarnishのが高速に動いていた ▹ 所感ではcacheとしてのその他の機能はvarnishのが整っ ている感ある ▹ どちらも枯れた技術ではありそれなりの安心感はあると 思ってる ▹ CDN屋さんでもまだ使われるproduct=varnishなので ▹ 当初から思ってたvarnishのが早いんじゃない?は思った 通りだった 12

Slide 13

Slide 13 text

おまけ 13 ELB varnish Nginx PHP-FPM ELB Nginx Varnish Nginx PHP-FPM より高速になるだろう構成