[RFC|Merged] Modular cron

These requests for comments/change have lead to an implemented feature that has been successfully merged into the 3.1/Ascraeus branch. Everything listed in this forum will be available in phpBB 3.1.
Post Reply
User avatar
igorw
Registered User
Posts: 500
Joined: Thu Jan 04, 2007 11:47 pm

Re: [RFC] Modular cron

Post by igorw » Sat Apr 17, 2010 11:51 am

nn- wrote:One thing I'm wondering is why does cron.php need append_sid?
The only reason I can think of is that you can rewrite URLs using an append_sid hook. Other than that it should not be needed.

Small note: class_exists and require are more memory efficient than require_once.

Oleg
Posts: 1150
Joined: Tue Feb 23, 2010 2:38 am
Contact:

Re: [RFC] Modular cron

Post by Oleg » Sat Apr 17, 2010 12:26 pm

eviL3 wrote: Small note: class_exists and require are more memory efficient than require_once.
This is certainly interesting, do you have a url for further reading?

User avatar
nickvergessen
Former Team Member
Posts: 733
Joined: Sun Oct 07, 2007 11:54 am
Location: Stuttgart, Germany
Contact:

Re: [RFC] Modular cron

Post by nickvergessen » Sat Apr 17, 2010 1:23 pm

nn- wrote:
eviL3 wrote: Small note: class_exists and require are more memory efficient than require_once.
This is certainly interesting, do you have a url for further reading?
Pretty much the same what I said about the include_once you used:
viewtopic.php?p=207366#p207366

php is faster in looking up whether a function/class exists, than checking a the filelist of the included files to see whether a file is already included.
Member of the Development-TeamNo Support via PM

Oleg
Posts: 1150
Joined: Tue Feb 23, 2010 2:38 am
Contact:

Re: [RFC] Modular cron

Post by Oleg » Sun Apr 18, 2010 7:52 am

nickvergessen wrote: Pretty much the same what I said about the include_once you used:
viewtopic.php?p=207366#p207366
Not really. eviL3 mentioned memory consumption, your first post gave no reason at all and now you're talking about execution speed.
php is faster in looking up whether a function/class exists, than checking a the filelist of the included files to see whether a file is already included.
My understanding of the issue is *_once functions do symlink resolution via realpath on the filenames they are given, and that accounts for their poor(er) performance. I'm not seeing this behavior on my system though, perhaps it was changed at some point.

What I asked for were links to benchmarks demonstrating the differences or code analysis explaining the difference. I found one post with benchmarks and include took the least amount of memory but the differences were rather miniscule.


Oleg
Posts: 1150
Joined: Tue Feb 23, 2010 2:38 am
Contact:

Re: [RFC] Modular cron

Post by Oleg » Sun Apr 18, 2010 5:52 pm

Update: includes are fixed and *gc* tasks appear to be running via system cron.

Oleg
Posts: 1150
Joined: Tue Feb 23, 2010 2:38 am
Contact:

Re: [RFC] Modular cron

Post by Oleg » Thu May 06, 2010 3:48 am

If anyone wants to help, please test forum pruning via both phpbb cron and system cron.

My testing efforts are on hold until phpbb proving ground is minimally operational, but if it turns out to take too long I will test manually to make the feature cutoff date.

I also want the cron system to be usably documented. Documentation requests and suggestions are welcome.

http://github.com/p/phpbb3/tree/feature/system-cron


Oleg
Posts: 1150
Joined: Tue Feb 23, 2010 2:38 am
Contact:

Re: [RFC] Modular cron

Post by Oleg » Tue Jun 15, 2010 8:35 pm

Is anyone going to bother looking at and maybe committing this code, or have I entirely wasted the time I put into it?

User avatar
igorw
Registered User
Posts: 500
Joined: Thu Jan 04, 2007 11:47 pm

Re: [RFC] Modular cron

Post by igorw » Wed Jun 16, 2010 2:02 pm

nn- wrote:One thing I'm wondering is why does cron.php need append_sid?
Based on the current set of tasks it should not. Perhaps there are tasks that could take care of something session-based, but I cannot really think of a use case.
nn- wrote:If anyone wants to help, please test forum pruning via both phpbb cron and system cron.
How would one test this via system cron? I didn't see any specific code for this, so would it be something like "curl http://localhost/phpBB/cron.php"?

I have brought my copy phpBB up-to-date and merged develop into feature/system-cron, which gives a bit of a better view on github: http://github.com/evil3/phpbb3/compare/ ... ystem-cron
nn- wrote:I also want the cron system to be usably documented. Documentation requests and suggestions are welcome.
The most important would be a little guide explaining how to create cron tasks, then parameterized tasks. I don't really see the need for additional documentation on the internals. They are already commented pretty well. Perhaps there could be some sort of flow chart describing in what order the methods are called (eg. is parse_parameters() called before X?).
nn- wrote:Is anyone going to bother looking at and maybe committing this code, or have I entirely wasted the time I put into it?
I have looked at it several times. I have not yet had time to test it, it does however looks very good. Most certainly by far more clean and extensible, I like it.

Post Reply