I have a very low tier VPS - 1GB ram and 1 CPU w/ 30gb SSD running CentOS (v7.2.1511). The server only servers php-fpm (v5.4.16) and nginx (1.6.3). Mysql and Mongo databases are on another server.
I know that my servers have very low specs but the performance that I get for less than 1 request per second is insanely slow - it takes about 20 seconds to run a PHP script. Static content runs very fast. It is the dynamic content that takes forever.
Here are my config files:
# php-fpm.d/www.conf: listen = /var/run/php-fpm/php-fpm.sock pm = dynamic pm.start_servers = 3 pm.min_spare_servers = 2 pm.max_spare_servers = 5 pm.max_children = 5 php_value[session.session_handler] = files # nginx.conf worker_processes = 1 events { worker_connections = 512; } http { 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; tcp_nodelay on; keepalive_timeout 65; types_hash_max_size 2048; include /etc/nginx/mime.types; default_type application/octet-stream; include /etc/nginx/sites/*; } # a config for a website server { listen 80; server_name example.com; index index.php; root /var/www/example.com; include conf.d/wordpress.conf; } # conf.d/wordpress.conf location / { try_files $uri $uri/ /index.php?$args; } include conf.d/php.conf; # conf.d/php.conf location ~ \.php$ { fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock; fastcgi_index index.php; include fastcgi_params; } # fastcgi_params fastcgi_param QUERY_STRING $query_string; fastcgi_param REQUEST_METHOD $request_method; fastcgi_param CONTENT_TYPE $content_type; fastcgi_param CONTENT_LENGTH $content_length; fastcgi_param SCRIPT_NAME $fastcgi_script_name; fastcgi_param REQUEST_URI $request_uri; fastcgi_param DOCUMENT_URI $document_uri; fastcgi_param DOCUMENT_ROOT $document_root; fastcgi_param SERVER_PROTOCOL $server_protocol; fastcgi_param HTTPS $https if_not_empty; fastcgi_param GATEWAY_INTERFACE CGI/1.1; fastcgi_param SERVER_SOFTWARE nginx/$nginx_version; fastcgi_param REMOTE_ADDR $remote_addr; fastcgi_param REMOTE_PORT $remote_port; fastcgi_param SERVER_ADDR $server_addr; fastcgi_param SERVER_PORT $server_port; fastcgi_param SERVER_NAME $server_name; fastcgi_param REDIRECT_STATUS 200; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; I believe there is a problem with php-fpm, so I am still tweaking it. Can you help me figure out the problem?