Welcome! Log In Create A New Profile

Advanced

NGinx taking long time to get the contents from Cache

Posted by roradhak 
NGinx taking long time to get the contents from Cache
October 18, 2018 09:17AM
NGinx is taking long time to get the contents from the cache. Please look at the logs below.

84.210.206.210 - - [04/Oct/2018:13:24:55 +0000] "GET /mdp/show/574e46822e853fa0f380f1e3/groupid%3A%2F%2F650183866?pset=mdp%3Ano-presentation&filter%3AfirstRun=false HTTP/1.1" 200 23059 "-" "Apache-HttpClient/4.5.2 (Java/1.8.0_05)" cachestatus: HIT dest: - response_time: 13.003
84.210.206.210 - - [04/Oct/2018:13:24:55 +0000] "GET /mdp/show/574e46822e853fa0f380f1e3/groupid%3A%2F%2F650183866?pset=mdp%3Ano-presentation&filter%3AfirstRun=false HTTP/1.1" 200 16219 "-" "Apache-HttpClient/4.5.2 (Java/1.8.0_05)" cachestatus: HIT dest: - response_time: 51.513
84.210.206.210 - - [04/Oct/2018:13:24:55 +0000] "GET /mdp/show/574e46822e853fa0f380f1e3/groupid%3A%2F%2F650183866?pset=mdp%3Ano-presentation&filter%3AfirstRun=false HTTP/1.1" 200 1403792 "-" "Apache-HttpClient/4.5.2 (Java/1.8.0_05)" cachestatus: HIT dest: - response_time: 3.513
84.210.206.210 - - [04/Oct/2018:13:24:55 +0000] "GET /mdp/show/574e46822e853fa0f380f1e3/groupid%3A%2F%2F650183866?pset=mdp%3Ano-presentation&filter%3AfirstRun=false HTTP/1.1" 200 18955 "-" "Apache-HttpClient/4.5.2 (Java/1.8.0_05)" cachestatus: HIT dest: - response_time: 42.008
84.210.206.210 - - [04/Oct/2018:13:24:55 +0000] "GET /mdp/show/574e46822e853fa0f380f1e3/groupid%3A%2F%2F650183866?pset=mdp%3Ano-presentation&filter%3AfirstRun=false HTTP/1.1" 200 28531 "-" "Apache-HttpClient/4.5.2 (Java/1.8.0_05)" cachestatus: HIT dest: - response_time: 23.008
There are few taking even 50s. I am not sure why is this happening. My Config is as follows.

proxy_cache_path /var/cache/nginx/mdp_cache levels=1:2 keys_zone=mdp_cache:128m max_size=5g loader_threshold=300 loader_files=200 inactive=120m;

location ~ /mdp/show/(.*) {
proxy_pass http://mdp;
proxy_cache mdp_cache;
proxy_cache_lock on;
proxy_cache_lock_age 60s;
proxy_cache_lock_timeout 60s;
proxy_read_timeout 60000ms;
proxy_http_version 1.1;
proxy_set_header Connection "";
#proxy_ignore_headers Cache-Control;
#proxy_ignore_headers Expires;
#proxy_cache_revalidate on;
proxy_cache_min_uses 1;#minimum number of resquests to be hit before getting cached
proxy_cache_valid 404 0s;
proxy_cache_valid 200 201 202 203 204 304 240m;#200 201 202 203 204 http cached response is valid for 120 min
proxy_cache_valid 502 504 0s;#dont cache 502, 504 responses
add_header X-Proxy-Cache $upstream_cache_status;#To figure out if the response was from cache or not
add_header X-Proxy-GRID T4;
}
Any idea what i am doing wrong here?
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 92
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready