OpenHands icon indicating copy to clipboard operation
OpenHands copied to clipboard

Add postgres adapter for socket.io

Open rbren opened this issue 1 year ago • 1 comments


To run this PR locally, use the following command:

docker run -it --rm   -p 3000:3000   -v /var/run/docker.sock:/var/run/docker.sock   --add-host host.docker.internal:host-gateway   -e SANDBOX_RUNTIME_CONTAINER_IMAGE=docker.all-hands.dev/all-hands-ai/runtime:dbda7bc-nikolaik   --name openhands-app-dbda7bc   docker.all-hands.dev/all-hands-ai/openhands:dbda7bc

rbren avatar Nov 15 '24 17:11 rbren

Hi, would you also be willing to add in the socket.io redis adapter? Postgres NOTIFY / LISTEN doesn't really scale when PGBouncer / any kind connection pooling is used in between the app server and the postgres. Having all app servers direct connect to postgres is also an anti-pattern for scaling due to postgres' process-per-client architecture.

Redis would be a more usable pub-sub infra, and in our stack, we use Redis already with dramatiq for background async tasks

diwu-sf avatar Nov 18 '24 21:11 diwu-sf

@diwu-sf we are switching to postgres!

rbren avatar Nov 19 '24 18:11 rbren

err...we are switching to redis!

rbren avatar Nov 19 '24 18:11 rbren

Okay great, make a lot more sense for scaling.

diwu-sf avatar Nov 19 '24 18:11 diwu-sf