Support » Plugin: All In One WP Security & Firewall » High CPU usage

  • Resolved skarabeq

    (@skarabeq)


    Hello,
    Every morning around 6AM (UTC +3) we have too high CPU usage. Is there some external cron jobs which do this high CPU usage? The automatic change detection scan has been stopped and I have no idea what happens and why at 6 AM we have high CPU usage. If the AIO is deactivated the CPU usage is normal throughout the day. Please advice where is the problem and how can I solve it?

    Thank you!

Viewing 15 replies - 1 through 15 (of 16 total)
  • Plugin Contributor mbrsolution

    (@mbrsolution)

    Hi, try the following plugin to see your cron jobs. This might help you.

    https://wordpress.org/plugins/wp-crontrol/

    Kind regards

    • This reply was modified 10 months, 2 weeks ago by mbrsolution.

    Hi,
    I tried, but nothing happens. Also, I’ve tried to disable AIO and I’ve no high CPU usage. Any suggestions why is this happens?

    Plugin Contributor mbrsolution

    (@mbrsolution)

    Hi,

    What type of server is your site hosted in?

    Thank you

    Hi,
    The website is located on the VM server.

    Plugin Contributor mbrsolution

    (@mbrsolution)

    Hi, sorry for not explaining myself. What are your server specs?

    Thank you

    Hi,
    I have no info about server specs. But after removing the actions from the file all-in-one-wp-security-and-firewall/classes/wp-security-cronjob-handler.php

    do_action('aiowps_perform_scheduled_backup_tasks');
    do_action('aiowps_perform_fcd_scan_tasks');
    do_action('aiowps_perform_db_cleanup_tasks');

    The problem is solved. Before that, I have disabled files scanning from the admin panel, but unfortunately, it isn’t applied as well. I’m not sure only the action aiowps_perform_fcd_scan_tasks is the problem, but I suggest it is the main villain.

    I think this – AIOWPSecurity_Cronjob_Handler->aiowps_hourly_cron_event_handler() cron event is the main reason of the hight CPU usage. About this cron event AIOWPSecurity_Cronjob_Handler->aiowps_daily_cron_event_handler() I saw it hasn’t any code in the body of the method aiowps_daily_cron_event_handler.

    This is happening with the AIO version 4.4.0 and WordPress version 5.2.2.

    • This reply was modified 10 months, 2 weeks ago by skarabeq.
    • This reply was modified 10 months, 2 weeks ago by skarabeq.
    • This reply was modified 10 months, 2 weeks ago by skarabeq. Reason: Information about cron events
    Plugin Contributor mbrsolution

    (@mbrsolution)

    Thank you very much for providing this great information. I have submitted a message to the developers to investigate further your findings.

    Kind regards

    Thank you too!
    If you have any future information about that problem, could you please share with me here? Thank you!

    Kind regards

    Plugin Author wpsolutions

    (@wpsolutions)

    Hi @skarabeq,
    You say that once per day you have high CPU usage.
    Just to confirm, which of the following do you have enabled:
    – file change detection
    – DB Backup >> Automated Scheduled DB backups

    If any of the above are enabled, what is the interval setting for each?

    One of the above tasks is probably being run which may be causing the elevated CPU.
    How does the CPU load look when you disable one or both of above?

    Hi @wpsolutions,
    The file change detection and DB backups are disabled in the admin panel, but I’m not sure they are disabled. If there is some bug, and only it is visual looks like they are disabled, but they aren’t, this is eventual scenario.

    I saw the following cron events:

    Hook name: aiowps_hourly_cron_event
    Action: AIOWPSecurity_Cronjob_Handler->aiowps_hourly_cron_event_handler()
    Recurrence: Onece Hourly

    Hook name: aiowps_daily_cron_event
    Action: AIOWPSecurity_Cronjob_Handler->aiowps_daily_cron_event_handler()
    Recurrence: Once Daily

    Plugin Author wpsolutions

    (@wpsolutions)

    There is one other task which gets checked hourly behind the scenes:
    The plugin will check the tables it created and if they contain more than 5000 rows it will delete the oldest rows.
    The tables checked are:
    wp_aiowps_events
    wp_aiowps_failed_logins
    wp_aiowps_global_meta
    wp_aiowps_login_activity

    The default number of rows (5000) to keep can be changed via one of several filters.
    Additionally the plugin will also check for and delete any expired transients in the options table which may have been created from the captcha feature.

    Having said that, I’m still perplexed as to why you are seeing a high CPU usage only once per day. Perhaps over the course of 24 hours some of the tables mentioned above grow to size larger than 5000 rows and the plugin deletes the oldest rows over 5000.

    Plugin Contributor mbrsolution

    (@mbrsolution)

    Hi, is your issue resolved?

    Thank you

    skarabeq

    (@skarabeq)

    Hi @mbrsolution,
    The issue is resolved. We increased the server resources.

    Plugin Contributor mbrsolution

    (@mbrsolution)

    Thank you. I am sure this will help others.

    Enjoy the plugin.

    Hi,

    I found this thread and have a similar problem, hope its ok that I post it here.

    In our logfiles there is an hourly error like this:

    CRITICAL Allowed memory size of 536870912 bytes exhausted (tried to allocate 8388616 bytes) in /var/www/vhosts/example.com/httpdocs/wp-includes/wp-db.php on line 1973

    I tracked it down to the aiowps_hourly_cron_event, when I pause that (or turn it off), the error dissapears.

    I already updated our version of the plugin from 4.3.4 to 4.4.3, but that didnt help.

    Do you have any suggestions on how to fix this or could you explain why the cron isgenerating this error?

Viewing 15 replies - 1 through 15 (of 16 total)
  • You must be logged in to reply to this topic.