Cron problems with site - Jamming up and being suspended by my host

Discussion in 'PHP' started by AoP, Jul 23, 2011.

  1. #1
    Hi folks.

    I have a cron problem with my wordpress 3 site.
    My host has suspended the site several times int he past becuase it was using too many resources on the server. I have a feeling its an old piece of code ot something but I havent a clue as to how to find it.

    At present I have disabled cron jobs completely.
    But would like to sort out the problem rather than masking it.

    Has anyone any cron expertise who is willing to help me?
     
    AoP, Jul 23, 2011 IP
  2. suryawl

    suryawl Peon

    Messages:
    54
    Likes Received:
    3
    Best Answers:
    1
    Trophy Points:
    0
    #2
    usually the problem with cron is it uses too much resource of the site. i once build a bot and the memory went up to the roof because of bad coding. the memory limit of the program usually 64M

    if you like, i can try to look at your code. :)
     
    suryawl, Jul 23, 2011 IP
  3. w3goodies

    w3goodies Member

    Messages:
    94
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    38
    #3
    Try to set low "Max Execution Time" in PHP because sometimes when you have high MAX EXEC time and also script doesn't close itself like big loops that only close when script exceed its MAX EXEC time. It will take unnecessary cpu usage. Also try to set Cron Timings more efficiently that suits your server. Like if possible change per hour cron to per 5 hours or 1 day and see the result.
     
    w3goodies, Jul 23, 2011 IP
  4. srikanth03565

    srikanth03565 Greenhorn

    Messages:
    5
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    11
    #4
    use a cron job like that it reads specific table which contains specific action and parameters and based on that action it will executes best option is write a shell program for this
     
    srikanth03565, Jul 24, 2011 IP
  5. exodus

    exodus Well-Known Member

    Messages:
    1,900
    Likes Received:
    35
    Best Answers:
    0
    Trophy Points:
    165
    #5
    You should hire a programmer to go through the code that is being ran by the cron events and ask for them to clean up the code and manage the memory issues by reducing the memory being used for you. It could be php, to much being ran, the run time could be to long, mostly I find the major thing that get ppl into trouble is SQL calls. Sites like this one if they did not redo and off load the resources then they would be over powered.

    Also, you might look into off loading to another server, getting a vpn or your own server to run your websites.
     
    exodus, Jul 24, 2011 IP