Improve wekan performance
Created by: maulal
Hi everybody :) I will explain shortly what have been done to our wekan deployment to improve greetly the performance. But it should be good to do some work with the datamodel. I will try to add soon, a new issue for that.
Our wekan stats: 2222 users / 1516 boards / 10824 lists / 31854 cards / 23000 card_comment / 148000 activities
Our mongodb servers (1 mongodb replicaset of 3 nodes for High Availability): 2vcpu / 2Go 4GB RAM
On mongodb version: 3.2.x
With this configuration, we are always under 20% of cpu.
With the mongo shell, just connect to your mongod, and do:
use wekan
db.activities.createIndex({cardId:1, createdAt: -1})
db.activities.createIndex({boardId:1, createdAt: -1})
db.activities.createIndex({ commentId: 1 }, { partialFilterExpression: { commentId: { $exists: true } } })
db.activities.createIndex({ attachmentId: 1 },{ partialFilterExpression: { attachmentId: { $exists: true } } })
db.card_comments.createIndex({cardId:1, createdAt: -1})
db.cards.createIndex({boardId:1, createdAt: -1})
db.lists.createIndex({ boardId: 1 })
db.boards.createIndex({ "members.userId": 1 })
db.cfs.attachments.filerecord.createIndex({ cardId: 1 })
db.cfs.avatars.filerecord.createIndex({ userId: 1 })
db.presences.createIndex({ userId: 1 })
db.unsaved-edits.createIndex({ userId: 1 })
Maybe there are some indexes that are missing. But those in this issue, are the main one.
Bye ;)