proxy_cache:Why Receive >Transmit?

fffffffffffff nginx-forum at forum.nginx.org
Sun Aug 14 06:24:07 UTC 2016


structure: nginx<->backend server

the nginx and backendserver enable gzip.

nginx.conf:

worker_processes 1;

error_log /var/log/nginx/error.log warn; pid /var/run/nginx.pid;

worker_rlimit_nofile 1024; 
events { 
    worker_connections 1024;
} 
http { 
    include /etc/nginx/mime.types; default_type application/octet-stream;

log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                  '$status $body_bytes_sent "$http_referer" '
                  '"$http_user_agent" "$http_x_forwarded_for"';

access_log  /var/log/nginx/access.log  main;
sendfile        on;
tcp_nopush     on;
keepalive_timeout  120;
gzip  on;
gzip_types application/json text/plain application/x-javascript
application/javascript text/javascript text/css application/xml text/xml;
gzip_min_length 1k;
server_tokens off;
upstream backend{
    server xxx.xxx.xxx.xxx;
    keepalive 120;
}
proxy_temp_path /tmp/cache_tmp;
proxy_cache_path /tmp/cache levels=1:2 keys_zone=cache1:100m inactive=7d
max_size=10g;
server{
    listen 80;
    location / {
        proxy_pass http://backend;
        proxy_http_version 1.1;
        proxy_set_header Range $http_range;
        proxy_set_header If-Range $http_if_range;
        proxy_set_header Connection "";
        proxy_set_header X-Forwarded-For $remote_addr;
        proxy_set_header Accept-Encoding "gzip";
        proxy_cache cache1;
        proxy_cache_key $uri$is_args$args;
        proxy_cache_revalidate on;
        }
    }
}
Now, I use iftop watch, RX>TX, why ? When i disable proxy_cache , the RX=TX

Posted at Nginx Forum: https://forum.nginx.org/read.php?2,268938,268938#msg-268938



More information about the nginx mailing list