日韩黑丝制服一区视频播放|日韩欧美人妻丝袜视频在线观看|九九影院一级蜜桃|亚洲中文在线导航|青草草视频在线观看|婷婷五月色伊人网站|日本一区二区在线|国产AV一二三四区毛片|正在播放久草视频|亚洲色图精品一区

分享

使用nginx負載均衡,webbench做壓力測試出現(xiàn)的問題,求助

 WindySky 2016-04-13
臺式機配置:雙核4G內(nèi)存
VM開了三個虛擬機:一個做nginx服務器,設memory1G,ip:10.10.21.134;兩個做web服務器,使用的是自己裝的Q2A網(wǎng)站,memory都是1G,ip分別為:10.10.21.135,10.10.21.138
nginx.conf主要內(nèi)容:
worker_processes  2;
events {
    worker_connections  1024;
}
http {
    include       mime.types;
    default_type  application/octet-stream;
    sendfile        on;
    keepalive_timeout  65;
#均衡
upstream webservers{
 server 10.10.21.135 max_fails=3 fail_timeout=1s weight=1;
  server 10.10.21.138  max_fails=3 fail_timeout=1s weight=1;
 server 127.0.0.1:8080 backup;
#緩存
proxy_cache_path /nginx/cache/first levels=1:2:1 keys_zone=a:20m max_size=1g;
server {
        listen       80;
        server_name  localhost;
location / {
         proxy_pass http://webservers/;
        proxy_set_header X-Real-IP $remote_addr;
    proxy_connect_timeout 300;
proxy_read_timeout 300;
proxy_send_timeout 300;
        proxy_cache a;
#js與css請求
  location ~.*\.(gif|jpg|jpeg|png|bmp|swf|css|js)$
        {
     proxy_pass http://10.10.21.135;
      }
        }

}



apache2.conf的最主要配置:
Timeout 300
KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 15
<IfModule mpm_prefork_module>
     StartServers          5
    MinSpareServers       5
    MaxSpareServers      6
    ServerLimit         550
    MaxClients          500
MaxRequestsPerChild   10000
</IfModule>
HostnameLookups Off


使用webbench做測試時,60S并發(fā)1000時基本均衡,漏掉的請求也不是很多,60S并發(fā)1500做測試時,使用grep 'GET /' /var/log/nginx/access.log | grep '15/Sep/2014:19'|wc -l  命令對access.log做計算時結(jié)果如下:
nginx服務器:
兩個web:

結(jié)果漏了很多請求

error.log內(nèi)容:
nginx:2014/09/15 19:30:04 [error] 29561#0: *7668 connect() failed (110: Connection timed out) while connecting to upstream, client: 10.10.21.137, server: localhost, request: "GET / HTTP/1.0", upstream: "http://10.10.21.135:80/", host: "10.10.21.134"
135服務器:
[error] [client 10.10.21.134] PHP Notice:  session_start(): ps_files_cleanup_dir: opendir(/var/lib/php5) failed: Permission denied (13) in /var/www/question2answer/qa-include/qa-app-users.php on line 150
138服務器:
[error] [client 10.10.21.134] request failed: error reading the headers


難道這就是極限了嗎?還是我的配置數(shù)據(jù)有問題啊?
怎樣優(yōu)化nginx的配置呢?
尋求這位的幫助~~

    本站是提供個人知識管理的網(wǎng)絡存儲空間,所有內(nèi)容均由用戶發(fā)布,不代表本站觀點。請注意甄別內(nèi)容中的聯(lián)系方式、誘導購買等信息,謹防詐騙。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請點擊一鍵舉報。
    轉(zhuǎn)藏 分享 獻花(0

    0條評論

    發(fā)表

    請遵守用戶 評論公約

    類似文章 更多