We are running a mongo replicaset on EC2 m2.xl hardware (two ubuntu
10.04 mongod 2.0.2 machines in replication config and an aribter
running on a micro instance). Each mongod uses four EBS volumes in a
raid 10 configuration, with an XFS filesystem. The hardware seems
reasonably comfortably sized - the db is about 100 GB, and io
saturation averages at around 20%, with occasional spikes up to 35%.
During the incident I am writing about though, it went to 100% for a
single 1 minute period.
Periodically (sometimes a few times a day, sometime it skips a day
entirely) our db freezes up for a few tens of seconds. The times are
not predictable. The sirens only start firing if it lasts more than
10 seconds, and that is happening something like 3-6 times a week.
The most recent incident, which was the worst, lasted at least 90
seconds, and I'm worried that this is getting worse as the database
grows. The outage was so bad that the primary db swapped roles with
the secondary, then switched back a minute or so after it recovered.
Here's the most disconcerting thing in the log:
...
Thu Jan 26 14:57:19 [conn442741] end connection
10.203.49.200:50900
Thu Jan 26 14:57:21 [conn442742] end connection
10.28.1.67:39262
Thu Jan 26 14:57:31 [conn442745] end connection
10.13.63.171:60348
Thu Jan 26 14:59:00 [conn441104] update ctp.logWifiLive query: { uuid:
"abcdefgh", year: 2012, month: 1 } update: { omitted : 1 } 121031ms
Thu Jan 26 14:59:00 [conn441229] end connection
10.214.7.207:41170
Thu Jan 26 14:59:00 [conn442295] end connection
10.202.195.96:53524
...
See, right in the middle, where there are NO LOGS for 89 seconds?!? I
don't think that should happen in a db that handles at least 60
updates per second. And that first entry at the end of the delay is
an update that took 121 seconds. (there is an index that perfectly
matches the query, and that query is normally so fast that it does not
get logged at all).
I dug up this thread about a similar problem, which attributes the
cause to NUMA
http://groups.google.com/group/mongodb-user/browse_thread/thread/7ef9e0e5e40d4e38
But as far as I can tell, EC2 machines don't have NUMA (right?),
though there is precious little information on the internet about it.
We are on mms - no obvious smoking gun there, though you can certainly
see the incident on the graphs. During the time of the outage, it was
not possible to establish connections. I have been running
currentOp() on the db every 5 seconds, so I have a fairly detailed
history of anything that ran for a long time, or that got stuck. I
can see the 121 second query start running before the db seized up,
and I can see it had the write lock. The next currentOp() that went
through was 86 seconds later at 14:58:57, and by then, that query was
gone (though the log doesn't show it finishing until 3 seconds
later). Page faults seem reasonable for the whole time - they go from
about .25 before the incident, and spike to 6 at the worst, which I
think is still ok.
Could anyone suggest what is going on here?