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
asked 8 months ago218 views
1 Answer
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
EXPERT
answered 8 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions