Welcome! Log In Create A New Profile

Advanced

High traffic site running slow

Posted by particle 
High traffic site running slow
November 12, 2012 04:45PM
Hi everyone,

I am running a high traffic site with some friends and recently we switched from Apache to Nginx. We're having large problems since then. When we hit like 300 visitors the site loads very slow. It can take about 10+ seconds for a page to load.

It only seems to be pages with PHP that loads slowly. We don't have the samme issue on pages with pure HTML. After searching the Nginx forums we don't seem to be the only ones with this issue, but I haven't found any solution for it when I've searched. Any help with this is really appreciated!

Here's how our conf-file looks like for the moment:

user www-data;
worker_processes 12;
worker_rlimit_nofile 8192;
pid /var/run/nginx.pid;

events {
worker_connections 4096;
multi_accept on;
use epoll;
}

http {

##
# Basic Settings
##

sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
server_tokens off;

#edit
client_max_body_size 2m;
fastcgi_buffers 256 16k;
fastcgi_buffer_size 32k;
limit_req_zone $binary_remote_addr zone=blitz:10m rate=10r/s;

# server_names_hash_bucket_size 64;
# server_name_in_redirect 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";

# gzip_vary on;
# gzip_proxied any;
# gzip_comp_level 6;
# gzip_buffers 16 8k;
# gzip_http_version 1.1;
# gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;

##
# nginx-naxsi config
##
# Uncomment it if you installed nginx-naxsi
##

#include /etc/nginx/naxsi_core.rules;

##
# nginx-passenger config
##
# Uncomment it if you installed nginx-passenger
##

#passenger_root /usr;
#passenger_ruby /usr/bin/ruby;

##
# Virtual Host Configs
##

include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
}


#mail {
# # See sample authentication script at:
# # http://wiki.nginx.org/ImapAuthenticateWithApachePhpScript
#
# # auth_http localhost/auth.php;
# # pop3_capabilities "TOP" "USER";
# # imap_capabilities "IMAP4rev1" "UIDPLUS";
#
# server {
# listen localhost:110;
# protocol pop3;
# proxy on;
# }
#
# server {
# listen localhost:143;
# protocol imap;
# proxy on;
# }
#}
Re: High traffic site running slow
December 05, 2012 02:23AM
If you use php-fpm check your pool settings pm and pm.max_children
I use pm = static I feel it response way faster then the other two options when I test.
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 254
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready