Set Client Connection Limits

Setting a user's client connection limits allows you to control how many simultaneous sessions a user can run. This prevents Vertica from exhausting the allowable concurrent connections set by MaxClientSessions and improves the usability of the system.

MaxClientSessions Limits

Client connection limits cannot be higher than the limits set in MaxClientSessions. Therefore:

Set Connection Limits for a User

Set connection limits for a user as follows:

=> CREATE USER user1 MAXCONNECTIONS 10 ON NODE IDLESESSIONTIMEOUT '10 mins';

This example limits user1 to ten concurrent connections on an individual node. An idle session for the user times out after ten minutes. For more information see CREATE USER.

You can also modify an existing user to add connection limits with ALTER USER.

=> ALTER USER user2 MAXCONNECTIONS 5 ON DATABASE;

View User Connection Limits and Session Timeouts

See the USERS table to determine if a user has connection limits and session timeouts implemented.

=> SELECT user_name, max_connections, connection_limit_mode, idle_session_timeout FROM users;

user_name   | max_connections | connection_limit_mode | idle_session_timeout
------------+-----------------+-----------------------+----------------------
max1        | 10              | node                  | 00:10
max2        |  5              | database              | unlimited

IDLESESSIONTIMEOUT

When setting the IDLESESSTIONTIMEOUT value, be aware that a system is considered idle when it is waiting for instructions from the client.

The system starts tracking the timeout value from the point the server starts waiting for any type of message. For example, if the server receives a parse and is waiting for a bind, the time spent waiting is considered idle time and IDLESESSIONTIMEOUT starts.

When you change a user's IDLESESSIONTIMEOUT value, the new value affects only those sessions started after the udpate.