Skip to content

Commit 7ac7a5b

Browse files
authored
docs: Describe CUBEJS_MAX_SESSIONS environment variable (#8782)
1 parent b31f7aa commit 7ac7a5b

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

docs/pages/product/apis-integrations/sql-api.mdx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ error: `Error during rewrite: Can't find rewrite due to 10002 AST node limit rea
211211
Use the following environment variables to allocate more resources for query planning:
212212
`CUBESQL_REWRITE_MAX_NODES`, `CUBESQL_REWRITE_MAX_ITERATIONS`, `CUBESQL_REWRITE_TIMEOUT`.
213213

214-
## Streaming
214+
### Streaming
215215

216216
By default, query results are loaded in a single batch. However, a more effective
217217
*streaming mode* can be used for large result sets. To enable it, set the
@@ -224,6 +224,14 @@ does not apply to SQL API queries. They can return an unlimited number of rows.
224224

225225
</InfoBox>
226226

227+
### Session limit
228+
229+
Each concurrent connection to the SQL API consumes some resources and attempting
230+
to establish too many connections at once can lead to an out-of-memory crash.
231+
You can use the `CUBEJS_MAX_SESSIONS` environment variable to adjust the session
232+
limit.
233+
234+
227235
[ref-sql-api-auth]: /product/apis-integrations/sql-api/security
228236
[ref-config-checksqlauth]: /reference/configuration/config#checksqlauth
229237
[ref-config-canswitchsqluser]: /reference/configuration/config#canswitchsqluser

docs/pages/reference/configuration/environment-variables.mdx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -993,7 +993,17 @@ clause](/product/apis-integrations/queries#order) for [SQL API][ref-sql-api] que
993993

994994
| Possible Values | Default in Development | Default in Production |
995995
| --------------- | ---------------------- | --------------------- |
996-
| `true`, `false` | `true` | `true` |
996+
| `true`, `false` | `true` | `true` |
997+
998+
## `CUBEJS_MAX_SESSIONS`
999+
1000+
Specifies the maximum number of concurrent sessions (connections) to the
1001+
[SQL API][ref-sql-api] and safeguards your Cube deployment from out-of-memory
1002+
crashes when too many connections are attempted to be established.
1003+
1004+
| Possible Values | Default in Development | Default in Production |
1005+
| --------------- | ---------------------- | --------------------- |
1006+
| A valid number | 1024 | 1024 |
9971007

9981008
## `CUBESQL_REWRITE_MAX_NODES`
9991009

0 commit comments

Comments
 (0)