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.

High Grep Usage

Discussion in 'General Discussion' started by Jeewhizz, Apr 6, 2004.

  1. Jeewhizz

    Jeewhizz Well-Known Member

    Joined:
    Mar 12, 2003
    Messages:
    51
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    London, England
    Looking at the CPU/MYSQL usage page, we have this running at 75% (in red!)

    root 74.55 4.44 2.0
    Top Process %CPU 99.9 /bin/grep -c [-]> /var/log/exim_mainlog
    Top Process %CPU 98.5 /bin/grep -c [-]> /var/log/exim_mainlog
    Top Process %CPU 88.3 /bin/grep -c < /var/log/exim_mainlog

    Anyone know what is doing this?

    Jee
     
  2. Marty

    Marty Well-Known Member

    Joined:
    Oct 10, 2001
    Messages:
    630
    Likes Received:
    1
    Trophy Points:
    18
    Your exim_mainlog is probably huge. It happens sometime.

    mv /var/log/exim_mainlog /var/log/exim_mainlog.bak

    touch /var/log/exim_mainlog

    And then chown it the same as the exim_mainlog was before you moved it.
     
  3. Jeewhizz

    Jeewhizz Well-Known Member

    Joined:
    Mar 12, 2003
    Messages:
    51
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    London, England
    exim_mainlog is 3.5 mb - its rotated weekly so it can't be that.

    Jee
     
  4. Marty

    Marty Well-Known Member

    Joined:
    Oct 10, 2001
    Messages:
    630
    Likes Received:
    1
    Trophy Points:
    18
    3.5 mb is pretty big, and there is no other reason that grep /var/log/exim_mainlog would be using so many resources. The least you can do at this time is to back up the exim_mainlog as I suggested and try it. I have had this same thing happen on a couple of occasions and the fix I gave you worked every time.
     
  5. net-trend

    net-trend Member

    Joined:
    Sep 17, 2002
    Messages:
    19
    Likes Received:
    0
    Trophy Points:
    1
    This issue crops up on one of our servers very often and is really annonying. Wonder if there's a permanent fix on it.
     
  6. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    3.5mb is not big. One of our servers puts through around 10,000 emails per day and averages around 35mb in size and does not have any problems at all.

    Have you tried establishing which process the grep's belong to? That is, get the pid from top then do a ps axf and look for the processes higher up the thread that contains the grep.
     
Loading...

Share This Page