Jump to content

Tasks.php bogging down the server?


Recommended Posts

So I have a dedicated server, sure there are other people that I host but I've been trying to figure out why my server always feels so bogged down and it felt like it was slowly getting worse. Well I sat on my server's processes page to find out that tasks.php was taking up significant amounts of my ram and processor. And not bad right? But it wasn't just 1 tasks.php that was running for my forum. Since it runs every minute I have about 20 of these processes running for my site alone taking up 70+% processing time.

What I did to see if this was a problem is I terminated all processes started by my sites account. Low and behold my site went from loading forever to a more snappy and immediate download.

Currently I've deleted the cron tasks and went back to the default method of running it with my traffic (I have enough traffic it SHOULD be fine).

What I'm looking to find out if anyone else has this issue and how they resolve it. The only thing I could think of was to maybe change the cron from running every minute to running every 10-15 minutes.

Note, that I run multiple IPS instances off of this server and none of my smaller/low traffic sites have this problem.

Any insight? Advice?

Link to comment
Share on other sites

Please show the result of following:

crontab -l

and what does the cron log show:

grep CRON /var/log/syslog

BTW, I run multiple IPS forums and WP sites with lot of crons simultaneously (slow, average and high traffic) on different servers but never encountered such issue.

Edited by Lucas James
Link to comment
Share on other sites

No. @bfarber this slowness has existed since 4.4 but it got worse in 4.5. You’ve been in my ACP but I didn’t have any background tasks running. They are regularly cleared out. But even then having tasks.php fire and not complete is detrimental to fire it again. Now you have 2 processes doing the same thing. It just quickly gets exponentially worse.

I don’t even have a super massive community. I’d say 100 average online users (guests and members) on average. 

To be clear. Turning it off made my site load in seconds instead of 30+ visible seconds.

Link to comment
Share on other sites

It's theoretically possible you've hit a PHP bug where the script is not exiting as it should. It's really hard to say from here.

And it's worth mentioning that two tasks running at the same time is not in and of itself an issue. The first execution could be sending notifications and the second could be running a separate (quicker) task manager task. It's ok if they stack a little, particularly when you have background tasks running.

Link to comment
Share on other sites

Just now, bfarber

It's theoretically possible you've hit a PHP bug where the script is not exiting as it should. It's really hard to say from here.

And it's worth mentioning that two tasks running at the same time is not in and of itself an issue. The first execution could be sending notifications and the second could be running a separate (quicker) task manager task. It's ok if they stack a little, particularly when you have background tasks running.

I’d say you’re right. I’d even give it to 3-4 tasks but twenty is excessive.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...