Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

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


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.