I have set up Nginx with PHP-FPM on my MacBook running ML. It works fine but it takes between 5 and 10 seconds to connect when I run a page in my browser. Even the following PHP script:
takes about 5 seconds to connect. I am using Chrome and I get the "Sending request" message in the status bar for around 7 seconds. If I refresh again it seems to work instantly, but if I leave it for around 10 seconds it will "sleep" again. It is as if nginx or PHP is going to sleep and then taking ages to wake up again.
Can anyone help me figure out whats causing this?
[global] pid = /usr/local/etc/php/var/run/php-fpm.pid ; run in background or in foreground? ; set daemonize = no for debugging daemonize = yes include=/usr/local/etc/php/5.4/pool.d/*.conf
[www] user=matt group=staff pm = dynamic pm.max_children = 10 pm.start_servers = 5 pm.min_spare_servers = 5 pm.max_spare_servers = 10 pm.max_requests = 500 listen = /tmp/php-fpm.sock ;listen = 127.0.0.1:9000 php_flag[display_errors] = off