Hi,
I recently moved to nginx and instantly started noticing a constant hold up of 200ms to 4s on all my requests. First I thought it was my PHP scripts (mainly wordpress) taking time but then I noticed the similar delay on images and static html pages.
I created a controlled test to understand the problem:
http://adeelejaz.com/test/test.html
http://adeelejaz.com/test/test.php
Both these pages get a delay of about 120ms to 150ms (which made me rule out fpm as an issue). I checked Firebug and Chrome and found out the delay is on "Waiting" which I assume is the time it takes the server to fetch the resource.
I was using a unix socket so I switched to IP (127.0.0.1:9000) just to check if that might be the cause but I got same results.
I also borrowed my mate's nginx.conf file just in case I was doing something wrong but I cannot see anything odd. I've tried searching but most of people issues are with fpm only but in my case, my static resources also take time.
The server is a Rackspace Cloud server with a quad core and 512mb ram.
My conf file:
user www-data;
worker_processes 4;
pid /var/run/nginx.pid;
events {
worker_connections 768;
}
http {
##
# Basic Settings
##
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
server_tokens off;
include /etc/nginx/mime.types;
default_type application/octet-stream;
##
# Logging Settings
##
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
##
# Gzip Settings
##
gzip on;
gzip_disable "msie6";
##
# Virtual Host Configs
##
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
}
Thanks