Slow Scheduled Cron Job

#1
I'm not a server admin. I have very little server experience. Any advice I will pass on to my server admin.

I have a vBulletin forum and everything was working fine until we made the switch to litespeed.

My Problem: It seems cron is running slowly. At first I was getting 'Internal Server Errors' which I suspect was timeout errors until my server admin up some settings with litespeed. Now I can run cron and it seems to be working fine. However when it runs when it's scheduled to run it's slow and timesout because cron runs too slowly on it's own.

For example: I watched a scheduled cron as it populated a little over 2000 emails to be sent out. It ran for 10 minutes as that's what my admin has it set for and quit. It was running very slow. It had more to go.

Afterwards I started it and it ran for 4 minutes and populated 3291 emails until it said done. It ran MUCH faster when I did it then when it was scheduled to run.

Some days it will only populate 200-400 emails and stop. And it's supposed to send 3k to 5k emails daily. It's so slow that it times out but if I manually start it it's fast.. what gives?

Any suggestions?
 

NiteWave

Administrator
#2
not sure what's the reason, and not heard of similar issue before.
anyway, please try
lsws web admin->General->External Application Abort:No Abort
to see if any difference
 
#5
So it ran tonight as scheduled. However it seemed to stop when another cron was scheduled to run. I'm changing it so next time other crons won't get in it's way.. maybe it'll run the full 10 minutes instead of stopping at 8..

It runs slowly on it's own but if I do it it runs really quickly. When it is manually started this particular cron will schedule to send out 3k-4k emails however when it runs when it's scheduled to it only does half that in 10ish minutes.. it's maddening.

Maybe I should up the timeout time to 15-20 minutes? My only concern is that doesn't cause server issues/load issues.

Any suggestions welcome.

Thanks!
 

NiteWave

Administrator
#6
>It runs slowly on it's own but if I do it it runs really quickly.
when you run it manually on command line, it runs as root. when it's scheduled to run by cron through vBulletin, it should run as a user or nobody ? non-root user may be restricted by limited resources, for example cloudlinux is in effect.
you can mimic the non-root user when login the server as root.
#sudo -u nobody command-to-run
this can confirm if it's related to non-root quickly.
 
#8
Well.. I was going to report back that it was a success (well it was). This time cron ran very fast and completed without any issues. It ran for 3-4 minutes and 2500 emails were loaded up without any issues. I'm not sure why yesterday and the day before it ran slowly.. very weird.

The ONLY change I made was changed when cron would run.. I changed it to 2:01am instead of 2:02am.. weird..

However a couple hours later the server nearly crashes because a bot tried to register on my forum I suppose hundreds of times and brought the load up to 100+ and things hanged until the forum took things down temporarily.

I suspect this had to do with it: admin->General->External Application Abort:No Abort

While it seemed to help with cron it seems to make attacks more powerful if it's set to "no abort".. at least that's what my admin suspects..

I'm going to disable it and see what happens tomorrow with cron.

I got the server back to normal after maybe 30 minutes. Fun times. :(
 
Top