{"push_id":971058739,"size":1,"distinct_size":1,"ref":"refs/heads/master","head":"fd6fbdc6efa161db03d5ceb095cabadee1efa277","before":"827890f21aa612bb392f534d23fb65c2fa5853a5","commits":[{"sha":"fd6fbdc6efa161db03d5ceb095cabadee1efa277","author":{"email":"173dac1602ac41276e4d21f4b72113b9de187c27@localhost.localdomain","name":"chriwill"},"message":"Seyren checks that stay in error for a while fill up the seyren.alerts collections and causes MongoDB to use 100% CPU because of excessive sorting.\nThis can be fix by adding the timestamp to the index in descending order.\n\ndb.alerts.createIndex( { \"checkId\" : 1, \"targetHash\" : 1, \"timestamp\" : -1 } )\n\nMongo partial query tree:\n{\n        \"op\" : \"query\",\n        \"ns\" : \"seyren.alerts\",\n        \"query\" : {\n                \"$query\" : {\n                        \"checkId\" : \"55723bf20cf2944655ad5400\",\n                        \"targetHash\" : \"=�G\\u0013�x��\\f8��\\u0007��6\"\n                },\n                \"$orderby\" : {\n                        \"timestamp\" : -1\n                }\n        },\n        \"ntoskip\" : 0,\n        \"nscanned\" : 23341,\n        \"nscannedObjects\" : 23341,\n        \"keyUpdates\" : 0,\n        \"numYield\" : 23,\n        \"lockStats\" : {\n                \"timeLockedMicros\" : {\n                        \"r\" : NumberLong(221565),\n                        \"w\" : NumberLong(0)\n                },\n                \"timeAcquiringMicros\" : {\n                        \"r\" : NumberLong(382),\n                        \"w\" : NumberLong(3)\n                }\n        },\n        \"nreturned\" : 1,\n        \"responseLength\" : 416,\n        \"millis\" : 137,\n        \"execStats\" : {\n                \"type\" : \"KEEP_MUTATIONS\",\n                \"works\" : 23344,\n                \"yields\" : 182,\n                \"unyields\" : 182,\n                \"invalidates\" : 0,\n                \"advanced\" : 1,\n                \"needTime\" : 23343,\n                \"needFetch\" : 0,\n                \"isEOF\" : 0,\n                \"children\" : [\n                        {\n                                \"type\" : \"OR\",\n                                \"works\" : 23344,\n                                \"yields\" : 182,\n                                \"unyields\" : 182,\n                                \"invalidates\" : 0,\n                                \"advanced\" : 1,\n                                \"needTime\" : 23343,\n                                \"needFetch\" : 0,\n                                \"isEOF\" : 0,\n                                \"dupsTested\" : 1,\n                                \"dupsDropped\" : 0,\n                                \"locsForgotten\" : 0,\n                                \"matchTested_0\" : 0,\n                                \"matchTested_1\" : 0,\n                                \"children\" : [\n                                        {\n                                                \"type\" : \"SORT\",\n                                                \"works\" : 23344,\n                                                \"yields\" : 182,\n                                                \"unyields\" : 182,\n                                                \"invalidates\" : 0,\n                                                \"advanced\" : 1,\n                                                \"needTime\" : 23342,\n                                                \"needFetch\" : 0,\n                                                \"isEOF\" : 1,\n                                                \"forcedFetches\" : 0,\n                                                \"memUsage\" : 404,\n                                                \"memLimit\" : 33554432,\n                                                \"children\" : [","distinct":true,"url":"https://api.github.com/repos/chriwill/seyren/commits/fd6fbdc6efa161db03d5ceb095cabadee1efa277"}]}