The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

clamscan High CPU Usage

Discussion in 'General Discussion' started by osirion, Feb 19, 2016.

  1. osirion

    osirion Active Member

    Joined:
    Jan 16, 2007
    Messages:
    28
    Likes Received:
    1
    Trophy Points:
    3
    Hey guys,
    I have an issue where clamscan is using a bunch of CPU most of the day, eg:
    13487 root 30 10 422m 333m 8640 D 78.2 8.7 2:15.63 clamscan


    Checking out: vim /etc/cron.daily/manual_clamscan shows >
    for i in `awk '!/nobody/{print $2 | "sort | uniq" }' /etc/userdomains | sort | uniq`; do /usr/local/cpanel/3rdparty/bin/clamscan -i -r /home/$i 2>>/dev/null; done >> /root/infections&

    (which is the same as the recommended: Configure ClamAV Scanner - Documentation - cPanel Documentation)
    for i in`awk'!/nobody/{print $2 | "sort | uniq" }'/etc/userdomains| sort| uniq`; do/usr/local/cpanel/3rdparty/bin/clamscan-i -r /home/$i 2>>/dev/null; done>> /root/infections&


    Also, checked exim advanced editer and av_scanner is set to clamd:/var/clamd


    I do the check to see if clamd is installed:
    # whereis clamd
    clamd:

    So:
    1) To my understanding, clamd isnt even installed though clamav is?
    2) How do I change from clamav/clamscan to clamd so that I lower my CPU usage?

    Thanks in advance :)
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    648
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

    Per our documentation, if you use scripts that expect ClamAV binaries in the /usr/local/bin directory, create symbolic links with the following commands:

    Code:
    ln -s /usr/local/cpanel/3rdparty/bin/clamscan /usr/local/bin/clamscan
    ln -s /usr/local/cpanel/3rdparty/bin/freshclam /usr/local/bin/freshclam
    The "clamd" binary is located at:

    /usr/local/cpanel/3rdparty/bin/clamd

    To lower CPU usage, I suggest simply disabling the "clamscan" cron job you have configured.

    Thank you.
     
  3. osirion

    osirion Active Member

    Joined:
    Jan 16, 2007
    Messages:
    28
    Likes Received:
    1
    Trophy Points:
    3
    Thanks cPanelMichael.
    I am not looking to disable the clamscan cronjob because this is what scans my server daily for viruses and I dont want to leave my server at risk.

    How do I change from 'clamscan' (which loads the 'virus db' each time) to 'clamd' which loads it once and hence lowers CPU/memory usage?
     
  4. syslint

    syslint Well-Known Member

    Joined:
    Oct 9, 2006
    Messages:
    249
    Likes Received:
    6
    Trophy Points:
    18
    Location:
    India
    cPanel Access Level:
    Root Administrator
    Twitter:
    clamd is a daemon and clamscan is a command line tool.
     
  5. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    648
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

    I believe you may have misinterpreted some documentation. These are not two separate applications, but rather "clamscan" is part of ClamAV, as mentioned in the previous post.

    Thank you.
     
Loading...

Share This Page