From 8d0d9d164ca06ea95a9559d24d8d7889c8f5f4ee Mon Sep 17 00:00:00 2001 From: jsteemann Date: Mon, 30 Jan 2017 16:38:20 +0100 Subject: [PATCH 1/3] updated documentation --- CHANGELOG | 12 +++++++- .../Books/AQL/Invocation/WithArangosh.mdpp | 9 +++++- .../HTTP/AqlQueryCursor/QueryResults.mdpp | 29 +++++++++++++++++++ .../Configuration/GeneralArangod.mdpp | 16 ++++++++++ .../Administration/Configuration/Wal.mdpp | 5 ++++ .../DocuBlocks/WalLogfileFlushTimeout.md | 11 +++++++ 6 files changed, 80 insertions(+), 2 deletions(-) create mode 100644 Documentation/DocuBlocks/WalLogfileFlushTimeout.md diff --git a/CHANGELOG b/CHANGELOG index 16b7487e2a..af19ea4e13 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -39,7 +39,17 @@ shards. db._query("FOR i IN 1..100000 SORT i RETURN i", {}, { options: { memoryLimit: 100000 } }); -* added startup option --query.memory-limit + This option limits the default maximum amount of memory (in bytes) that a single + AQL query can use. + When a single AQL query reaches the specified limit value, the query will be + aborted with a *resource limit exceeded* exception. In a cluster, the memory + accounting is done per shard, so the limit value is effectively a memory limit per + query per shard. + + The global limit value can be overriden per query by setting the *memoryLimit* + option value for individual queries when running an AQL query. + +* added server startup option `--query.memory-limit` * added convenience function to create vertex-centric indexes. Usage: `db.collection.ensureVertexCentricIndex("label", {type: "hash", direction: "outbound"})` diff --git a/Documentation/Books/AQL/Invocation/WithArangosh.mdpp b/Documentation/Books/AQL/Invocation/WithArangosh.mdpp index c401504aaf..79ae78ceab 100644 --- a/Documentation/Books/AQL/Invocation/WithArangosh.mdpp +++ b/Documentation/Books/AQL/Invocation/WithArangosh.mdpp @@ -97,7 +97,10 @@ You also will find warnings in here; If you're designing queries on the shell be To set a memory limit for the query, pass *options* to the *_query* method. The memory limit specifies the maximum number of bytes that the query is -allowed to use: +allowed to use. When a single AQL query reaches the specified limit value, +the query will be aborted with a *resource limit exceeded* exception. In a +cluster, the memory accounting is done per shard, so the limit value is +effectively a memory limit per query per shard. @startDocuBlockInline 02_workWithAQL_memoryLimit @EXAMPLE_ARANGOSH_OUTPUT{02_workWithAQL_memoryLimit} @@ -108,6 +111,10 @@ allowed to use: @END_EXAMPLE_ARANGOSH_OUTPUT @endDocuBlock 02_workWithAQL_memoryLimit +If no memory limit is specified, then the server default value (controlled by +startup option *--query.memory-limit* will be used for restricting the maximum amount +of memory the query can use. A memory limit value of *0* means that the maximum +amount of memory for the query is not restricted. ### with _createStatement (ArangoStatement) diff --git a/Documentation/Books/HTTP/AqlQueryCursor/QueryResults.mdpp b/Documentation/Books/HTTP/AqlQueryCursor/QueryResults.mdpp index bdba83e239..1ae9197dd7 100644 --- a/Documentation/Books/HTTP/AqlQueryCursor/QueryResults.mdpp +++ b/Documentation/Books/HTTP/AqlQueryCursor/QueryResults.mdpp @@ -198,3 +198,32 @@ Content-type: application/json; charset=utf-8 "code" : 201 } ``` + +### Setting a memory limit + +To set a memory limit for the query, the *memoryLimit* option can be passed to +the server. +The memory limit specifies the maximum number of bytes that the query is +allowed to use. When a single AQL query reaches the specified limit value, +the query will be aborted with a *resource limit exceeded* exception. In a +cluster, the memory accounting is done per shard, so the limit value is +effectively a memory limit per query per shard. + +```js +> curl --data @- -X POST --dump - http://localhost:8529/_api/cursor +{ "query" : "FOR i IN 1..100000 SORT i RETURN i", "memoryLimit" : 100000 } + +HTTP/1.1 500 Internal Server Error +Server: ArangoDB +Connection: Keep-Alive +Content-Type: application/json; charset=utf-8 +Content-Length: 115 + +{"error":true,"errorMessage":"query would use more memory than allowed (while executing)","code":500,"errorNum":32} +``` + +If no memory limit is specified, then the server default value (controlled by +startup option *--query.memory-limit* will be used for restricting the maximum amount +of memory the query can use. A memory limit value of *0* means that the maximum +amount of memory for the query is not restricted. + diff --git a/Documentation/Books/Manual/Administration/Configuration/GeneralArangod.mdpp b/Documentation/Books/Manual/Administration/Configuration/GeneralArangod.mdpp index 56bd26007f..76a8209bdc 100644 --- a/Documentation/Books/Manual/Administration/Configuration/GeneralArangod.mdpp +++ b/Documentation/Books/Manual/Administration/Configuration/GeneralArangod.mdpp @@ -329,6 +329,22 @@ directory as argument. @startDocuBlock databaseForceSyncProperties +### Limiting memory for AQL queries + +`--query.memory-limit value` + +The default maximum amount of memory (in bytes) that a single AQL query can use. +When a single AQL query reaches the specified limit value, the query will be +aborted with a *resource limit exceeded* exception. In a cluster, the memory +accounting is done per shard, so the limit value is effectively a memory limit per +query per shard. + +The global limit value can be overriden per query by setting the *memoryLimit* +option value for individual queries when running an AQL query. + +The default value is *0*, meaning that there is no memory limit. + + ### Enable/disable AQL query tracking `--query.tracking flag` diff --git a/Documentation/Books/Manual/Administration/Configuration/Wal.mdpp b/Documentation/Books/Manual/Administration/Configuration/Wal.mdpp index 6ed12428f9..12090517c8 100644 --- a/Documentation/Books/Manual/Administration/Configuration/Wal.mdpp +++ b/Documentation/Books/Manual/Administration/Configuration/Wal.mdpp @@ -46,6 +46,11 @@ not present, it will be created. @startDocuBlock WalLogfileSyncInterval +### Flush timeout + + +@startDocuBlock WalLogfileFlushTimeout + ### Throttling diff --git a/Documentation/DocuBlocks/WalLogfileFlushTimeout.md b/Documentation/DocuBlocks/WalLogfileFlushTimeout.md new file mode 100644 index 0000000000..3cd3fd2ac9 --- /dev/null +++ b/Documentation/DocuBlocks/WalLogfileFlushTimeout.md @@ -0,0 +1,11 @@ + +@startDocuBlock WalLogfileFlushTimeout +@brief WAL flush timeout +`--wal.flush-timeout + +The timeout (in milliseconds) that ArangoDB will at most wait when flushing +a full WAL logfile to disk. When the timeout is reached and the flush is +not completed, the operation that requested the flush will fail with a +*lock timeout* error. +@endDocuBlock + From 32a6a7bc9d078ad8a23653e39f8b6b9d8a7d217c Mon Sep 17 00:00:00 2001 From: jsteemann Date: Mon, 30 Jan 2017 16:40:55 +0100 Subject: [PATCH 2/3] fix typo in test description --- UnitTests/HttpInterface/api-cursor-spec-noncluster.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/UnitTests/HttpInterface/api-cursor-spec-noncluster.rb b/UnitTests/HttpInterface/api-cursor-spec-noncluster.rb index c7587db9f8..80950ebcc9 100644 --- a/UnitTests/HttpInterface/api-cursor-spec-noncluster.rb +++ b/UnitTests/HttpInterface/api-cursor-spec-noncluster.rb @@ -48,7 +48,7 @@ describe ArangoDB do doc.parsed_response['extra'].should have_key('stats') end - it "testing explicitly disable cache" do + it "testing explicitly disabled cache" do cmd = api body = "{ \"query\" : \"FOR i IN 1..5 RETURN i\", \"cache\" : false }" doc = ArangoDB.log_post("#{prefix}-query-cache-disabled", cmd, :body => body) From 73f4f04f8e46ecf8267ad6682d97120a3a890a83 Mon Sep 17 00:00:00 2001 From: Wilfried Goesgens Date: Mon, 30 Jan 2017 16:56:55 +0100 Subject: [PATCH 3/3] fix binary name --- arangod/dbg.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arangod/dbg.cmake b/arangod/dbg.cmake index 548ae6ac7e..d81497f0b0 100644 --- a/arangod/dbg.cmake +++ b/arangod/dbg.cmake @@ -5,7 +5,7 @@ set(STRIP_DIR "${CMAKE_RUNTIME_OUTPUT_DIRECTORY_X}/strip") execute_process(COMMAND mkdir -p ${STRIP_DIR}) -set(FILE ${CMAKE_RUNTIME_OUTPUT_DIRECTORY_X}/${BIN_ARANGOBENCH}${CMAKE_EXECUTABLE_SUFFIX}) +set(FILE ${CMAKE_RUNTIME_OUTPUT_DIRECTORY_X}/${BIN_ARANGOD}${CMAKE_EXECUTABLE_SUFFIX}) set(STRIP_FILE ${STRIP_DIR}/${BIN_ARANGOD}${CMAKE_EXECUTABLE_SUFFIX}) if (NOT MSVC AND CMAKE_STRIP) execute_process(COMMAND "rm" -f ${STRIP_FILE})