使用 couchbase-nginx-module 編譯的 Nginx CPU 使用率高

使用 couchbase-nginx-module 編譯的 Nginx CPU 使用率高

我正在使用 ngx_srcache 模組測試 couchbase_nginx 模組以將資料儲存在 couchbase 中。我用https://github.com/couchbaselabs/couchbase-nginx-module根據指南編譯和安裝設置,沒有遇到任何問題。

經過幾次瀏覽後,Nginx CPU 使用率達到 100%,瀏覽器用戶端無法下載剩餘數據,且 nginx 進程被凍結。這是我的配置

# ./sbin/nginx -V
nginx version: nginx/1.3.7
built by gcc 4.4.5 20110214 (Red Hat 4.4.5-6) (GCC)
configure arguments: --prefix=/opt/nginx-couchbase --with-debug --add-module=../nginx-    couchbase-module-0.3.1 --add-module=./contrib/srcache-nginx-module-master --add-module=./contrib/memc-nginx-module-master

nginx.conf:
....
        location /cb {
        internal;
        set $couchbase_key $arg_key;
        set $couchbase_cmd $arg_cmd;
        set $couchbase_val $arg_val;
        couchbase_connect_timeout 6ms;
        couchbase_timeout 3ms;
    add_header X-Couchbase-Flags $couchbase_flags;
        couchbase_pass localhost:8091,127.0.0.1:8091,localhost bucket=default;
    }

    location / {
        set $key $uri$args;
        srcache_fetch GET /cb key=$key;
        srcache_store PUT /cb key=$key;
        srcache_store_statuses 200 301 302;
        proxy_pass http://192.168.0.61:8080;
            proxy_set_header  Accept-Encoding  "";
    proxy_http_version 1.1;
    proxy_set_header Connection "";
    proxy_set_header    X-Real-IP   $remote_addr;
    proxy_set_header    Host        $http_host;


    }

# rpm -qa | grep couchbase
couchbase-server-2.0.1-170.x86_64
libcouchbase2-core-2.1.2-1.x86_64

# cat cat /etc/redhat-release
Red Hat Enterprise Linux Server release 6.1 (Santiago)

請在此處查找 nginx 錯誤日誌 -http://pastebin.com/JqgTkZmV

請注意,我可以使用以下 URL 進行設定/獲取,並對任何問題進行壓力測試

curl -v 'http://localhost:8080/cb?cmd=set&key=foo&val=bar'
curl -v  'http://localhost:8080/cb?cmd=get&key=foo'

感謝幫助。

相關內容