Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a cluster of Apache httpd servers. It's a load balanced cluster where all nodes serve the same, shared, content. The content itself is located on a shared storage.

I would like to setup all nodes to log (server access logs) to the same log file (again on the same shared storage), but I am concerned that this would create concurrency problems in a production environment.

Anyone knows a good guide or recommendation for setting up a logging for httpd clusters?

share|improve this question
    
A why may help you get the response you need. What do you want do with the logs? –  Jeremy French May 27 '09 at 10:36

2 Answers 2

up vote 1 down vote accepted

I would say your concerns are correct. You already have a bottleneck with the apache children logging to the same file (or the same pipe if you use cronolog).

My suggestion would be to either log to different files (say appending the hostname to the end of the file) then summarise those files later. Alternatively if you are concerned about the overhead of logging to a network storage device, log locally, again with a unique extension then rsync the files to a central location after rolling them, and summarise.

share|improve this answer
    
Absolutely, also use buffered logging to help reduce logging overhead. –  LapTop006 May 27 '09 at 12:45
    
Can Apache do buffered logging? I thought only nginx offered that –  Dave Cheney May 27 '09 at 13:05

Use logresolvemerge.pl, part of AWstats (or hack your own).

Personally, I'd log to a ramdisk on each server and merge to file every hour or so.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.