Hello,
I have dedicated linux server with 3 gameservers running and xenforo. When people start browsing forums gameservers lags. So my question is how can i limit system resources available to xenforo(nginx, php, etc), 1 gig of ram and 30% cpu maximum for example. Here are my phpinfo and nginx config. Other webserver related config files left with default settings.
Could you please advise me how to solve this issue? Moving xenforo to a separate server/hosting is not possible at the moment. Excuse me for my engrish. Thanks!
I have dedicated linux server with 3 gameservers running and xenforo. When people start browsing forums gameservers lags. So my question is how can i limit system resources available to xenforo(nginx, php, etc), 1 gig of ram and 30% cpu maximum for example. Here are my phpinfo and nginx config. Other webserver related config files left with default settings.
Could you please advise me how to solve this issue? Moving xenforo to a separate server/hosting is not possible at the moment. Excuse me for my engrish. Thanks!
Code:
server {
listen 80;
server_name mydomain.com;
rewrite ^(.*)$ http://www.mydomain.com$1 permanent;
}
server {
listen 80;
server_name www.mydomain.com; # your domain name WITH www.
access_log /var/log/nginx/mydomain.com.access.log;
error_log /var/log/nginx/mydomain.com.error.log;
root /var/www;
location ~ /\.ht { deny all; } # Anything starting with .ht gets denied
location =/htaccess.txt { deny all; }
location ~* \.(bmp|tiff|tga|jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|tar|wav|bmp|rtf|js|7z|tar|lzma)$ { # serve all these static files without hitting the php processor
root /var/www; # you dont have to be explicit about this but incase you need to proxy stuff to another server this static stuff will still go through nginx
expires max;
}
location =/admin.php {
auth_basic "Restricted";
auth_basic_user_file /var/.htpasswd;
include fastcgi_params;
fastcgi_pass 127.0.0.1:9000;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include /etc/nginx/fastcgi_params;
}
location / {
root /var/www; # absolute path to your installation
try_files $uri $uri/ /index.php?$uri&$args;
index index.html index.php index.htm;
location ~* ^.*\.php$ {
include fastcgi_params;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include /etc/nginx/fastcgi_params;
}
}
}