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

My mongodb_mp.log is growing very quickly

A tail -f of the file scrolls very quickly

Do I need to look into connection pooling?

share|improve this question

2 Answers 2

up vote 2 down vote accepted

If your log is large, you probably need to rotate it.

Connection pooling would be helpful for performance, but you state the problem is log file size. so address log file size.

share|improve this answer
    
I'm just thinking that connection pooling would reduce the # of things that need to be written to the log since less connection were being made –  ckliborn Jan 18 '12 at 21:05

Connection Pooling is not going to greatly impact the log insertion rate. There will be a re-use of connections from clients so you eliminate some of the "connection accepted" chatter that you have probably noticed in the logs. However, queries on that connection may well still generate messages, and the connection messages (also from replication) will continue to show up, just at a lesser rate. There will also be plenty of other messaging in there.

Log rotation and deletion (of old logs) is definitely what you want if the size is what concerns you. How to rotate mongo logs is covered here:

http://www.mongodb.org/display/DOCS/Logging#Logging-Rotatingthelogfiles

Then tailor this with a cron job (or other periodic implementation) to archive/delete the older logs as you go along. How long to keep exactly is up to you, my general recommendation would be to keep a week at a minimum. Often that is the minimum to compare usage patterns when investigating an issue, but the actual retention is completely up to you.

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.