Skip to content

Support unix sockets via systemd#3

Open
Jeidnx wants to merge 1 commit intosqualus:masterfrom
Jeidnx:master
Open

Support unix sockets via systemd#3
Jeidnx wants to merge 1 commit intosqualus:masterfrom
Jeidnx:master

Conversation

@Jeidnx
Copy link

@Jeidnx Jeidnx commented Jun 17, 2024

Hi :)

This PR adds the filesPath option to the frontend module, which i use to host the frontend with a different web server.
Also i changed the piped-proxy to use systemd sockets and added the listenPath option which allows setting a path to a unix socket for the proxy to listen on.
Another change is the extra sed in the frontend postPatch to change the opensearch url. Upstream doesn't do this in the docker container setup, but i think there is no reason to not do it.

@squalus
Copy link
Owner

squalus commented Jun 23, 2024

Thanks for the contributions. I merged the filesPath and opensearch changes. Can you update the PR to only include the socket change?

I'll be happy to merge unix socket support, but I'll need to do some research to understand how you're doing it with systemd-socket and piped-proxy. This is using systemd socket activation?

@squalus
Copy link
Owner

squalus commented Jun 23, 2024

Socket activation imposes a performance penalty because a new process must be launched for each connection. piped-proxy supports natively setting up its own TCP connection. but not its own UNIX socket. It also supports setting up its own Unix socket via the UDS env var, but not the permissions and ownership. So I'd like to use socket activation only in the case of UNIX sockets, not TCP connections. Let me know if I'm wrong about any of these statements. And I'm open to be convinced in using activation for all cases if there's an argument for it.

@squalus
Copy link
Owner

squalus commented Jun 23, 2024

OK, I'm wrong about the performance penalty. It doesn't work by creating a new process per connection. I'll do some testing on your solution.

@Jeidnx
Copy link
Author

Jeidnx commented Jun 25, 2024

Socket activation means that the service is automatically started when a connection is made to the socket. But since the piped-proxy.service is started by the multi-user.target anyways this is not happening. I am only using systemd sockets because of permission issues when using the builtin unix socket listener.

I've changed the module to use systemd sockets only when listenPath is set.
If you have any more questions I'd be happy to answer :)

@Jeidnx Jeidnx changed the title Add socket support and other options Support unix sockets via systemd Jul 28, 2024
@Jeidnx
Copy link
Author

Jeidnx commented Oct 5, 2024

I'm still using this without any issues.
Just a friendly ping :)

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 this pull request may close these issues.

2 participants