Created
January 14, 2013 19:58
-
-
Save dundee/4532848 to your computer and use it in GitHub Desktop.
Caching reverse proxy - Nginx vs Varnish - basic benchmark
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Varnish config | |
backend default { | |
.host = "127.0.0.1"; | |
.port = "80"; | |
} | |
# Nginx config | |
http { | |
proxy_cache_path /var/cache/nginx/workspace levels=1:2 keys_zone=workspace:8m max_size=1000m inactive=600m; | |
proxy_temp_path /var/cache/nginx/workspace/tmp; | |
server { | |
listen 8080; | |
server_name localhost; | |
location / { | |
proxy_pass http://127.0.0.1:80; | |
proxy_set_header Host $host; | |
proxy_cache workspace; | |
proxy_cache_valid 200 302 60m; | |
proxy_cache_valid 404 1m; | |
} | |
} | |
} | |
# Benchmark | |
ab -c 100 -n 10000 http://127.0.0.1:8080/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment