OS: Ubuntu 11.04 64bit

Nginx + PHP5-FPM + APC + ZendGuard
Wordpress + Hypercache


ab 壓力測試

ab -n 1000 -c 20 -k http://essoduke.org/

ab -n 1000 -c 50 -k http://essoduke.org/

數據很漂亮 XD

Nginx

user www-data;
worker_processes 2; //配合負載,目前只使用 2+1 個處理序
pid /var/run/nginx.pid;
worker_rlimit_nofile 10240;

events {
        use epoll; //開啟 epoll 模式
        worker_connections 768; //配合負載
}

http {
        sendfile on;
        send_timeout 60;
        tcp_nopush on;
        tcp_nodelay on;
        keepalive_timeout 60;
        types_hash_max_size 2048;
        server_tokens off;

        server_names_hash_bucket_size 128;
        server_name_in_redirect off;
        client_max_body_size 8m;
        client_body_timeout 10;
        client_header_timeout 10;
        large_client_header_buffers 4 4k;
        output_buffers 1 32k;

        ##
        # Fastcgi Settings
        ##
        fastcgi_connect_timeout 30;
        fastcgi_send_timeout 30;
        fastcgi_read_timeout 30;
        fastcgi_buffers 4 64k;
        fastcgi_buffer_size 64k;
        fastcgi_busy_buffers_size 128k;
        fastcgi_temp_file_write_size 128k;
 
        ##
        # Cache Settings
        ##
        open_file_cache max=204800 inactive=30s;
        open_file_cache_min_uses 1;
        open_file_cache_valid 30s;

         ##
        # Gzip Settings
        ##

        gzip on;
        gzip_disable "MSIE [1-6]\.";
        gzip_vary on;
        gzip_proxied any;
        gzip_comp_level 2;
        gzip_buffers 4 16k;
        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;

}

PHP5-FPM

pm = static
pm.max_children = 2 //配合負載,只使用 2+1 個處理序
pm.max_requests = 500 //配合負載
request_terminate_timeout = 30
rlimit_files = 51200
php_admin_value[memory_limit] = 64M //限制 PHP 可使用記憶體量

MySQL

interactive_timeout     = 30
wait_timeout            = 10
connect_timeout         = 10

skip-external-locking
skip-innodb
skip-locking

key_buffer              = 1M
max_allowed_packet      = 2M
thread_stack            = 64K
thread_cache_size       = 3
max_connections         = 3
table_cache             = 16
sort_buffer_size        = 64K
read_buffer_size        = 256K
read_rnd_buffer_size    = 256K
net_buffer_length       = 2K

query_cache_limit       = 256K
query_cache_size        = 4M


話說…網誌也啟用了 IPv6 跟上潮流!