0

Our time out is currently set to 50 seconds. After this time Magento automatically returns a 504 Response Code.

Under normal circumstances this is fine. However, I have developed a page that allows wholesale customers to place orders using a spreadsheet type layout which they can order all items on the store in any quantity. There are around 600 products on this system.

While testing it, I have noticed that when I add a quantity of 1 for every product, the page is timing out as the controller I am sending the data to is taking longer than the 50s.

Is there a way to increase page time out in general, or even better, for specific pages?

Thanks

4 Answers 4

0

I guess that you have using Nginx php-fpm.

You guess that if you have to update max_execution_time ,request_terminate_timeout,fastcgi_read_timeout

You need to update this variable on your server. Please check out some source:

https://stackoverflow.com/questions/45252317/nginx-php-fpm-7-1-504-gateway-time-out

https://stackoverflow.com/questions/24453388/nginx-reverse-proxy-causing-504-gateway-timeout

0

Perhaps you should look at alternative solutions to extending the page timeout value. When dealing with long running functions, sometimes it is better to batch process it by storing the file to process and some marker data as to the last batch processed. Then have a CLI script process the file while your UI calls for updates via AJAX and gives the user updates on progress.

0

I think you're going about resolving it the wrong way, in any case returning no response to a user for 50 seconds is just a bad user experience.

From what I have gathered from your question, you are trying to add products in bulk to the cart. You should make controller handle only one add to cart event at a time and use ajax and recursion to call ajax to loop over all the SKUs to be added. That way the user can get monitor the progress of the process too.

0

You need to change some settings in your php.ini:

upload_max_filesize = 2M 
;or whatever size you want

max_execution_time = 60
; also, higher if you must - sets the maximum time in seconds

Where your PHP.ini is located depends on your system environment. For more information: http://php.net/manual/en/ini.list.php

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.