Could not obtain cron lock - Digests
Re: Could not obtain cron lock
If I set the cron at 15 * * * * then wouldn't all the processes just run at :15 causing the same potential lack of resources? No different than running at :00
I am exploring a way of temporally separating the run of the Digest from all the other typical core processes of the forum such as tidy_sessions. I understand that many core processes are set to auto, but some must be set to run at a particular time such as :00 or once an hour, just like the digest, which may be causing some resource issues.
However, I'm not even sure if this is an issue. Just brainstorming.
I am exploring a way of temporally separating the run of the Digest from all the other typical core processes of the forum such as tidy_sessions. I understand that many core processes are set to auto, but some must be set to run at a particular time such as :00 or once an hour, just like the digest, which may be causing some resource issues.
However, I'm not even sure if this is an issue. Just brainstorming.
-
- Registered User
- Posts: 132
- Joined: Sun Aug 09, 2020 11:52 am
Re: Could not obtain cron lock
That is certainly possible, indeed likely. Anything queued to start as a cron could start when the cron is invoked. There is no built in way to say "start this cron but not that cron" that I am aware of.
Need phpBB services or a phpBB consultant? I offer most phpBB services. Getting lost managing phpBB? Buy my book, Mastering phpBB Administration. Covers through phpBB 3.3.7. eBook and paper versions available.
-
- Registered User
- Posts: 4933
- Joined: Fri Aug 02, 2002 12:36 am
- Location: Florence, MA USA
Re: Could not obtain cron lock
Thank you Mark for all your help! I have learnt so much from our discussions over the years.
-
- Registered User
- Posts: 132
- Joined: Sun Aug 09, 2020 11:52 am
Re: Could not obtain cron lock
Need phpBB services or a phpBB consultant? I offer most phpBB services. Getting lost managing phpBB? Buy my book, Mastering phpBB Administration. Covers through phpBB 3.3.7. eBook and paper versions available.
-
- Registered User
- Posts: 4933
- Joined: Fri Aug 02, 2002 12:36 am
- Location: Florence, MA USA
Re: Could not obtain cron lock
Mark, we are having this unrelated issue
viewtopic.php?p=16014079#p16014079
1. In your opinion, should we try the database fix, or would it be better to upgrade to 3.3.12 rc1?
2. Would that database fix work? Does it have to be field 20?
3. Is 3.3.12 rc1 suitable for a live board?
viewtopic.php?p=16014079#p16014079
1. In your opinion, should we try the database fix, or would it be better to upgrade to 3.3.12 rc1?
2. Would that database fix work? Does it have to be field 20?
3. Is 3.3.12 rc1 suitable for a live board?
-
- Registered User
- Posts: 132
- Joined: Sun Aug 09, 2020 11:52 am
Re: Could not obtain cron lock
This appears to be unrelated so I'm not inclined to do an analysis, sorry.
Need phpBB services or a phpBB consultant? I offer most phpBB services. Getting lost managing phpBB? Buy my book, Mastering phpBB Administration. Covers through phpBB 3.3.7. eBook and paper versions available.
-
- Registered User
- Posts: 4933
- Joined: Fri Aug 02, 2002 12:36 am
- Location: Florence, MA USA
Re: Could not obtain cron lock
Hi Mark
Just FYI, I looked into the 'tidy_sessions' task https://area51.phpbb.com/docs/code/3.2. ... sions.html
and the timing can be set here But I have noticed that the exact time the 'tidy_sessions' task is run varies a lot in one day, even though it's set to run every 60 minutes on our board. I have also noticed that even just today the digest failed and the cron was locked when 'tidy_sessions' ran at :00
I suspect this is a resource issue.
Any thoughts on how to prevent these two tasks (digests and 'tidy_sessions') from running at the same minute? I understand that that is the entire purpose of the cron lock, but is it possible to prevent the 'tidy_sessions' task from running at :00? Your digest runs at exactly :00 so there must be some way to force an exact time of task execution. Just brainstorming.
Just FYI, I looked into the 'tidy_sessions' task https://area51.phpbb.com/docs/code/3.2. ... sions.html
and the timing can be set here But I have noticed that the exact time the 'tidy_sessions' task is run varies a lot in one day, even though it's set to run every 60 minutes on our board. I have also noticed that even just today the digest failed and the cron was locked when 'tidy_sessions' ran at :00
I suspect this is a resource issue.
Any thoughts on how to prevent these two tasks (digests and 'tidy_sessions') from running at the same minute? I understand that that is the entire purpose of the cron lock, but is it possible to prevent the 'tidy_sessions' task from running at :00? Your digest runs at exactly :00 so there must be some way to force an exact time of task execution. Just brainstorming.
-
- Registered User
- Posts: 132
- Joined: Sun Aug 09, 2020 11:52 am
Re: Could not obtain cron lock
I haven't tried it, but the article below describes a way that looks like it should work to cause a cron to start at the second wanted.
https://www.tecmint.com/run-cronjob-every-x-seconds/
https://www.tecmint.com/run-cronjob-every-x-seconds/
Need phpBB services or a phpBB consultant? I offer most phpBB services. Getting lost managing phpBB? Buy my book, Mastering phpBB Administration. Covers through phpBB 3.3.7. eBook and paper versions available.
-
- Registered User
- Posts: 4933
- Joined: Fri Aug 02, 2002 12:36 am
- Location: Florence, MA USA
Re: Could not obtain cron lock
Very interesting, but what I really need is a way to prevent a task from starting at a certain time or restrict it to certain times.
How do you make your Digest only run at :00? Can you do the opposite? ie. make it run at any time except :00?
I see this in admin log
To my untrained eye, this does not seem like excessive resource usage. So what is happening when the 'tidy_sessions' task wants to run at the same minute?
Should I program the server cron for 0,1,5,10,15,20,25,30,35,40,45,50,55? Can 'tidy_sessions' wait one minute without locking up?
How do you make your Digest only run at :00? Can you do the opposite? ie. make it run at any time except :00?
I see this in admin log
So, a typical Digest for us runs less than 5 seconds. I have balanced the load over 8 hours overnight, no hour has more than 70 digests.Emailed digests for date 2024-05-31 hour 22 UTC. Execution time: 4.64 of 0 allowed seconds. 66.25 MB of memory was used. A total of 68 digests were emailed
To my untrained eye, this does not seem like excessive resource usage. So what is happening when the 'tidy_sessions' task wants to run at the same minute?
Should I program the server cron for 0,1,5,10,15,20,25,30,35,40,45,50,55? Can 'tidy_sessions' wait one minute without locking up?
-
- Registered User
- Posts: 132
- Joined: Sun Aug 09, 2020 11:52 am
Re: Could not obtain cron lock
You ask a question I can't answer.
Need phpBB services or a phpBB consultant? I offer most phpBB services. Getting lost managing phpBB? Buy my book, Mastering phpBB Administration. Covers through phpBB 3.3.7. eBook and paper versions available.
-
- Registered User
- Posts: 4933
- Joined: Fri Aug 02, 2002 12:36 am
- Location: Florence, MA USA
Re: Could not obtain cron lock
Hi Mark, I sent you an email regarding an update. Hope all is well.
-
- Registered User
- Posts: 132
- Joined: Sun Aug 09, 2020 11:52 am
Re: Could not obtain cron lock
I hope to get to it later today.mikeinthe852 wrote:Hi Mark, I sent you an email regarding an update. Hope all is well.
Need phpBB services or a phpBB consultant? I offer most phpBB services. Getting lost managing phpBB? Buy my book, Mastering phpBB Administration. Covers through phpBB 3.3.7. eBook and paper versions available.
-
- Registered User
- Posts: 4933
- Joined: Fri Aug 02, 2002 12:36 am
- Location: Florence, MA USA
Re: Could not obtain cron lock
It's been almost 3 weeks with this code, and no further issues with a cron lock. I will update as things progress, but so far so good!Should I program the server cron for 0,1,5,10,15,20,25,30,35,40,45,50,55?
-
- Registered User
- Posts: 132
- Joined: Sun Aug 09, 2020 11:52 am
Re: Could not obtain cron lock
Hello mikeinthe852,
I am having the same problem as you had mentioned where the cron is failing. Please could you advise how you have solved this problem?
I am having the same problem as you had mentioned where the cron is failing. Please could you advise how you have solved this problem?
-
- Registered User
- Posts: 1
- Joined: Fri Aug 30, 2024 9:41 am