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

adapter-node: systemd socket activation support #10134

Closed
lucasew opened this issue Jun 10, 2023 · 1 comment · Fixed by #11653
Closed

adapter-node: systemd socket activation support #10134

lucasew opened this issue Jun 10, 2023 · 1 comment · Fixed by #11653

Comments

@lucasew
Copy link

lucasew commented Jun 10, 2023

Describe the problem

When running on premise, by default the application is running all the time and if it's not used often then you are always paying the cost to keep it running. Lambda services scale to zero if there is no activity for more than x minutes, and this is achievable with systemd socket activation if the programs are prepared for this.

Describe the proposed solution

Allow users to setup socket activation by passing PORT=systemd to the NodeJS bundle, or by checking for LISTEN_FDS.

Alternatives considered

Keep the application running all the time. Wasteful but doable.

Not running on premise is also an alternative.

Importance

would make my life easier

Additional Information

Documentation from systemd: https://www.freedesktop.org/software/systemd/man/systemd-socket-activate.html

This post has definitely better didactics than me in this case xD

https://rocketeer.be/articles/deploying-node-js-with-systemd/

I can do this, but I need to study the specifics of polka before that, someone else can get this more quickly.

@lucasew lucasew changed the title adapter-node: allow systemd socket activation support adapter-node: systemd socket activation support Jun 10, 2023
@Rich-Harris
Copy link
Member

Rich-Harris commented Jan 9, 2024

adapter-node allows you to create custom servers to support exactly this sort of advanced use case — would that work?

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