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.

stats_log problem

Discussion in 'General Discussion' started by Dzmitry, Jun 8, 2005.

  1. Dzmitry

    Dzmitry Registered

    Joined:
    Apr 5, 2005
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Hi all,
    I have a problem whith my stats_log - it's become 6Gb, but I remove it every weekend.
    So, I think, there are some errors with webalizer, because all lines in ststs_log looks like the same:

    webalizer in free(): warning: page is already free
    webalizer in free(): warning: chunk is already free
     
    #1 Dzmitry, Jun 8, 2005
    Last edited: Jun 9, 2005
  2. bijo

    bijo Well-Known Member

    Joined:
    Aug 21, 2004
    Messages:
    475
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    India
    Hello,

    Try the scripts
    ------------------------
    /scripts/runweblogs
    ------------------------

    Let me know the status.
     
  3. sjackson909

    sjackson909 Well-Known Member

    Joined:
    Jun 8, 2004
    Messages:
    113
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Columbus, OH
    Running into the same problem here. All tho my log files are 30+ G's. Any one have a resolve? The last resolve did not help.

    Thanks
    -Seth
     
  4. hansmiddelhoek

    Joined:
    Sep 8, 2003
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    1
    Same problem on two of our servers. I wrote a script for it. When stats_log is too big we run this script. Removing stats_log is not the only thing, you also need to kill the webalizer process (and restart apache?). Also you need to kill all perl instances because perl leaves open files on your /usr partition. You can see it with lsof.
    Code:
    #!/bin/sh
    # File:         webalizer-kill.sh
    # Author:       Hans Middelhoek
    #
    # Server type:  cPanel servers, maybe only FreeBSD
    #
    # Actions:
    # 1. Killing all WebAlizer processes
    # 2. Remove /usr/local/cpanel/logs/stats_log
    # 3. Just wait a minute before restarting while load will get more stable
    # 3. Restarting HTTPD
    #
    # Reason:
    # stats_log is getting big because of a jammed webalizer process
    # /usr partition is full and server is responding slow
    
    killall webalizer
    killall perl
    echo "All webalizer and PERL processes are killed, see below:"
    echo "Start of ps ax | grep webalizer"
    ps ax | grep webalizer | grep -v grep
    echo "End of ps ax | grep webalizer"
    sleep 1
    echo -n ". "
    sleep 1
    echo -n ". "
    sleep 1
    echo -n ". "
    sleep 1
    echo -n ". "
    sleep 1
    echo -n ". "
    sleep 1
    echo -n ". "
    sleep 1
    echo ". WebAlizer is killed"
    
    echo "Size of stats_log"
    ls -lh /usr/local/cpanel/logs/stats_log
    echo "Disk space used on /usr"
    df -h | grep usr
    sleep 4
    rm -f /usr/local/cpanel/logs/stats_log
    echo "Removed /usr/local/cpanel/logs/stats_log"
    touch /usr/local/cpanel/logs/stats_log
    echo "Please standby while load is getting stable again"
    sleep 50
    /scripts/restartsrv httpd
    sleep 5
    echo "Everything went fine, maybe you want to check if disk space is ok now"
    df -h | grep usr
    echo "There should be space enough now on the /usr partition"
    
    You can also schedule this every night or early in the morning. After the recalculation of the stats. Maybe 7:00 AM.

    I don't know why it's happening, but the script works.
     
Loading...

Share This Page