- 论坛徽章:
- 0
|
我的应用有一台数据库服务器和一台web服务器组成。
web服务器:nginx+php-cgi centos5.0 ,数据库centos5.0,mysql5.0.36
当时网站访问量大的时候web压力很大,但是mysql压力很小。
http://bbs.****.com/NginxStatus 显示waiting数量很大。
nginx的配置:
worker_processes 8;
pid /var/run/nginx/nginx.pid;
# [ debug | info | notice | warn | error | crit ]
#error_log /var/log/nginx.error_log info;
#Specifies the value for maximum file descriptors that can be opened by this process.
worker_rlimit_nofile 51200;
events
{
use epoll;
#maxclient = worker_processes * worker_connections / cpu_number
worker_connections 51200;
}
http
{
include mime.types;
default_type application/octet-stream;
charset gb2312;
server_names_hash_bucket_size 128;
client_header_buffer_size 32k;
large_client_header_buffers 4 32k;
client_max_body_size 8m;
sendfile on;
tcp_nopush on;
keepalive_timeout 60;
tcp_nodelay on;
keep-alive
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 /data/www/logs/access.log main;
access_log /dev/null;
fastcgi_connect_timeout 300;
fastcgi_send_timeout 300;
fastcgi_read_timeout 300;
fastcgi_buffer_size 128k;
fastcgi_buffers 4 128k;
fastcgi_busy_buffers_size 128k;
fastcgi_temp_file_write_size 128k;
fastcgi_intercept_errors on;
gzip on;
gzip_comp_level 4;
gzip_min_length 1100;
gzip_buffers 4 8k;
gzip_http_version 1.1;
gzip_proxied any;
gzip_types text/plain text/xml text/javascript application/x-javascript text/css text/html application/xml;
也执行了ulimit -SHn 51200 .
目前找不出是db服务器的原因还是web服务器的原因。
访问量打的时候web服务器的load average 达到20多点。
找不出瓶颈在哪里?应该从哪里入手啊。
mysql的最大连接数也设置了,nging的连接数也设置了,还需要哪里做设置?
[ 本帖最后由 jiangyonghe 于 2009-10-21 23:42 编辑 ] |
|