lwolf / stolon-chart

Kubernetes Helm chart to deploy HA Postgresql cluster based on Stolon
MIT License
105 stars 39 forks source link

Load only distributed to one of the keepers #1

Closed timfpark closed 7 years ago

timfpark commented 7 years ago

I'm not sure if this is expected or not, but I'm using a 3 replica cluster with your chart, and directing my node.js application at it using the service endpoint, ala:

postgres://username:password@postgres-stolon-proxy.postgresql.svc.cluster.local/db

I have three web application pods making query requests against this connection string and what I'm seeing is that only one of the keeper pods is taking all of the load of the application. Is this expected? Is it possible to use all three replicas in round robin fashion (or whatever) to share the load?

lwolf commented 7 years ago

Hi, Yes, this is the correct behavior, stolon-proxy always points to the current master. There are several tickets to support balancing of the RO sessions. 237, 132

Meanwhile, you can use another service deployed as a part of this chart, for balancing reads among all keepers keeper-ro-service.yaml In your case it should be called postgres-stolon-keeper.postgresql.svc.cluster.local

timfpark commented 7 years ago

Thank you! That will work great in the meantime.