11 Load Balancing

Table of Contents Previous Next


11 Load Balancing

By default, load balancing is enabled on an EDB Ark cluster. To utilize load balancing, you should direct client applications to connect to the load balancing port (by default, 9999). A cluster's load balancing port number is displayed in the LBPORT column on the Details pane of the Clusters tab of the Ark console.
pgPool may direct the following statement types to either a primary or a standby node:
SELECT statements (not listed below)
In some cases, specific clauses within a query statement will signal pgPool to direct a statement to the master node. In other cases, the transaction type, or order of commands within a transaction can direct a statement to the master node. By default, the following transaction types will always be executed on the master node:
SELECT INTO, SELECT FOR UPDATE or SELECT FOR SHARE statements
SELECT statements within SERIALIZABLE transactions
SELECT statements that follow an INSERT statement
SET SESSION CHARACTERISTICS AS TRANSACTION… READ WRITE statements
EXPLAIN and EXPLAIN ANALYZE SELECT statements
START TRANSACTION… READ WRITE statements
LOCK commands that are stricter than ROW EXCLUSIVE MODE
The nextval() and setval() sequence functions
Please Note: If your application uses JDBC, and the autocommit option is set to false, the JDBC driver will include a BEGINCOMMIT statement with each SELECT statement. To enable load balancing when using the JDBC driver, your application must include a call to setAutoCommit(true).
COPY FROM
PREPARE TRANSACTION
COMMIT PREPARED
ROLLBACK PREPARED
pgPool does not enforce load balancing for SELECT statements with a leading white space or leading comment. For example, the following statement would be directed to the master node:
To enforce load balancing of SELECT statements with leading white space or comments, modify the pgpool.conf file, and set the ignore_leading_white_space parameter to true.
You can also use the black_listwhite_list parameters (located in the pgpool.conf file) to instruct pgPool to direct specific statements or functions to the master node. This is useful for cases where a SELECT statement (normally directed to a replica) calls a function that in turn might modify the database, and so should be directed to the master.
Deselect the 모니터링 Load Balancer Health checkbox (located on the Details panel of the Clusters tab) to indicate that you do not wish for load balancer health to be monitored and automatically restarted if an interruption in service is detected.

11 Load Balancing

Table of Contents Previous Next