First something about the infrastructure:
We have migrated one of our backend/admin servers to amazon. The applications on this server are only used sporadically (max. 10 parallel users). We are using a t1.micro instance running Gentoo. As Webserver we are using nginx in combination with PHP-FPM. The problem is that sometimes the server is dead slow that means a page needs 10-20sec to load (max 2sec on my local dev environment, and these pages are heavy ... 80mb+). I tried to analyze and reproduce the error but only figured out the memory is okay (270mb free) while cpu load is at 100%
Configuration:
nginx has 2 workers and max. 1024 connections.
PHP-FPM (I removed the comments)
error_log = /var/log/php-fpm.log
...
;;;;;;;;;;;;;;;;;;;;
; Pool Definitions ;
;;;;;;;;;;;;;;;;;;;;
[www]
listen = 127.0.0.1:9000
user = www
group = www
pm = dynamic
pm.max_children = 8
pm.start_servers = 2
pm.min_spare_servers = 2
pm.max_spare_servers = 4
pm.max_requests = 100
I hope some one has a clue what to do :)