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
demandé il y a un an321 vues
1 réponse
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
répondu il y a un an

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions