AWS ec2 instance with php and mysql

0

I am running a php script which fetches through multiple curl requests and updates my database, i have a problem in which due to network delay and delayed responses, the page is timing out and i am getting the gateway timeout error. I have changed the php.ini file and the max_execution time is set to 600 seconds, still the page is timing out in less than 60 seconds

Rahil
質問済み 8ヶ月前230ビュー
1回答
0

Hi,

Increasing max execution time at PHP level won't solve your problem. Your current timeout comes from API Gateway: after 30s, it declares your PHP script unresponsive and returns a timeout to the user.

See https://docs.aws.amazon.com/apigateway/latest/developerguide/limits.html

Maximum integration timeout 30 seconds No

So, your script must respond in less than 30s to avoid this timeout response.

If you can't reduce processing time, you have to change your implementation a bit: run the script in the first request, which return a request id. and then have additional poll requests (initiated by client) supplying the request id to check if completed.

Best,

Didier

profile pictureAWS
エキスパート
回答済み 8ヶ月前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ