Skip to content

Unix socket API? #8

Open
Open
@lrowe

Description

@lrowe

It struck me that wait_for_requests_paused() is essentially a blocking read so what if tenant programs could open a unix socket and run a standard web server?

  • Most web server frameworks already support serving requests over unix sockets.
  • Unix sockets avoid overhead of networking stack.
  • Would incur additional overhead from serializing/deserializing request but that is only of the order of 10us per request which for many applications is negligible.
  • Easier testing since you can simply run the tenant program under linux and make requests against the unix socket.
  • With the experimental executable_heap support presumably dlopen should work so you could run existing linux binaries which would be particularly helpful for applications running in interpreted languages. (This might also require changing the main arguments protocol so that the exact arguments could be specified.)

The biggest downside would probably be the need to support multiple mechanisms like epoll/select/blocking reads.

While I'm mostly interested in Deno right now I don't expect it would help there immediately since Deno runs its web server on a separate thread. It would probably need a --single-threaded option adding to disable v8 background threads and run the web server in thread.

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureFeature request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions