1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

WP-Cron.php taking up all my processes

Discussion in 'Blogging' started by Mesach, Mar 24, 2010.

  1. Mesach

    Mesach Junior Member

    Joined:
    Oct 1, 2009
    Messages:
    108
    Likes Received:
    39
    Im having an issue on hostgator that i'm pretty sure is going to get me booted, if i cant solve it. wp-cron.php on several of my blogs(not all at the same time) will spawn multiple times eating up all of my 25 or more processes, and if i watch it, they do not go away, the CPU is at 0% and the Memory is at .4-.5%.

    Anyone know what might cause this? and how do you access the cron jobs in wordpress, i dont have any external ones setup inside my cpanel. I just want to have it setup so that if there is one spawned, then do not spawn another until the first one is finished.
     
  2. StormNexxus

    StormNexxus Newbie

    Joined:
    Mar 23, 2010
    Messages:
    5
    Likes Received:
    1
    It could be several things. If you need help with your wordpress blog dont hesitate to contact me. I can be contacted at my site via live help or via contact form. My website is http://www.stormnexxus.com/. Im sure i can figure out some way to help your cron issue... :D
     
  3. jacobus

    jacobus Newbie

    Joined:
    May 15, 2008
    Messages:
    33
    Likes Received:
    28
    I've been having similar problems and got a warning from my hosting co.

    Really want to know if there's a fix for this.
     
  4. scm03

    scm03 Newbie

    Joined:
    Jul 12, 2009
    Messages:
    49
    Likes Received:
    8
    I have 14 ABs on one host and it maxes out at about 7 processes at one time. How many blogs do you have going at the same time that is causing you to max out? I am also interested in a solution because I know I will max out as I keep adding and am not ready to upgrade my hosting.
     
  5. eg33k

    eg33k Regular Member

    Joined:
    Nov 30, 2008
    Messages:
    243
    Likes Received:
    69
    Occupation:
    freelance emarketing ninja.
    Location:
    next door to nirvana
    I found the default settings for my Google Sitemap plugin ate up a lot of resources (due to multiple large AB running it daily) so I made some adjustments that helped.

    I also had to cut back on the number of pings, my pinglist was just too huge. With Caffeinated Content I now set a 3-10 second delay (optional setting) to reduce the pounding on mysql from large scrapes.

    I also reduced the number of database queries generated by the templates by hard coding some of the paths in the header template.

    I also periodically go into phpmyAdmin and optimze all the tables to reduce mysql overhead. This can especially help on large databases on fast growing ABs.

    Another thing, if you crons are trying to run at a time when the server backup processes are running, this can cause issues.

    Watch your error logs (I do this with FTP) in ABs that are flake-in out, this might tell you something important. I also fix, then delete error logs, as they can become large and might slow things down.

    Hope this helps!
     
    • Thanks Thanks x 3
  6. makingfastcash22

    makingfastcash22 Senior Member

    Joined:
    Feb 15, 2009
    Messages:
    1,152
    Likes Received:
    178
    Home Page:
    eg33k are you hosting on hostgator?

    can you share the adjustments you made to google sitemaps?

    ALso if you can explain the process a little about hard coding the templates, would be great.

    I just recently switched over to hostgator from another host because of server load issues.

    I am on a baby plan and it says its "unlimited" , but the inodes thing is a little concerning. I did read somewhere that someone fought them on this and won.

    did you disable your cron.php and use crontabs?

    Thanks
     
  7. makingfastcash22

    makingfastcash22 Senior Member

    Joined:
    Feb 15, 2009
    Messages:
    1,152
    Likes Received:
    178
    Home Page:
    I also just installed the plugin W3 Total Cache to see if this will help as well
     
  8. jacobus

    jacobus Newbie

    Joined:
    May 15, 2008
    Messages:
    33
    Likes Received:
    28

    Thanks, eg33k. Some good practical advice!

    :D
     
  9. Mesach

    Mesach Junior Member

    Joined:
    Oct 1, 2009
    Messages:
    108
    Likes Received:
    39
    well i was getting hammered with spider visits today so i think that is why its happening, for some reason the blog in question got a bunch of feed hits and about 15k spider hits today
     
  10. shareguy

    shareguy Newbie

    Joined:
    Jul 20, 2008
    Messages:
    2
    Likes Received:
    4
    I had similar problem and problem was created by the huge ping list I included in my wordpress blogs. Many of them were dead and wp-cron was trying to contact them again and again and eating the processes. So I limited the ping list to 3-4 and sorted the problem permanently. I saw this solution on one of their forums.
     
  11. nahor

    nahor Junior Member

    Joined:
    Sep 24, 2008
    Messages:
    156
    Likes Received:
    204
    Occupation:
    BHW Lurker
    Location:
    Seven Mile Beach
    This is easy, I had this problem before.

    Turn your cronjobs off to notify you on every time they run. For hostgator, I had a job run every ten minutes and didnt know it was sending emails to my mail. It made for a bunch of cronjobs for every keyword for all those times...

    after your cron jobs add a SPACE then >/dev/null 2>&1

    that turns off notifications...

    hope this was the fix, worked for me. And check your main email which would be the domain you signed up under and the username for the account. I never knew email went to this as an account, it's created when you join hostgator and this is how i found like 40k emails from all these cronjobs...
     
  12. funktrust

    funktrust Regular Member

    Joined:
    Apr 3, 2009
    Messages:
    208
    Likes Received:
    54
    Occupation:
    Cisco Engineer
    Location:
    Sydney
    I was in you possession about 6months ago where I had around 100blogs on 1 dedicated server. Every day when my wp-cron ran my server would crash and I had set the cron for each site with 5min intervals. I was loosing alot of traffic and money... After days of back and forth communication with hostgator and them threatening to suspend my account I finally came up with a plan.

    This is what I did...

    Spread all 100 blogs across 4 reseller accounts so 25 blogs on each. I then set up remote cron services on all blogs. So I would have a php script it calls to via the online cron services once a day and all the processing is on a remote server to access the php script instead of each sites sqldb pushing the script and clogging up the db.

    I also optimized wp with caching, optimized autoblogged, and so many other different things to bring down the processes. AND now I have finally got everything down pat.

    If you need any more help let me know.
     
    • Thanks Thanks x 2
    Last edited: Mar 25, 2010
  13. Mesach

    Mesach Junior Member

    Joined:
    Oct 1, 2009
    Messages:
    108
    Likes Received:
    39
    I'm going to try this as it seems like the most likely answer, i know my pinglist is huge, i got it here from one of the threads.

    its not hostgators cron jobs, its within wordpress somewhere.
     
  14. hankoseo

    hankoseo Newbie

    Joined:
    Jul 11, 2009
    Messages:
    5
    Likes Received:
    0
    Good info there, any specific details would be more than helpful. Any recommendation on the online cron job service, and the php script?
    As said, real good info and more in-depth description would be greatly appreciated. thanks
     
  15. setrox

    setrox Newbie

    Joined:
    Mar 14, 2010
    Messages:
    26
    Likes Received:
    2
    please i need this information too.
     
  16. makingfastcash22

    makingfastcash22 Senior Member

    Joined:
    Feb 15, 2009
    Messages:
    1,152
    Likes Received:
    178
    Home Page:
    Yeah I would like to know this info as well. Also hoping to get details of the settings for google site map generator.

    Thanks
     
  17. funktrust

    funktrust Regular Member

    Joined:
    Apr 3, 2009
    Messages:
    208
    Likes Received:
    54
    Occupation:
    Cisco Engineer
    Location:
    Sydney
    I use a remote service called webcron, they charge like 0.0001 per job I think i have payed them like 5euro and it is still going for months with around 1000 cron jobs a day.

    I use a custom php script that I brought. Best bet is to google what you want your cron to do. My script deletes the contents of a folder that's all. So it all depends on what you want your script to do.
     
  18. eg33k

    eg33k Regular Member

    Joined:
    Nov 30, 2008
    Messages:
    243
    Likes Received:
    69
    Occupation:
    freelance emarketing ninja.
    Location:
    next door to nirvana
    Nope, not on hostgator, sorry. Liquidweb.

    For google sitemap plugin:
    Building mode:
    Rebuild sitemap if you change the content of your blog (unless you are making several updates per hour autoblog updates, but it depends on the quantity of changes) Imagine addin 100 new posts per day on a site with 3,000 posts, and rebuilding your sitemap many times per day; this could eat up some resources. If your AB is really huge you may want to manually rebuild your sitemap once every week or two.

    I write the normal xml file, but not the gzipped file
    I Add sitemap URL to the virtual robots.txt file (ONLY if i don't have a real robots.txt file to start with!)
    Tweak Advanced settings (increase memory limit/execution time/build in background)
    In sitemap content settings I choose only:
    Include homepage
    Include posts
    Include static pages
    Include the last modification time.
    (enabling other, seems to slow down the sitemap generation process as it results n a much bigger file size)

    Change frequencies
    I don't set too many 'Daily' change frequencies,

    Editing dynamic "links" and hardcoding them:
    If you look in Appearance-Editor-header template, you will see there are dynamic database calls used to pull in images, text, links, etc. Sometimes reducing the number of database calls is as easy as hardcoding the paths fro image, links, etc. - IF the usage problem is due to excessive database calls, this might help. This trick can work in the footer as well.

    I don't have much experience with page caching or widget caching plugins, but other have found them to be useful.

    To be honest, I never tried directly editing my cron.php, but setting the timing of your crons to avoid crons running too frequently or when backups or other processes are running (using WP-Crontrol) can help.

    I get the feeling that WP is a bit like Micosuckt, each new update version requires more overhead (I could be wrong) and that some plugins simply do not play nice with certain WP versions.

    I once found that simply changing my Theme made a HUGE difference in one of my ABs. So even Themes are not always optimized for minimal server resource overhead!

    Hope this helps a little more. Good luck!

    -sorry for rambling and typos...
     
    • Thanks Thanks x 3
  19. FreshlyBlended

    FreshlyBlended Registered Member

    Joined:
    Oct 8, 2009
    Messages:
    84
    Likes Received:
    16
    You know you can create a secret subdomain for your domain and copy over all your files from wp-includes and wp-admin and run your cron job from the subdomain... this way the cron can be on a different account on the same host, different server, your computer, or wherever you want. Everything will get updated in ONE database since the config is the same!
     
  20. makingfastcash22

    makingfastcash22 Senior Member

    Joined:
    Feb 15, 2009
    Messages:
    1,152
    Likes Received:
    178
    Home Page:
    Thanks eg33k Rep coming your way!

    I do have one question about this-

    Tweak Advanced settings (increase memory limit/execution time/build in background)

    Does increasing the memory lower the load, and how big should it be?

    Also any suggestions on execution time?

    Thanks once again.