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

Persist home management #5

Open
CedricThomas opened this issue Jun 22, 2020 · 1 comment
Open

Persist home management #5

CedricThomas opened this issue Jun 22, 2020 · 1 comment
Labels
C-enhancement Category: Enhancement P-high Priority: High

Comments

@CedricThomas
Copy link

It would be really interesting to be able to manage several projects with a single persistence daemon and to manage them individually.

@Hirevo Hirevo added C-enhancement Category: Enhancement P-high Priority: High labels Jun 28, 2020
@Hirevo
Copy link
Owner

Hirevo commented Jun 28, 2020

I thought a bit more about this, and I think that an interesting possible design to explore could be one similar to git.

The idea would be to have the persist cli to recursively search for a .persist directory within the current directory and all of its parents and connect to its controlling daemon.

This would remove the need for the PERSIST_HOME environment variable, and maybe we could add a persist init or something to ease creation of a new daemon and its .persist folder for the current directory.

This would still be a multiple-daemon design, though.
I am not sure about having a single daemon for all projects, I am a bit worried about the number of simultaneously open file descriptors growing too big.

Spawning a process currently causes the daemon to open 4 file descriptors:

  • 2 for the process' stdout and stderr pipes
  • 2 for their corresponding log files

(Also note that we're likely to use another file descriptor per process for their stdin, which is currently nullified, to add support for a persist attach subcommand, à la pm2 attach)

The daemon also has a file descriptor for the Unix domain server socket and it uses an additional one (the client socket) whenever a persist command is invoked (although only persist logs currently makes a long-lived usage of that socket).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Category: Enhancement P-high Priority: High
Projects
None yet
Development

No branches or pull requests

2 participants