You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-[Health Checking for Redis Active Connection](#health-checking-for-redis-active-connection)
@@ -1274,14 +1277,33 @@ The deployment type can be specified with the `REDIS_TYPE` / `REDIS_PERSECOND_TY
1274
1277
1. "sentinel": A comma separated list with the first string as the master name of the sentinel cluster followed by hostname:port pairs. The list size should be >= 2. The first item is the name of the master and the rest are the sentinels.
1275
1278
1. "cluster": A comma separated list of hostname:port pairs with all the nodes in the cluster.
1276
1279
1277
-
## Connection Timeout
1280
+
## Connection Pool Settings
1278
1281
1279
-
Connection timeout controls the maximum duration for Redis connection establishment, read operations, and write operations.
1282
+
### Pool Size
1283
+
1284
+
1.`REDIS_POOL_SIZE`: the number of connections to keep in the pool. Default: `10`
1285
+
1.`REDIS_PERSECOND_POOL_SIZE`: pool size for per-second Redis. Default: `10`
1286
+
1287
+
### Connection Timeout
1288
+
1289
+
Controls the maximum duration for Redis connection establishment, read operations, and write operations.
1280
1290
1281
1291
1.`REDIS_TIMEOUT`: sets the timeout for Redis connection and I/O operations. Default: `10s`
1282
1292
1.`REDIS_PERSECOND_TIMEOUT`: sets the timeout for per-second Redis connection and I/O operations. Default: `10s`
1283
1293
1284
-
## Pipelining
1294
+
### Pool On-Empty Behavior
1295
+
1296
+
Controls what happens when all connections in the pool are in use and a new request arrives.
1297
+
1298
+
1.`REDIS_POOL_ON_EMPTY_BEHAVIOR`: controls what happens when the pool is empty. Default: `CREATE`
1299
+
-`CREATE`: create a new overflow connection after waiting for `REDIS_POOL_ON_EMPTY_WAIT_DURATION`. This is the [default radix behavior](https://github.com/mediocregopher/radix/blob/v3.8.1/pool.go#L291-L312).
1300
+
-`ERROR`: return an error after waiting for `REDIS_POOL_ON_EMPTY_WAIT_DURATION`. This enforces a strict pool size limit.
1301
+
-`WAIT`: block until a connection becomes available. This enforces a strict pool size limit but may cause goroutine buildup.
1302
+
1.`REDIS_POOL_ON_EMPTY_WAIT_DURATION`: the duration to wait before taking the configured action (`CREATE` or `ERROR`). Default: `1s`
1303
+
1.`REDIS_PERSECOND_POOL_ON_EMPTY_BEHAVIOR`: same as above for per-second Redis pool. Default: `CREATE`
1304
+
1.`REDIS_PERSECOND_POOL_ON_EMPTY_WAIT_DURATION`: same as above for per-second Redis pool. Default: `1s`
1305
+
1306
+
### Pipelining
1285
1307
1286
1308
By default, for each request, ratelimit will pick up a connection from pool, write multiple redis commands in a single write then reads their responses in a single read. This reduces network delay.
0 commit comments