lat9 / gpsf

An update to the previous Numinix version, now supporting Zen Carts 1.5.6 and above (including 1.5.8a) as well as PHP versions 5.6 through 8.2.
GNU General Public License v2.0
2 stars 2 forks source link

Timeouts #13

Closed torvista closed 6 months ago

torvista commented 9 months ago

I have my own update from the previous version of this plugin, before this branch surfaced and have too much invested in that one to contribute to this one yet. But while testing this, there is the same issue that I imagine all will come across regarding memory/timeouts.

Mine can process about 4000 products before hitting a memory limit, so I need to produce three files to cover all my products. On a local pc I can only do about 3000 at a time.

So, a suggestion for a future enhancement would be to produce all the files necessary in one process/from one cron. And for laughs, in all the languages!

lat9 commented 9 months ago

What is the PHP Memory Limit when you're running out? I've got one site that uses 512M and is able to create a feed-file for 15,000+ products in a single shot without issue.

torvista commented 9 months ago

I've got 8161 products and up to 8000 works before getting a Gateway 504 error.

lat9 commented 9 months ago

... and what's the feed's Max Time Limit set to?

torvista commented 9 months ago

Maximum input time:3600 Max execution time (in seconds):300

Seems to fail between 1-2 minutes.

lat9 commented 9 months ago

That 1-2 minutes sounds familiar, that's probably your webhost's server's base timeout causing the Gateway timeout.

I've asked my clients' webhosts to increase that base timeout so that the feed gets generated in a single chunk. Note, too, that the PHP processing has no clue as to what that underlying (and overriding) timeout value is.

torvista commented 6 months ago

Server log showed

2024/02/21 18:03:10 [error] 14935#14935: *47824 upstream timed out (110: Connection timed out) while reading response header from upstream, client: xxx.xxx.xxx.xxx, server: mysite.es, request: "GET /gpsf_main_controller.php?key=&feed=fy_un_tp&limit=8226&offset=0&currency_code=EUR&language_id=2 HTTP/2.0", upstream: "https://xxx.xxx.xxx.xxx:8443/gpsf_main_controller.php?key=&feed=fy_un_tp&limit=8226&offset=0&currency_code=EUR&language_id=2", host: "www.mysite.es", referrer: "https://www.mysite.es/adminfolder/index.php?cmd=gpsf_admin"

This was resolved by increasing the nginx parameter: proxy_read_timeout 90;

to 120. in /etc/nginx/nginx.conf