forked from hasura/graphql-engine
-
Notifications
You must be signed in to change notification settings - Fork 1
Horizontal scaling connection (Draft)
Rakesh Emmadi edited this page Jul 11, 2019
·
1 revision
To enable horizontal scaling, Hasura uses Postgres Listen/Notify feature to be able to know whether any metadata update query has been executed on other instances.
Hasura runs two threads separately. One is to LISTEN
events from Postgres and the other is to process those
events. The listener thread acquires a connection from the connection pool and uses the same to get events.
If the listener is unable to acquire a connection then the thread will be blocked (see withResource
function in Data.Pool
module). Also, the processor thread is blocked since there are no events to be processed. This scenario causes the metadata sync process to be frozen between Hasura instances. No logs will be recorded as threads are blocked.
Possible solutions.
- Use More connections in pool