matrix-org / matrix-org/mjolnir

Scaling mjolnir appservice

Open
#414 0 comments 0 reactions 0 assignees View on GitHub
A-Appservice T-Enhancement
Dominant language
TypeScript
Stars
445
Forks
75
Avg merge
2d 44m
Merged PRs (30d)
3

Description

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.

Contributor guide

Open the contributing guide

Research direction

Start by profiling the current implementation to establish its resource and performance characteristics. Then investigate Node workers versus subprocesses, workload sharding, and the proposed per-virtual-user token and memory-isolation benefits. Done means documenting evidence-based findings and a clear scaling direction before implementation.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
backend, performance
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.