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.

We have big nginx error log(1GB).

Can this cause serious performance issue while nginx writes new errors in that file?

Sometimes our webserver hangs and recovers itself for about 2 minute.

OS: FreeBSD 8

share|improve this question
    
I would expect constant issues rather than intermittent ones. Have you tried truncating the log file (after backing it up) to see if the problem goes away? –  ChrisF Apr 14 '12 at 22:37
    
Does nginx open file(read) then write into it? Because in this case, it will cause 2-3 minute heavy load. –  Toktik Apr 14 '12 at 22:40
    
I don't know for certain, but truncating the log file would eliminate the size as being the issue. –  ChrisF Apr 14 '12 at 22:40
add comment

1 Answer

I believe it depends on nginx implementation details. In theory if nginx internally only opens a log file for append, then I would not expect performance issues from the large size. I recommend has a general good practice to have a log management strategy in place. Truncating the log or other strategy may be used to mitigating the risk of degradation with disk fragmentation or running out of free space.

share|improve this answer
add comment

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.