簡體   English   中英

增加nginx上的緩沖區超時大小

[英]Increase buffer timeout size on nginx

我有一個連接到cloudstack apis的nodejs程序。 在cloudstack上創建虛擬機大約需要20秒。

該程序在我的本地nodejs安裝和apigee雲上運行良好。 但是,當我在客戶的OPDK上部署相同內容時,Nginx會返回502-Bad網關。 此鏈接http://www.nginxtips.com/502-bad-gateway-using-nginx/建議在nginx.conf中增加緩沖區和超時大小

http {
...
fastcgi_buffers 8 16k;
fastcgi_buffer_size 32k;
fastcgi_connect_timeout 300;
fastcgi_send_timeout 300;
fastcgi_read_timeout 300;
...
}

推薦的理想值是多少? 什么是Apigee雲?

問候,Girish

如果使用nginx作為代理,您可能需要查看nginx中的代理超時配置:

http://www.nginxtips.com/504-gateway-time-out-using-nginx/
http://wiki.nginx.org/HttpProxyModule

 proxy_connect_timeout       60;
 proxy_read_timeout          120;

Apigee超時默認值:

連接超時 - 60秒 - connect.timeout.millis
讀取超時 - 120s - io.timeout.millis

FYI Apigee超時也可在TargetEndpoint連接中進行配置(以毫秒為單位):

<HTTPTargetConnection>
    <Properties>
        <Property name="connect.timeout.millis">5000</Property>
        <Property name="io.timeout.millis">5000</Property>
    </Properties>
    <URL>http://www.google.com</URL>
</HTTPTargetConnection>

根據服務器響應的時間長短,可以確定理想的超時配置。 在這種情況下,45-60s的讀取超時可能是理想的,以便在cloudstack減速更多的情況下提供一些緩沖。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM