Hi, I build a cloudide in browser. Once people create an IDE, I will give them a docker which theia runs in.
The question is, if there is three people who access the same IDE which means the same theia service in the same docker, the backend will start three ‘vscode-buildin-typescript-language-features’, each comsume almost 500M of my docker’s memory, that make my docker collapse.
here is my docker memory consume:
what’s the reason and how can I avoid that?
So, what happens here is that for every user, Theia creates a new plugin-host-process which runs every plugin encapsulated for every user. That’s why it will create a new language service of TypeScript for every user as well.
I don’t think there’s a good way to solve this due to multiple reasons:
- Theia’s main use is for every end user to get their own environment, encapsulated from everyone else. Multi-tenant support isn’t really a priority for the project.
- There are technical difficulties to be aware of as well: While in your example every user probably uses the same project, how would one deal with multiple users opening different projects on the same backend? A single language server wouldn’t work correctly with that approach.
- Since VSCode (Web) uses the same approach to their IDE, we are limited by how the extensions expect the plugin-host to work. Since the extensions expect only a single concurrent user, sharing plugin-hosts might lead to unexpected behavior across the board.
Your best choice would probably be same what other Web-IDE providers (like Eclipse Che or Gitpod) are doing and create a new pod/container for every connected user. That way everything is correctly isolated.
I did a (albeit a bit rambling) talk about this a couple of months ago: https://www.youtube.com/watch?v=u3mguFQ8TdA&list=PLy7t4z5SYNaTYvCpxIlPqpzZ8C0rSIeey&index=4
The short answer is: it’s a research problem
ok, I know what you mean.
Is there is a chance that theia can support Multiplayer collaboration. Every one use the same backend, and we can see each other like fleet or vscode plugin gitlive.