Run periodic tasks from system cron

Get help with installation and running phpBB 3.3.x here. Please do not post bug reports, feature requests, or extension related questions here.
User avatar
thecaretaker1
Registered User
Posts: 137
Joined: Tue Dec 30, 2014 8:38 pm

Run periodic tasks from system cron

Post by thecaretaker1 »

I know I'm thick but under Server Settings I'm a bit confused, I have the option to...

Run periodic tasks from system cron: YES or NO

Then it says
When off, phpBB will arrange for periodic tasks to be run automatically. When on, phpBB will not schedule any periodic tasks by itself; a system administrator must arrange for bin/phpbbcli.php cron:run to be run by the system cron facility at regular intervals (e.g. every 5 minutes).

So wanting my phpbb forum to look after the CRON automatically...

Is YES Off and NO On or visa versa?

I may have accidentally changed the setting as I'm getting errors on the server that say:

You have reached the limits within the past 24 hours

You have reached the entry processes (the number of simultaneously running php and cgi scripts, as well as cron jobs and shell sessions) limit 8 times.

I've been months trying to get to the bottom of the issue which happens once a day almost at the same time of night. My forum ran flawlessly for months until 7 April and now every 24 hours I get this error. In my various attempts to lighten the server load I may have changed it from YES to NO without realising.

On a shared server, I seem so restricted to investigate what is causing this.
User avatar
thecaretaker1
Registered User
Posts: 137
Joined: Tue Dec 30, 2014 8:38 pm

Re: Run periodic tasks from system cron

Post by thecaretaker1 »

I've changed it from NO to YES and the forum still seems to be working correctly. :|
User avatar
bonelifer
Community Team Member
Community Team Member
Posts: 3634
Joined: Wed Oct 27, 2004 11:35 pm
Name: William

Re: Run periodic tasks from system cron

Post by bonelifer »

When set to off, phpBB will run the tasks itself. When set to on, it's telling phpBB you'll run the cli script via your system(Operating systems cron) cron instead.
William Jacoby - Community Team
Knowledge Base | phpBB Board Rules | Search Customisation Database
Please don't contact me via PM or email for phpBB support .

phpBB Modders is looking for developers! If you have phpBB experience and want to join us, click here!
User avatar
thecaretaker1
Registered User
Posts: 137
Joined: Tue Dec 30, 2014 8:38 pm

Re: Run periodic tasks from system cron

Post by thecaretaker1 »

So I need to it set to NO (Off) to let the forum manage it?
User avatar
janus_zonstraal
Registered User
Posts: 6616
Joined: Sat Aug 30, 2014 1:30 pm

Re: Run periodic tasks from system cron

Post by janus_zonstraal »

thecaretaker1 wrote: Thu Jun 06, 2024 9:24 pm So I need to it set to NO (Off) to let the forum manage it?
Yes
Sorry! My English is bat ;) !!!
User avatar
thecaretaker1
Registered User
Posts: 137
Joined: Tue Dec 30, 2014 8:38 pm

Re: Run periodic tasks from system cron

Post by thecaretaker1 »

Thank you folks. ;)
mcs
Registered User
Posts: 3
Joined: Tue Dec 10, 2024 5:47 pm

Re: Run periodic tasks from system cron

Post by mcs »

Is there an advantage of using a system cron job instead of letting phpBB handle the cron itself?
User avatar
janus_zonstraal
Registered User
Posts: 6616
Joined: Sat Aug 30, 2014 1:30 pm

Re: Run periodic tasks from system cron

Post by janus_zonstraal »

mcs wrote: Tue Dec 10, 2024 6:07 pm Is there an advantage of using a system cron job instead of letting phpBB handle the cron itself?
If you don't have many visitors it can be handy to use a system cron job.
Sorry! My English is bat ;) !!!
HB
Registered User
Posts: 232
Joined: Mon May 16, 2005 9:30 pm

Re: Run periodic tasks from system cron

Post by HB »

Another difference / advantage is that running the phpBB cron job from the system cron (daemon) is that long-running jobs won't time out. The phpBB cron jobs initiated from a web browser are configured to timeout via max_execution_time in php.ini; it should be set reasonable low to avoid overloading the server with high-cost SQL calls or malicious actors. Since a system cron job is trusted, there's no need to limit its execution time (though you could with set_time_limit() within the php script, just in case).
Dan Kehn
mcs
Registered User
Posts: 3
Joined: Tue Dec 10, 2024 5:47 pm

Re: Run periodic tasks from system cron

Post by mcs »

Ah ok, so the phpBB "cron jobs" run inside of browsers, so they can affect clients or even fail if users join and immediately leave the forum, I guess. And as they need a browser, they won't really run "regularly" on low-frequency sites, so there is no guarantee that they run. So system cron jobs to the jobs server-side instead of client-side and so are much more reliable.

I think I got it now. Please correct me if my assumptions are wrong :)
User avatar
thecoalman
Community Team Member
Community Team Member
Posts: 6533
Joined: Wed Dec 22, 2004 3:52 am
Location: Pennsylvania, U.S.A.

Re: Run periodic tasks from system cron

Post by thecoalman »

mcs wrote: Sat Dec 21, 2024 8:40 pm Ah ok, so the phpBB "cron jobs" run inside of browsers, so they can affect clients...
There is an image tag at the bottom of the page for the cron task, the user is irrelevant. The browser makes the request for the image, server side it does it's thing. I think the browser gets sent a 1px by 1px transparent .gif. It's an old trick often used in the past because cron jobs were not available with shared hosting plans, they usually are now. phpBB uses it because many users may not be able to set it up correctly or in some cases can't.

For one example phpBB queues emails, if there is giant topic with many participants you aren't sending out hundreds of emails in one shot. If however you have low activity forum on private network they could sit there for a while so you would definitely want to use the system cron to send them out in timely manner.
“Results! Why, man, I have gotten a lot of results! I have found several thousand things that won’t work.”

Attributed - Thomas Edison
mcs
Registered User
Posts: 3
Joined: Tue Dec 10, 2024 5:47 pm

Re: Run periodic tasks from system cron

Post by mcs »

Nice, thank you so much for providing technical details about how the browser based job gets started. I appreciate it 👍

Return to “[3.3.x] Support Forum”