Hey guys,
From time to time my app will exhibit, what seems to me, high lock times.
Here's an example from my mongodb.log (i'm profiling everything while I troubleshoot this)
Sat Sep 8 00:38:36 [conn69541] insert jeraff.notification keyUpdates:0 locks(micros) w:121485 121ms
Sat Sep 8 00:40:46 [conn69259] insert jeraff.activityStream keyUpdates:0 locks(micros) w:
3100666 3105ms
My notification docs' size is:
jeraffprod:PRIMARY> Object.bsonsize(db.notification.findOne());
232
And my activityStream docs' size is:
jeraffprod:PRIMARY> Object.bsonsize(db.activityStream.findOne());
226
My entire DB's index size is about 1.5GB
The DB's data size: is a hair under 2.8GB
the DB's file size is 14GB
The machine has 8GB RAM.
Mongo has 22.2g mapped & 5.75g resident.
Now - my questions is:
What should I be looking into to find out why seemingly "simple" inserts are locking for so long?
I'm sure my code's doing something to make mongo unhappy - I just want to know what procedures to employ to get down to the bottom of these problems.
Thanks