matrix-org / mjolnir

A moderation tool for Matrix

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Scaling mjolnir appservice

Gnuxie opened this issue · comments

We should architect this so that it can be scaled down rather than scaled up.

There was an original idea to use node workers or subprocesses to give one process per managed mjolnir. This would intentionally also have a supposed security benefit by memory isolating managed mjolnirs from one another, given there was some way to create an access token specific to one virtual user (because currently the access token for virtual users is used for the entire user namespace).

There needs to be some investigation into whether node workers are only relatively lighter compared to system processes because if they are, then we risk actually utilising more resources by naively giving one worker to each mjolnir. So some more thought needs to be done about sharding the workload and the benefits of each approach. Before making any decision though we would still need to profile or asses the performance of the current implementation.