Reputation: 29
I am testing mongodb and during my test stage of about three weeks mongodb was successful. But when I use it in my production system then mongodb crashes.
In my scenario 13 front server are getting web request through one mongodb server and mongodb a collection handles these insert requests. 650,000 insert a minute. And normally there is 110 mongodb connections on my db serverstatus.
I rename the current collection every minute and then my old collection is created automatically. Because lots of request coming from front servers. And I am moving the data from the renamed collection to SQL Server Database every minute.
First 6 hours everything is normal. But later mongodb connections are increasing abnormally to 3,500 connections. And the current queue is 1500. And my front servers can't receive response from the mongodb.
Why does this error occur, do you have any idea?
thank you.
Upvotes: 2
Views: 1569
Reputation: 4435
Try using MongoDB connetion pooling so that no new connection is created upon every request to mongodb.
Upvotes: 0
Reputation: 754
Can you attach the output of mongostat in addition to the logs. The information here should help guide you to what could be the bottlenecks. More information on mongostat information can be found at http://www.mongodb.org/display/DOCS/mongostat. From the driver what SafeMode options are you using? As far as fsync goes Ravi is talking about fsync delay on the mongod server and by reducing the time between fsyncs he is forcing the database to commit more often. Are you seeing this behavior consistently at a certain time pointing to a spike in traffic from your client side?
Upvotes: 1
Reputation: 1964
Try reducing -fsync. There is difference when a insert operation is called and when mongo actually does it.
Upvotes: 0