クラウドインフラ構築記

現在AWSの構築支援に携わっております。今注視しているのは、GKE、BigQuery、Google Dataflowなどサービスを展開しているGoolge Cloud Platformです。

AWSSDK for PHP 2を使う場合のnginxなどのタイムアウトの設定


AWS SDK for PHP 2のMultipartUploadでアップロードする際、webサーバーのタイムアウト時間を延ばしてやる必要があります。

nginxのFastCGIのタイムアウト時間の設定から (/etc/nginx/conf.d/default.conf)

fastcgi_send_timeout 1800;
fastcgi_read_timeout 1800;
fastcgi_connect_timeout 1800;

次に、php-fpmの設定 (/etc/php-fpm.d/www.conf)

request_terminate_timeout = 1800

最後に、phpの設定 (/etc/php.ini)

max_execution_time = 1800

Connection reset by peerがnginxのログにある場合、タイムアウト時間を疑うといい。

2013/07/21 09:29:16 [error] 7746#0: *3569 recv() failed (104: Connection reset b
y peer) while reading response header from upstream, client: xxx.xxx.xxx.xxxx, ser
ver: www.webtechlogy.net, request: "GET /sample/upload-cn.php HTTP/1.0", upstrea
m: "fastcgi://127.0.0.1:9000", host: "www.xxxx.net"

コメントは受け付けていません。