|
将之前的一台服务器换成了centos 5.6,上面跑着nginx1.0.2 + php5.3.6 (fastcgi)。
----------------------------------------------------
现在的情况是当我使用移动的宽带访问网站时,经常出现页面加载一小部分就终止了。在未换成centos之前,用移动的打开很慢,但至少能加载完成。而现在直接就加载一半就完了。。
---------------------------------------------------
在网上找了N久,一直不解。现贴上相关的配置文件,忘各位帮忙分析分析,先在此谢过了。
--------------------------------------------------
1。修改过后的/etc/sysctl.conf配置文件:
net.ipv4.ip_forward = 0
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.default.accept_source_route = 0
kernel.sysrq = 0
kernel.core_uses_pid = 1
net.ipv4.tcp_syncookies = 1
kernel.msgmnb = 65536
kernel.msgmax = 65536
kernel.shmmax = 68719476736
segments, in pages
kernel.shmall = 4294967296
net.ipv4.tcp_max_syn_backlog = 262144
net.core.netdev_max_backlog = 262144
net.core.somaxconn = 262144
net.ipv4.tcp_rmem = 4096 87380 4194304
net.ipv4.tcp_wmem = 4096 87380 4194304
net.core.wmem_default = 8388608
net.core.rmem_default = 8388608
net.core.rmem_max = 16777216
net.core.wmem_max = 16777216
net.ipv4.tcp_timestamps = 0
net.ipv4.tcp_synack_retries = 1
net.ipv4.tcp_syn_retries = 1
net.ipv4.tcp_max_tw_buckets = 6000
net.ipv4.tcp_sack = 1
net.ipv4.tcp_window_scaling = 1
net.ipv4.tcp_tw_recycle = 1
#net.ipv4.tcp_tw_len = 1
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_mem = 94500000 915000000 927000000
net.ipv4.tcp_max_orphans = 3276800
net.ipv4.tcp_keepalive_time = 30
net.ipv4.ip_local_port_range = 1024 65535
net.ipv4.tcp_syncookies=1
net.ipv4.tcp_fin_timeout = 1
-------------------------------------------------------
2。配置的nginx.conf如下:
user www www;
worker_processes 16;
error_log error.log crit;
pid nginx.pid;
worker_rlimit_nofile 65535;
events {
use epoll;
worker_connections 65535;
}
http {
include mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] $host "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
server_names_hash_bucket_size 128;
server_name_in_redirect off;
server_tokens off;
client_header_buffer_size 32k;
#client_header_buffer_size 4k;
large_client_header_buffers 4 32k;
client_max_body_size 8m;
sendfile on;
tcp_nopush on;
keepalive_timeout 65;
tcp_nodelay on;
open_file_cache max=65535 inactive=20s;
open_file_cache_valid 30s;
open_file_cache_min_uses 1;
client_body_timeout 10;
client_header_timeout 10;
send_timeout 60;
#output_buffers 132k; (这个跟postpone_output不太明白意思,而且output_buffers在nginx1.0.2下报错)
postpone_output 1460;
fastcgi_connect_timeout 300;
fastcgi_send_timeout 300;
fastcgi_read_timeout 300;
fastcgi_buffer_size 64k;
fastcgi_buffers 4 64k;
fastcgi_busy_buffers_size 128k;
fastcgi_temp_file_write_size 128k;
fastcgi_cache_valid 301 1d;
gzip_static on;
gzip on;
gzip_min_length 1k;
gzip_buffers 4 16k;
gzip_http_version 1.0;
gzip_comp_level 3;
gzip_types text/plain application/x-javascript text/css application/xml;
gzip_vary on;
}
--------------------------------------------------------------------------
再一次感谢。 |
|