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

Feature Request: Configurable max instances #201

Open
connorgmeehan opened this issue Jun 15, 2022 · 5 comments · May be fixed by #232
Open

Feature Request: Configurable max instances #201

connorgmeehan opened this issue Jun 15, 2022 · 5 comments · May be fixed by #232

Comments

@connorgmeehan
Copy link

connorgmeehan commented Jun 15, 2022

I would like to be able to reduce the number of instances eslint_d keeps in memory. Currently eslint_d is using 1.3gb of memory with all 10 instances cached. Rather than eslint_d restarting regularly it'd be nice to be able to reduce this to 3-4 instances.

A way of configuring this could be via environment variables

export ESLINT_D_MAX_INSTANCES=5
eslint_d ./file.js
@connorgmeehan connorgmeehan changed the title Feature Request: Feature Request: Configurable max instances Jun 15, 2022
@mantoni
Copy link
Owner

mantoni commented Jun 15, 2022

That makes sense. Would you care to send a PR to implement this?

@connorgmeehan
Copy link
Author

Yep I can PR this, I'm noticing there's some references to CORE_D_TITLE should I copy this in the env variable and call it CORE_D_MAX_INSTANCES?

Are there any knock-on effects for testing?

@mantoni
Copy link
Owner

mantoni commented Jul 7, 2022

Great! I think it should be called ESLINT_D_MAX_INSTANCES because the cache is implemented here. You can see examples for testing in eslint-path-test.

@connorgmeehan
Copy link
Author

I've made the changes + added some error checking for invalid inputs but I'm having some trouble testing it. I've never developed a node CLI package before. What's the best way to run my branch of eslint_d on my machine. I've tried yarn global add "file:$PWD" and npm link.

@mantoni
Copy link
Owner

mantoni commented Jul 15, 2022

npm link worked fine for me when testing. But you can also simply invoke the bin/eslint_d.js file from anywhere.

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

Successfully merging a pull request may close this issue.

2 participants