Skip to content

Commit

Permalink
docs: Describe CUBEJS_MAX_SESSIONS environment variable (#8782)
Browse files Browse the repository at this point in the history
  • Loading branch information
igorlukanin authored Oct 4, 2024
1 parent b31f7aa commit 7ac7a5b
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
10 changes: 9 additions & 1 deletion docs/pages/product/apis-integrations/sql-api.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ error: `Error during rewrite: Can't find rewrite due to 10002 AST node limit rea
Use the following environment variables to allocate more resources for query planning:
`CUBESQL_REWRITE_MAX_NODES`, `CUBESQL_REWRITE_MAX_ITERATIONS`, `CUBESQL_REWRITE_TIMEOUT`.

## Streaming
### Streaming

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

</InfoBox>

### Session limit

Each concurrent connection to the SQL API consumes some resources and attempting
to establish too many connections at once can lead to an out-of-memory crash.
You can use the `CUBEJS_MAX_SESSIONS` environment variable to adjust the session
limit.


[ref-sql-api-auth]: /product/apis-integrations/sql-api/security
[ref-config-checksqlauth]: /reference/configuration/config#checksqlauth
[ref-config-canswitchsqluser]: /reference/configuration/config#canswitchsqluser
Expand Down
12 changes: 11 additions & 1 deletion docs/pages/reference/configuration/environment-variables.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -993,7 +993,17 @@ clause](/product/apis-integrations/queries#order) for [SQL API][ref-sql-api] que

| Possible Values | Default in Development | Default in Production |
| --------------- | ---------------------- | --------------------- |
| `true`, `false` | `true` | `true` |
| `true`, `false` | `true` | `true` |

## `CUBEJS_MAX_SESSIONS`

Specifies the maximum number of concurrent sessions (connections) to the
[SQL API][ref-sql-api] and safeguards your Cube deployment from out-of-memory
crashes when too many connections are attempted to be established.

| Possible Values | Default in Development | Default in Production |
| --------------- | ---------------------- | --------------------- |
| A valid number | 1024 | 1024 |

## `CUBESQL_REWRITE_MAX_NODES`

Expand Down

0 comments on commit 7ac7a5b

Please sign in to comment.