Skip to content

Commit 363b42d

Browse files
authored
feat(cubesql): Increase limits for statements/portals/cursors (cube-js#5146)
I've implemented these limits to protect against possible memory leaks because at the beginning of SQL API we didn't implement: discard/deallocate/transactions. Right now, it's safe to increase these limits - Prepared statements: 128, because some PG clients use the local map to parse statements once, and then it reuses them while a connection is still alive. - Cursors: 16, because by default it lives inside a transaction. Some clients can use WITH HOLD to use it without a transaction. - Portals: 64, because It's a too large object, and it should be closed after usage. Previously it was 15, but let's give it a try.
1 parent b58e0c6 commit 363b42d

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

rust/cubesql/cubesql/src/sql/server_manager.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,10 @@ pub struct ServerConfiguration {
2626
impl Default for ServerConfiguration {
2727
fn default() -> Self {
2828
Self {
29-
connection_max_prepared_statements: 50,
30-
connection_max_cursors: 15,
31-
connection_max_portals: 15,
29+
connection_max_prepared_statements: 128,
30+
connection_max_portals: 64,
31+
// by default cursor can be used only inside transaction
32+
connection_max_cursors: 16,
3233
}
3334
}
3435
}

0 commit comments

Comments
 (0)