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 个月前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则