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

Re: Apache and rotating Logs (for each VHost)



At 04:35 PM 8/12/2006 +0200, Michelle Konzack wrote:
>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
>
>    It takes more then 9 minutes (rot.) + 40 minutes (comp.)
>    for arround 5 GByte of logs!!!

If u have that much log data I would do it on a dedicated reporting server.
It's not good to cut into production CPU time.  Have ur web server export
the log directory(ies) via NFS.  Rename the existing log files, have Apache
flush the logs (thereby creating new ones), and have the reporting server
pull them over.  U should really have logrotate do the rotation part.
Another way to do it is have the web server NFS mount to the reporting
server so that the logs are written directly there.  I don't think having
one log file vs. many files makes any difference in terms of processing
them.  If u don't really do anything with them in the first place, ie u just
"keep" them, then going with one common log will make things easier.  Doing
the rename and flush should be near instant.  If ur doing something specific
we could come up with a better solution if u give some more details.

>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)

There are other ways of doing this that don't need so many resources.
Opening 20,000 file handles is NOT the way to do it! =)





--
REMEMBER THE WORLD TRADE CENTER         ---=< WTC 911 >=--
"...ne cede malis"

00000100



Reply to: