Skip to content

Commit

Permalink
feat(cubesql): Increase limits for statements/portals/cursors (#5146)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ovr committed Sep 18, 2022
1 parent b58e0c6 commit 363b42d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions rust/cubesql/cubesql/src/sql/server_manager.rs
Expand Up @@ -26,9 +26,10 @@ pub struct ServerConfiguration {
impl Default for ServerConfiguration {
fn default() -> Self {
Self {
connection_max_prepared_statements: 50,
connection_max_cursors: 15,
connection_max_portals: 15,
connection_max_prepared_statements: 128,
connection_max_portals: 64,
// by default cursor can be used only inside transaction
connection_max_cursors: 16,
}
}
}
Expand Down

0 comments on commit 363b42d

Please sign in to comment.