Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

One jdt.ls instance to handle multiple clients. #741

Open
shoorlyne opened this issue Aug 1, 2018 · 7 comments
Open

One jdt.ls instance to handle multiple clients. #741

shoorlyne opened this issue Aug 1, 2018 · 7 comments

Comments

@shoorlyne
Copy link

shoorlyne commented Aug 1, 2018

I have a scenario which I'd like to ask for some advice about.

We use jdt.ls as the backend to provide code intelligence to our users. We plan to allow potentially 100+ users to edit Java code at the same time. The content in each user's file is different. All the users share exactly the same Java environment, including the compiler/vm, libraries, etc. From the language server's perspective, the users only differ in the files they are editing, while everything else is the same.

Therefore, if I can have one language server instance to handle LSP requests from all the users, it would be more resource efficient. My reasoning: each language server must allocate some resources for AST reading/cache, etc., and with multiple server instances, such effort is duplicated and the resources are wasted.

Last time I checked, a single jdt.ls instance started by editing a Java source file of dozens of lines of code consumed ~300MB. If there are 100 concurrent users, it would be ~30GB. But if somehow we can manage to have only one instance to handle the requests, I imagine it should fall near the 300MB end, instead of the 30GB end.

Is this possible?

@gorkem gorkem added the question label Aug 1, 2018
@gorkem
Copy link
Contributor

gorkem commented Aug 1, 2018

It is not a scenario we support officially but if you are using a single server instance it will be like opening multiple files on the editor from the same project. They will not be isolated from each other and each user will be able to see other's symbol changes. I guess you can achieve this by adding a proxy to jdt.ls but anything beyond is really hard to achieve today.

@yyoncho
Copy link
Contributor

yyoncho commented Aug 1, 2018

I am not JDT LS developer but only a user but I think that the following configuration might support what you want:

One workspace and each of the clients will have its own workspace folder added to that workspace. The only problem seems to be the project name (I haven't tried that but I believe that Eclipse/JDT LS does not allow duplicate names). In order to avoid that you may generate a unique name for each of the clients' project and put it in .project (?) file.

@hifall
Copy link

hifall commented Aug 2, 2018

@yyoncho, thanks for the suggestion!

@gorkem, would using projects to isolate user files suggested by @yyoncho address the concern you mentioned? Also, if possible, could you give more info on how the proxy to jdt.ls works? Thanks!

@GNSubrahmanyam
Copy link

Any updates @shoorlyne @hifall How you solved this problem? How you planned your scaling?

@balabesimple1
Copy link

Have we scaled this use scale? or Could you give more info on how the proxy to jdt.ls works?

@balabesimple1
Copy link

@shoorlyne Have you done any workaround to handle multiple client?

@ivan-kzn
Copy link

ivan-kzn commented Dec 9, 2024

@balabesimple1 @shoorlyne have you succeeded in this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants