[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Apache and rotating Logs (for each VHost)



Hello Geeks,

As I was running only about 30-40 VHosts it was realy easy to
rotate the two logs (error and access) for each VHost...  

Now I run into trouble rotation daily logs because it needs to much time
to rotate.  OK, I have tried to rename (!) the log with since

    rename s/access/${DATE}-acc/ $USER/log/apache/access.log

leafe the FD open and not like

    mv -f $USER/log/apache/access.log $USER/log/apache/${DATE}-acc.log

where the FD goes into the nirvana and I lost LOG data. Then after
rotating 8000 logs I have reloaded "apache" and the compressed all
logs.

    It takes more then 9 minutes (rot.) + 40 minutes (comp.)
    for arround 5 GByte of logs!!!

Any suggestions how to do effectiv logrotation for apache?

I am awaiting more then 10.000 VHosts (low traffice) per VServer
where each VHost is a UNIX User with own UID/GID and the
directories are ~/public_html/ and ~/log/apache/.

Any suggestions?

Note1:  Piping the error and access log to a program is no solution
        because the spliting into 20.000 Files takse to many resources.
        (allready tried it with a perl-script provided by someone here)

Note2:  Same for using a database which store the Logs and can exported
        with a SELECT instruction.  5 GByte per day for a PostgreSQL
        are to much (and the most heavy day was over 80 GByte).

Note3:  The Server in Paris is a quad Opteron with 32 GByte of memory
        on a SONET Dual STM-4 but use only optical GBit.

Greetings
    Michelle Konzack
    Systemadministrator
    Tamay Dogan Network
    Debian GNU/Linux Consultant


-- 
Linux-User #280138 with the Linux Counter, http://counter.li.org/
##################### Debian GNU/Linux Consultant #####################
Michelle Konzack   Apt. 917                  ICQ #328449886
                   50, rue de Soultz         MSM LinuxMichi
0033/6/61925193    67100 Strasbourg/France   IRC #Debian (irc.icq.com)



Reply to: