|
1 | 1 | ---
|
2 | 2 | title: Limits of Azure Cosmos DB Gremlin
|
3 | 3 | description: Reference documentation for runtime limitations of Graph engine
|
4 |
| -author: olignat |
| 4 | +author: LuisBosquez |
5 | 5 | ms.service: cosmos-db
|
6 | 6 | ms.subservice: cosmosdb-graph
|
7 | 7 | ms.topic: reference
|
8 |
| -ms.date: 09/10/2019 |
9 |
| -ms.author: olignat |
| 8 | +ms.date: 10/04/2019 |
| 9 | +ms.author: lbosq |
10 | 10 | ---
|
11 | 11 |
|
12 | 12 | # Azure Cosmos DB Gremlin limits
|
13 | 13 | This article talks about the limits of Azure Cosmos DB Gremlin engine and explains how they may impact customer traversals.
|
14 | 14 |
|
15 |
| -Cosmos DB Gremlin is built on top of Cosmos DB infrastructure that's why all limits in [Azure Cosmos DB](https://docs.microsoft.com/azure/cosmos-db/concepts-limits) still apply. |
| 15 | +Cosmos DB Gremlin is built on top of Cosmos DB infrastructure. Due to this, all limits explained in [Azure Cosmos DB service limits](https://docs.microsoft.com/azure/cosmos-db/concepts-limits) still apply. |
16 | 16 |
|
17 | 17 | ## Limits
|
18 | 18 |
|
19 |
| -When Gremlin limit is reached, traversal is canceled with **x-ms-status-code** = 429 indicating throttling error. |
| 19 | +When Gremlin limit is reached, traversal is canceled with a **x-ms-status-code** of 429 indicating a throttling error. See [Gremlin server response headers](gremlin-limits.md) for more information. |
20 | 20 |
|
21 | 21 | **Resource** | **Default limit** | **Explanation**
|
22 | 22 | --- | --- | ---
|
23 |
| -*Memory per request* | **2 GB** | Maximum memory that a request can consume during processing. Requests that need to compute large data sets will consume additional memory. Consider scoping requests to smaller data sets to avoid crossing this limit or use OLAP solutions. |
24 | 23 | *Script length* | **64 KB** | Maximum length of a Gremlin traversal script per request.
|
25 |
| -*Operator depth* | **400** | Total number of unique steps in a traversal. For example, ```g.V().out()``` has operator count of 2: V() and out(), ```g.V('label').repeat(out()).times(100)``` has operator depth of 3: V(), repeat(), and out() because ```.times(100)``` is a parameter to ```.repeat()``` operator. |
| 24 | +*Operator depth* | **400** | Total number of unique steps in a traversal. For example, ```g.V().out()``` has an operator count of 2: V() and out(), ```g.V('label').repeat(out()).times(100)``` has operator depth of 3: V(), repeat(), and out() because ```.times(100)``` is a parameter to ```.repeat()``` operator. |
26 | 25 | *Degree of parallelism* | **32** | Maximum number of storage partitions queried in a single request to storage layer. Graphs with hundreds of partitions will be impacted by this limit.
|
27 | 26 | *Repeat limit* | **32** | Maximum number of iterations a ```.repeat()``` operator can execute. Each iteration of ```.repeat()``` step in most cases runs breadth-first traversal, which means that any traversal is limited to at most 32 hops between vertices.
|
28 | 27 | *Traversal timeout* | **30 seconds** | Traversal will be canceled when it exceeds this time. Cosmos DB Graph is an OLTP database with vast majority of traversals completing within milliseconds. To run OLAP queries on Cosmos DB Graph, use [Apache Spark](https://azure.microsoft.com/services/cosmos-db/) with [Graph Data Frames](https://spark.apache.org/docs/latest/sql-programming-guide.html#datasets-and-dataframes) and [Cosmos DB Spark Connector](https://github.com/Azure/azure-cosmosdb-spark).
|
29 |
| -*Predicate limit* | **20** | Count of ```.has()``` or ```.hasNot()``` steps applied on a single vertex or edge. When this limit is hit error surfaced to the application is ```The SQL query exceeded the maximum number of joins. The allowed limit is 20```. It's a temporary inconvenience as team is working to lift this limit. |
30 |
| -*Idle connection timeout* | **5 hours** | Amount of time Graph server will keep websocket connection open without traffic on it. TCP keep-alive packets or HTTP keep-alive requests don't extend connection lifespan beyond this limit, however if they aren't sent then underlying Azure infrastructure may close the connection even sooner. Cosmos DB Graph engine considers to be idle if there are no Gremlin traversals running on it. |
31 |
| -*Resource token per hour* | **100** | Number of unique resource tokens used by Gremlin clients to connect to Gremlin account in a region. When application exceeds hourly unique token limit, `"Exceeded allowed resource token limit of 100 that can be used concurrently"` will be returned on next authentication request. |
| 28 | +*Idle connection timeout* | **1 hour** | Amount of time the Gremlin service will keep idle websocket connections open. TCP keep-alive packets or HTTP keep-alive requests don't extend connection lifespan beyond this limit. Cosmos DB Graph engine considers websocket connections to be idle if there are no active Gremlin requests running on it. |
| 29 | +*Resource token per hour* | **100** | Number of unique resource tokens used by Gremlin clients to connect to Gremlin account in a region. When the application exceeds hourly unique token limit, `"Exceeded allowed resource token limit of 100 that can be used concurrently"` will be returned on the next authentication request. |
32 | 30 |
|
33 | 31 | ## Next steps
|
34 | 32 | * [Azure Cosmos DB Gremlin response headers](gremlin-headers.md)
|
|
0 commit comments