losandes / socket.io-mongodb

A MongoDB Adapter for socket.io
MIT License
25 stars 8 forks source link

Indexes #6

Open thenitai opened 7 years ago

thenitai commented 7 years ago

Hi there,

Now that our app is in production we see a lot of queries and connections to MongoDB. Is there any way we can speed up things? I trying to bring down any queries to at least 200ms.

As it is now, the queries take up more time:

db.socketio command: getMore { getMore: 221923053992, collection: "socketio", batchSize: 1000 } planSummary: COLLSCAN cursorid:221923053992 keysExamined:0 docsExamined:0 keyUpdates:0 writeConflicts:0 numYields:2 nreturned:0 reslen:105 locks:{ Global: { acquireCount: { r: 8 } }, Database: { acquireCount: { r: 4 } }, Collection: { acquireCount: { r: 4 } } } protocol:op_query 1064ms

Also, it there a possibility to add TTL index? If so, on what fields should I use?

Thank you.