• Resolved brandy_e456

    (@brandy_e456)


    Wow. I’m not sure what to do. I am waiting for them to reactivate it. I use Postie and Wp-Cron to trigger Postie. However, I think my problem is it’s checking too often.

    I had it set to check every 30 minutes (I assume that’s what it’s doing.). This is too much for my host. I don’t know how to just make it check hourly besides change the 30 minutes (which was formerly 15 minutes) to 60.

    Wp-Cron claims that I’m supposed to have an option to have it check every 15 minutes or every hour. Where the hell is it?

    I know nothing about PHP everything I’ve learned is from mostly guessing, a little reading and next to no help. (because everyone I talked to looks at me like I’m stupid when I start talking about my problem.)

    I run a mobile blog to email from my hiptop. I learned about my webhosting is that they don’t offer cron jobs so there’s no way I can run them. (making this more frustrating.)

    I have managed to get WP-Cron to trigger Postie but it’s using too much of my CPU usage? I’m not sure what it all means. I just need some advice of what my next move should be? (and please don’t tell me to change my host. because that’s a consideration I’ve given but I want to give it every opportunity before I change.)

    Oh! and my host pretty much won’t tell me what exactly is making my system overload that I have to figure out it myself. I am just assuming it’s wp-cron. It’s AWESOME.

    I apologize for my rambling I’m just so frustrated and I’m about to pull my hair out because I am not a techie and I need help really badly.

Viewing 15 replies - 1 through 15 (of 18 total)
  • Thread Starter brandy_e456

    (@brandy_e456)

    Any help would be awesome.

    Moderator Samuel Wood (Otto)

    (@otto42)

    www.ads-software.com Admin

    It would help if you said how, exactly, you got Postie to work with wp-cron in the first place. If you have Postie + Cronless Postie + WP-Cron all activated, then it should “just work” and check only once every 15 minutes, max. No PHP editing required whatsoever. In this case, you also should not need to add the extra line to your RSS feeds, like the Cronless Postie plugin suggests.

    So, what exactly did you do? How did you make it work at 30 minutes instead of 15? My guess is that whatever you did, it’s checking every time instead of only occassionally, which is why your host is complaining at you.

    Thread Starter brandy_e456

    (@brandy_e456)

    In WP-Cron. I went and changed the bottom line codes to trigger Postie. Because doing what the read me says results in nothing happening. or atleast in all my tries.

    “//////////////////////////
    // these execute the various hooks
    function wp_cron_30_exec() {
    file_get_contents(‘https://www.domain.com/wp-content/plugins/postie/get_mail.php’);
    do_action(‘wp_cron_30’);
    }

    function wp_cron_hourly_exec() {
    file_get_contents(‘https://www.domain.com/wp-content/plugins/postie/get_mail.php’);
    do_action(‘wp_cron_hourly’);
    }

    function wp_cron_daily_exec() {
    file_get_contents(‘https://www.domain.com/wp-content/plugins/postie/get_mail.php’);
    do_action(‘wp_cron_daily’);
    }
    ?>”

    Well…I changed the 15 to 30 minutes or what I thought would be.

    “if ($wp_cron_now > ($wp_cron_daily_lastrun + 86400)) {
    update_option(‘wp_cron_daily_lastrun’, $daily);
    add_action(‘shutdown’, ‘wp_cron_daily_exec’);
    }
    if ($wp_cron_now > ($wp_cron_hourly_lastrun + 3600)) {
    update_option(‘wp_cron_hourly_lastrun’, $hourly);
    add_action(‘shutdown’, ‘wp_cron_hourly_exec’);
    }
    if ($wp_cron_now > ($wp_cron_30_lastrun + 1800)) {
    update_option(‘wp_cron_30_lastrun’, $wp_cron_now);
    add_action(‘shutdown’, ‘wp_cron_30_exec’);
    }”

    I am not sure if I did this wrong or what. 0_o I just want it to check occasionally and not cause system overload. This stuff is my somewhat educated guessing from any reading I’ve been doing. I only run WP-Cron, Postie and Cronless Postie. If I try to run any other wp-cron plugin thingy they have included it will not work at all.

    Sorry for not being clear. I’m very new to this.

    Moderator Samuel Wood (Otto)

    (@otto42)

    www.ads-software.com Admin

    Well, there’s nothing inherently wrong with doing it that way except that it’s a bit poor form.

    If you want my suggestion, you should put the original WP-Cron file back (and thus erase your changes). Then make sure you have these plugins all activated:
    WP-Cron
    Postie
    Cronless Postie

    That should be all that is really needed. If you look towards the bottom of the cronless postie code, you’ll see this bit of code:
    if (function_exists("wp_cron_init")) {
    add_action('wp_cron_15', 'check_postie');
    }

    That is what triggers it to check postie every 15 minutes. No special changes needed, no hacking the PHP code… No real chance of error. And it’ll work fine with other WP-Cron stuff as well, because it’s using the action hook correctly. With your own changes and the cronless postie action hook, you might even be checking multiple times, which you definitely don’t want. Take your changes back out.

    If you still want to change it from 15 minutes to 30, the *only* thing you have to change is the number 900 to 1800. The rest of it is just identifiers, you don’t actually have to make the “15” into a “30”. The 15 stuff will only run on 30 minutes intervals instead.

    Or if you want to run postie hourly instead, then you can change that line in cronless postie to read:
    add_action('wp_cron_hourly', 'check_postie');
    and you’re done. No effort at all.

    BTW, if your host continues to tell you that you’re exceeding CPU time without actually explaining how or why, then I’d seriously just switch hosts.

    Thread Starter brandy_e456

    (@brandy_e456)

    “Your account has been blocked for system overload. You have used
    >> more CPU usage than allowed and for this reason it has been
    >> blocked.
    >> Now, I have activated your account again and please, make sure the
    >> case will not happen again.
    >> Thank you for choosing our services!”

    WTF kinda explanation is that? THANKS. So..I sent an email saying I’m not completely sure what it is…I think it’s so and so..but I’m not sure…(And I didn’t even mention the fact I don’t know what to look for in too much CPU usage on a server? Is there any way to see that?)

    “I am sorry but we do not provide support for custom scripts and site
    debugging for our users. Unfortunately you will have to find a
    solution without our help in this case. I may suggest you to ask our
    forum members for a possible solution. There are a lot of people who
    may help, I think.”

    So. I came here. Because I didn’t want to go and talk about wordpress problems on my webhosting forum.

    But yeah. Now I’m locked out AGAIN because I don’t know when I am using too much CPU usage and therefore, I am locked out. I contacted them using the same email early this morning and got no response.

    So yes. I am going to try this to see what happens. It just sucks because I don’t totally understand PHP so I’m changing things and hoping it works. Good lord this has been a big deal of trouble. I hate the waiting game with my host. So yeah if I ever get reactivated I’m going to definitely change hosts.

    Thread Starter brandy_e456

    (@brandy_e456)

    Okay. I did everything you said. I put it on 15 minutes on the cronless…but now…nothing happens.

    What am I doing wrong? My site is up again though.

    https://www.brandyengle.com/

    Moderator Samuel Wood (Otto)

    (@otto42)

    www.ads-software.com Admin

    I don’t have any explanation for why it’s not working for you. That sort of thing works fine for me.

    It could be that the Cronless Postie plugin loads before wp-cron does, which would cause it to not set the wp-cron stuff properly. That could be worked around like so:

    In Cronless Postie, change this:
    if (function_exists("wp_cron_init")) {
    add_action('wp_cron_15', 'check_postie');
    }

    to this:
    function setup_wp_cron_postie()
    {
    if (function_exists("wp_cron_init")) {
    add_action('wp_cron_15', 'check_postie');
    }
    }
    add_action('plugins_loaded', 'setup_wp_cron_postie');

    That will force it to wait for the other plugins to load first, and ensure that wp-cron is loaded before cronless postie tries to hook into it.

    There is one other option. Set up some entirely different computer to hit the Postie link once every so often. I mean, your original solution above would have worked okay and should not have caused any CPU time issues. I’d say that your host just sucks, really.

    Basic thought:

    If your host doesn’t offer cron, this has a reason. The most common reason for this is crowding the server: too many sites/accounts for the ressources of that server.

    That usually does not mean – nowadays – harddisk space (which comes cheap these times), it means CPU ressources. You get, as a client, assigned a set percentage of CPU usage, on cheap, overcrowding host setups that’s rarely more than 1% or even less than that. You probably signed for so much (or rather so little) ressources share in your contract.

    If that server is in general low on ressources, 1% of not much may be close to nil. Which is why such hosts forbid cron completely. It’s a real bad sign if a host completely refuses to allow cron jobs. Many will at least concede a nightly/once-a-day cron for security reasons (e.g. backups).

    Now you come along and instigate – with a host and a server forbidding cron – a cron job every 15/30 minutes. It’s only logical that you’ll fast exceed your alotted CPU ressources. You’re very likely in a no-win situation there.

    Thread Starter brandy_e456

    (@brandy_e456)

    Just wondering do you think using a site like webcron.org would cause my site to overload? I’ve tested it and it works but…ummm….I am afraid to let it run. Because of the new thought that was put into my head. I’m looking into new hosts but I wanted to ask this question to see if that was a possiblity without having to move?

    (I hate moving because I’m impatient. haha but I have no problem moving if it’s necessary.)

    It’s disappointing to find out your host is a big pain the ass.

    OH! Btw, if you go the Postie site they say that the cronless postie is not working. It’s listed as an open issue. Oh well.

    Hi again,

    I’ve no idea. As far as I can tell they will call the script of your site and do the cron themselves.

    Whether or not this adds to your ressources allotment depends on the script called and what the rest of your WP “spends” of the ressources.

    My guess (no way to ascertain that except by your host himself) is that your WP account already taxes your ressources limit and that any regularly executed script may tip the scale on the wrong side.

    Best is to ask your host for specific data, if he monitors ressources he should be able to provide those for you, including what eats most of the ressources. He ought to also – at least when heads-on asked – tell you how much (allotment) of how many (ressources) he actually gives each user on that specific server/machine.

    With these data you ought to make an educated guess as to whether or not you’d better change hosts. If you’re already without that cronjob closely shaving the top of your limit, and your site isn’t yet fully built, then you’d truly better pack your suitcases. You’re not going to be overhappy with that host for a long time then.

    One tip: ask ahead of signing up about such stuff, and beware of overly cheap hosts. It’s my experience that you get what you pay for, and anything less than an average 5-10 bucks per month usually is a “cheap host” in the negative sense.

    Most of them oversell, but not all of them oversell to the point of disabling anything but straight html.

    Moderator Samuel Wood (Otto)

    (@otto42)

    www.ads-software.com Admin

    Btw, if you go the Postie site they say that the cronless postie is not working. It’s listed as an open issue. Oh well.

    Works for me. ??

    Yeah, you might want to tell us who you’re hosting with, what account level, etc. Hard for us to guess what the system is you are running on.

    The response you got is typical of a ‘low end’ service — they take your money, they shut your account off if it ‘uses too much’ cpu, but never help you figure out the cause. Not to mention, they over-load servers with sites to such a level that anything more than basic HTML already has you near the brink!

    If something is pinging your site every 15 minutes, that shouldn’t be impacting things. Even a complex script. But I don’t know the internals of postie, or what load it might be putting on the server.

    -d

    Thread Starter brandy_e456

    (@brandy_e456)

    100webspace.com. I’m looking into changing the host though. I’m done with them pretty much.
    Apparently I’ve been on the Free with no ads. hah

    Moderator Samuel Wood (Otto)

    (@otto42)

    www.ads-software.com Admin

    See, this is why I always run my own servers whenever possible. No hassles.

    Well, unfortunately many folks can’t afford to run their own servers (either bc running ‘in house’ isn’t feasible, or dedi hosting is too expensive…).

    But, rules of thumb:

    – don’t go with ‘free hosting’.

    – don’t go with a hosting company offering ‘free hosting’. ??

    – you get what you pay for. If you pay around 10/mo, you actually start to get real service. ??

    – I prefer companies who own their datacenter, though I myself don’t currently follow that rule. ?? Sometimes it is better for a company that at least is in the same town or states as the datacenter, but otherwise in a massive, well-maintained center. ??

    Look at dreamhost, site5, others recommended around here. $100/year isn’t too much to reduce headaches…

    -d

Viewing 15 replies - 1 through 15 (of 18 total)
  • The topic ‘System Overload/Postie/Wp-Cron HELP!’ is closed to new replies.