KaraMustafa
Active Member
Hey,
I wan't to ask You guys for some tips.
Few months ago when I bought my VPS I was using Apache webserver but after some time I had big site load and it even did not work to work. So I've switched to lighter webserver as lighttpd. Right now I'm having problems with high %w (iowait). Lighttpd process is a almost always shown as D process in htop. I don't know if it's becouse my VPS configuration or some network/disk problems which i can not repair.
Maybe I should simply switch to another VPS provider?
Now I wanna try nginx as i think it may help (or not, don't know) but I'm facing little problem.
I've installed nginx and have working php, I mean main index.php is working but other php files in other directories won't work. (right now I'm using lighttpd with rewrite rules)
my /etc/nginx/nginx.conf
my /etc/nginx/conf.d
my lighttpd rewrite rule (php file in make dir won't work)
I wan't to ask You guys for some tips.
Few months ago when I bought my VPS I was using Apache webserver but after some time I had big site load and it even did not work to work. So I've switched to lighter webserver as lighttpd. Right now I'm having problems with high %w (iowait). Lighttpd process is a almost always shown as D process in htop. I don't know if it's becouse my VPS configuration or some network/disk problems which i can not repair.
Maybe I should simply switch to another VPS provider?
Now I wanna try nginx as i think it may help (or not, don't know) but I'm facing little problem.
I've installed nginx and have working php, I mean main index.php is working but other php files in other directories won't work. (right now I'm using lighttpd with rewrite rules)
my /etc/nginx/nginx.conf
Code:
# For more information on configuration, see:
# * Official English Documentation: http://nginx.org/en/docs/
# * Official Russian Documentation: http://nginx.org/ru/docs/
user nginx;
worker_processes 1;
error_log /var/log/nginx/error.log;
#error_log /var/log/nginx/error.log notice;
#error_log /var/log/nginx/error.log info;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
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;
#keepalive_timeout 0;
keepalive_timeout 65;
gzip on;
# Load config files from the /etc/nginx/conf.d directory
# The default server is in conf.d/default.conf
include /etc/nginx/conf.d/*.conf;
}
my /etc/nginx/conf.d
Code:
#
# The default server
#
server {
listen 80;
server_name _;
#charset koi8-r;
#access_log logs/host.access.log main;
location / {
root /var/www/html;
index index.php;
}
error_page 404 /404.html;
location = /404.html {
root /var/www/html;
}
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /var/www/html;
}
# proxy the PHP scripts to Apache listening on 127.0.0.1:80
#
#location ~ \.php$ {
# proxy_pass http://127.0.0.1;
#}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
location ~ \.php$ {
root /var/www/html;
fastcgi_pass 127.0.0.1:9000;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME /var/www/html$fastcgi_script_name;
}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
location ~ /\.ht {
deny all;
}
}
my lighttpd rewrite rule (php file in make dir won't work)
Code:
url.rewrite = ( "^/make/(.*)" => "doit/index.php?id=$1" )
Code:
vmstat 1
procs -----------memory---------- ---swap-- -----io---- --system-- -----cpu-----
r b swpd free buff cache si so bi bo in cs us sy id wa st
0 0 0 822824 0 988816 927 1136 21278 9318 0 185 0 0 97 3 0
0 0 0 822116 0 989428 0 0 680 0 0 482 0 1 97 2 0
0 0 0 821672 0 989952 0 0 428 0 0 357 1 0 98 2 0
0 0 0 821116 0 990484 0 0 524 0 0 422 0 1 96 3 0
0 0 0 820724 0 990884 0 0 660 0 0 499 1 1 96 3 0
0 0 0 820292 0 991296 0 0 420 0 0 414 0 0 97 2 1
0 1 0 820608 0 990988 0 0 260 0 0 484 0 0 98 2 0
0 0 0 820288 0 991308 0 0 568 0 0 458 0 0 98 2 0
0 1 0 819756 0 991856 0 0 696 4 0 367 0 1 96 3 0
0 0 0 819900 0 991740 0 0 776 0 0 337 1 1 97 2 0
0 0 0 818656 0 992952 0 0 1256 48 0 392 0 1 96 3 1
0 1 0 818000 0 993660 0 0 968 52 0 431 0 1 95 5 0
0 0 0 817480 0 994156 0 0 1136 0 0 440 0 1 96 3 0
0 0 0 817444 0 994156 0 0 600 0 0 360 0 1 95 5 0
0 0 0 816836 0 994788 0 0 704 0 0 522 1 0 97 2 1
0 1 0 816792 0 994832 0 0 40 0 0 468 0 1 97 3 0
0 0 0 816064 0 995564 0 0 720 0 0 411 0 1 95 4 0
0 0 0 815584 0 995992 0 0 788 0 0 424 0 1 93 6 0
0 0 0 814840 0 996728 0 0 984 4 0 435 1 1 95 4 1
0 0 0 814440 0 997136 0 0 628 0 0 483 1 1 94 5 0
0 0 0 813820 0 997772 0 0 620 148 0 342 0 1 98 1 0
Last edited: