• Hi there

    The other day, although there’d been no problem of any sort with a Drupal based site sharing a hosting account with 2 add-on domains using WordPress, I suddenly had an alert of resource overuse leading to them being taken offline, showing 508 server error.

    I had not changed anything on them apart from normal updates the day before. It took a long time to identify one of the 3 (WordPress) as being behind this, as taking it offline caused the problem to go away and number of processes and virtual memory use to shoot up, if returned, even in maintenance mode. It was barely possible to do anything, even stay logged in for a few moments as the resource overuse would force them offline every few seconds for about 1.5 days long. For the night, I had to completely take it offline so the others could be online.

    Even disabling all or most of the plugins yesterday and enabling them one by one did not lead to clear results, as the specific plugins I may have considered rogue were not causing problems on the other WordPress site. Also using a database back-up from a month before at first helped and then resource use shot up after a while. Anyway, right now, things have somehow cooled off as yesterday I did not have this debilitating resource use leading to site shutdown and I even restored the original database and resource use has returned more or less to normal, but I read somewhere this is often caused by cron and solved by making it not run automatically but by a script in Cpanel.
    The question is, why was that not an issue before?

    The next step would have been trying to remove all WordPress core + plugin + theme files and replace them, though Wordfence did not show any unusual changed individual files. I would have used the db back-up of a month ago.

    Even if I am not sure what caused this, I decided to disable automatic cron running in wp-config.php (define(“DISABLE_WP_CRON”, true);, placed at the bottom) and use scripts recommended on some sites and in the Cpanel, but something seems not to be ok as the cron daemon reported not being able to open the script location.

    One tutorial recommended:
    /usr/bin/wget -O /dev/null https://www.mydomain.com/wp-cron.php?doing_wp_cron

    Email alert:

    –2018-08-16 18:00:02– https://www.mydomain.com/wp-cron.php?doing_wp_cron
    Resolving http://www.mydomain.com (www.mydomain.com)… xxx.34.xxx.201
    Connecting to http://www.mydomain.com (www.mydomain.com)|xxx.34.xxx.201|:443… connected.
    HTTP request sent, awaiting response… 200 OK
    Length: 0 [text/html]
    Saving to: ‘/dev/null’

    0K 0.00 =0s

    2018-08-16 18:00:04 (0.00 B/s) – ‘/dev/null’ saved [0/0]

    Another tutorial suggested:

    wget -q -O - https://yourdomain.com/wp-cron.php?doing_wp_cron >/dev/null 2>&1

    Email alert:

    Could not open input file: /home/adm12000/mydomain.com/wp-cron.php?doing_wp_cron

    In the Cpanel itself of my web host, they recommend:
    /usr/local/bin/ea-php56 /home/adm12000/domain_path/path/to/cron/script

    So I tried:
    /usr/local/bin/ea-php56 /home/adm12000/mydomain/wp-cron.php?doing_wp_cron

    (because my site is in the folder “mydomain.com”, though NOT sure I get this right) and

    /usr/local/bin/ea-php56 /home/adm12382/https://www.mydomain.com/wp-cron.php?doing_wp_cron (this does not feel right 😉 )

    wget -q -O - https://www.mydomain.com/wp-cron.php?doing_wp_cron >/dev/null
    (for this, which is currently being used: no email alert so I’m not sure it’s running or not)

    So questions:

    1. Specifically for Cpanel, what’s the correct syntax for running cron? I’m not a coding expert, so I request being specific
    2. What other explanation and solution could there be for this sudden resource use surge, as before it turned up 2 days ago, the sites had peacefully co-existed with no similar issue and at least since most of yesterday, Cpanel statistics show this to be in normal ranges, nothing in red or critical .

    As I’m typing this, with ALL plugins running for the culprit site, virtual memory use at 6.66% (136.6MB of 2GB), physical memory 6.06% (total 2GB), number of processes 1%, CPU use reads 0%, I/O 0%, etc.
    At the height of the issue the other day, at least 2 of the above readings where CONSTANTLY in the red, at or towards 100%. Now all is green or mostly, since most of yesterday.

    I would appreciate some help.

    Regards

    • This topic was modified 7 years, 6 months ago by xprt007.
    • This topic was modified 7 years, 6 months ago by xprt007.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Hi Xprt007,

    Would be careful with your site running at 6.66% 😉

    Try using a plugin like WP Control (https://wordpress.org/plugins/wp-crontrol/). This will help you see what plugin is causing the cron jobs and using all the memory.

    I have had sites were plugins have been removed but the cron jobs were still running because they were in the database.

    Let me know how it goes,

    Thanks

    Josh

    Thread Starter xprt007

    (@xprt007)

    Hi there

    Thanks for your response.

    I re-enabled the default WordPress cron function and installed the suggested plugin.

    Would be careful with your site running at 6.66%

    I’m on shared hosting and have no control on these values. That’s all I see in Cpanel readings and these keep varying all day long, like shown below.

    I noted that in the last 2 or so hours as shown in => this screenshot that the resource use is “normal”, what it has generally been, though there are the few times I randomly check been some jumps, though none has led to resource overuse with the sites being taken offline like mentioned above.

    The screenshot in left corner below shows what I was seeing at height of problem where over 11/2 days, I had at least 2 values in those statistics constantly at or around 100% all the time, forcing me to disable this one site so the other 2 could stay online.

    After installing the plugin, => this screenshot shows what I have. I do not know whether that’s normal. Jetpack, which I have had for months seemed to run cron most often.

    Yesterday I removed some disabled plugins I was note actively using + one I was wp rss multi importer, I temporarily deactivated, but I see shown. I have always had it though, for the last couple of years and at the former web host sever with I think less memory, it never caused similar problems.

    I would appreciate your interpretation of the above results.

    One again thank … 🙂

    Maybe remove jetpack and Wordfence for the time being and check to see if they are putting a heavy load on the site.

    I would also check to see if you have any plugins that have not been updated for a while.

    Other than that I don’t think there is much I can suggest without having access to the admin section.

    If you are on a cheap host you also might consider moving to something a little better

    If you’re looking for a simpler cron job solution, you might consider webcron services like easycron.com which will load a specific URL at a given time.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Correct syntax for cron in Cpanel’ is closed to new replies.