I had two long running routines. One recover data from 500 public servants, the other many government pages to verify which one is using CMS.
Until last December, everything was allwright. But I decided to change the host, and then I got this:
"Gateway Timeout
The gateway did not receive a timely response from the upstream server or application."
I don't want to come back to my old host, and the new one said that I need to change to a bigger and expensive plan to change settings like timeout, waht is not a option either.
I tried flush() and ob_flush(), nothing changed.
Long running routine x time out
Forum rules
Please use the mailing list here: http://groups.google.com/group/joomla-dev-general rather than this forum.
Please use the mailing list here: http://groups.google.com/group/joomla-dev-general rather than this forum.
-
RSLyra
- Joomla! Intern

- Posts: 89
- Joined: Fri Oct 08, 2010 6:19 pm
- Location: Brasilia, Brazil
- Contact:
Long running routine x time out
Last edited by imanickam on Mon Mar 20, 2017 3:27 am, edited 1 time in total.
Reason: Moved the topic from the forum General Questions/New to Joomla! 3.x to the forum Joomla! 3.x Coding
Reason: Moved the topic from the forum General Questions/New to Joomla! 3.x to the forum Joomla! 3.x Coding
- Webdongle
- Joomla! Master

- Posts: 32233
- Joined: Sat Apr 05, 2008 9:58 pm
Re: Long running routine x time out
You get what you pay for
Member of Joomla bugsquad
http://www.weblinksonline.co.uk/
http://www.weblinksonline.co.uk/tutoria ... lhost.html
http://www.weblinksonline.co.uk/
http://www.weblinksonline.co.uk/tutoria ... lhost.html
-
RSLyra
- Joomla! Intern

- Posts: 89
- Joined: Fri Oct 08, 2010 6:19 pm
- Location: Brasilia, Brazil
- Contact:
Re: Long running routine x time out
Thanks. Very helpfull.
- ranwilli
- Joomla! Master

- Posts: 18836
- Joined: Sun Feb 19, 2006 6:47 pm
- Location: Toledo, OH
- Contact:
Re: How to do a long time running routine?
Talk to your host...
Last edited by imanickam on Mon Mar 20, 2017 3:25 am, edited 1 time in total.
Reason: Merged the responses with the topic f=706&t=948170
Reason: Merged the responses with the topic f=706&t=948170
- toivo
- Joomla! Exemplar

- Posts: 8159
- Joined: Thu Feb 15, 2007 5:48 am
- Location: Nottingham, UK
- Contact:
Re: How to do a long time running routine?
You can use the sleep() function every now and then in your script to give slices of CPU time to other processes.
Ref. http://php.net/manual/en/function.sleep.php
Ref. http://php.net/manual/en/function.sleep.php
Toivo Talikka, Global Moderator
my first programs were assembled and run in 16KB
http://archive.computerhistory.org/resources/text/GE/GE.GE-115SystemSoftware.1967.102646096.pdf#zoom=100
my first programs were assembled and run in 16KB
http://archive.computerhistory.org/resources/text/GE/GE.GE-115SystemSoftware.1967.102646096.pdf#zoom=100
-
RSLyra
- Joomla! Intern

- Posts: 89
- Joined: Fri Oct 08, 2010 6:19 pm
- Location: Brasilia, Brazil
- Contact:
Re: Long running routine x time out
Hi Toivo.
My problem is to not publish anything in a long time, so I got a Timeout.
So, sleep() is not the point.
And memory don't look to be the problem.
Tahnks
My problem is to not publish anything in a long time, so I got a Timeout.
So, sleep() is not the point.
And memory don't look to be the problem.
Tahnks
- toivo
- Joomla! Exemplar

- Posts: 8159
- Joined: Thu Feb 15, 2007 5:48 am
- Location: Nottingham, UK
- Contact:
Re: Long running routine x time out
If your script takes a long time to run in general, the sleep() function effectively prevents timeouts caused by the script exceeding the processing time limit in PHP, set by the directive max_execution_time in php.ini, over which you do not have any control in a shared server environment.
On the other hand, if your script has to wait for a response from another server and the response takes a long time or never arrives, it is up to the developer to configure the call making the request with proper timeouts and then do the error handling, including retries, where the sleep() function could also be useful.
On the other hand, if your script has to wait for a response from another server and the response takes a long time or never arrives, it is up to the developer to configure the call making the request with proper timeouts and then do the error handling, including retries, where the sleep() function could also be useful.
Toivo Talikka, Global Moderator
my first programs were assembled and run in 16KB
http://archive.computerhistory.org/resources/text/GE/GE.GE-115SystemSoftware.1967.102646096.pdf#zoom=100
my first programs were assembled and run in 16KB
http://archive.computerhistory.org/resources/text/GE/GE.GE-115SystemSoftware.1967.102646096.pdf#zoom=100
-
RSLyra
- Joomla! Intern

- Posts: 89
- Joined: Fri Oct 08, 2010 6:19 pm
- Location: Brasilia, Brazil
- Contact:
Re: Long running routine x time out
"another server response" is just the case.
I scrap site to get information. One routine collect information about 500 public servants. The other open 1600 government sites (pages) to check if they are using some kind of CMS.
I scrap site to get information. One routine collect information about 500 public servants. The other open 1600 government sites (pages) to check if they are using some kind of CMS.
-
RSLyra
- Joomla! Intern

- Posts: 89
- Joined: Fri Oct 08, 2010 6:19 pm
- Location: Brasilia, Brazil
- Contact:
Re: Long running routine x time out
But I will do a small test with sleep().
-
RSLyra
- Joomla! Intern

- Posts: 89
- Joined: Fri Oct 08, 2010 6:19 pm
- Location: Brasilia, Brazil
- Contact:
Re: Long running routine x time out
Sleep didn't work.
Return to “Joomla! 3.x Coding”
Who is online
Users browsing this forum: No registered users and 1 guest
