Reputation: 3991
Using ArangoDB 2.3.1. It seems my cursors are expiring within a couple minutes. I would like them to last for an hour. I've set up my AQL query object with the TTL parameter as follows:
{
"query": 'removed actual query',
"count": true,
"batchSize": 5,
"ttl": 3600000
}
My understanding is that the TTL parameter should tell the server to keep the server for 3600000 milliseconds or 1 hour. But it expires within about 60 seconds. In fact, I've tried changing the TTL to several different numbers and it doesn't seem to do anything. Any ideas?
UPDATE: the actual error I receive from arango is "cursor not found"
Upvotes: 2
Views: 1648
Reputation: 1
[I had this same question but server-wide, and it was hard for me to find the answer, and this question came up near the top in searches, so I'm documenting here for posterity.]
The server-wide setting is query.registry-ttl
, as per https://www.arangodb.com/docs/stable/programs-arangod-options.html and you can get the current server settings with
To list the configuration options of a running arangod instance, you can connect with an ArangoShell and invoke a Transaction by calling db._executeTransaction() and providing a JavaScript function to retrieve the server options:
arangosh> db._executeTransaction({ collections: {}, action: function() {return require("internal").options();} })
as per https://www.arangodb.com/docs/stable/administration-configuration.html#ex-listCurrentConfigOpts
Upvotes: 0
Reputation: 9097
All of you are right. But I think it is a bug in 2.3:
--- a/arangod/V8Server/v8-vocbase.cpp
+++ b/arangod/V8Server/v8-vocbase.cpp
@@ -1216,13 +1216,13 @@ static v8::Handle<v8::Value> JS_ExecuteAql (v8::Arguments const& argv) {
optionName = v8::String::New("ttl");
if (argValue->Has(optionName)) {
- ttl = TRI_ObjectToBoolean(argValue->Get(optionName));
+ ttl = TRI_ObjectToDouble(argValue->Get(optionName));
ttl = (ttl <= 0.0 ? 30.0 : ttl);
}
ttl is a double and so it should be casted to a double, not a bool. Unfortunately, assigning a bool to a double is valid in C++ so the compiler hasn't complained.
Upvotes: 4
Reputation: 3837
Have you tried using the timeout directive?
--server.keep-alive-timeout=X
Where X is in seconds.
Or you can insert this into your arangod.conf file under the server section as
keep-alive-timout=X
According to the manual
Allows to specify the timout for HTTP keep-alive connections. The timeout value must be in seconds. Idle keep-alive connections will be closed by the server automatically when the timeout is reached.
Upvotes: 0