@@ -26,7 +26,7 @@ format or ArangoDB's custom [VelocyPack](https://github.com/arangodb/velocypack)
2626binary format. Details on the expected format and JSON attributes can be found
2727in the documentation of the individual API endpoints.
2828
29- Clients sending requests to ArangoDB must use either HTTP 1.0, HTTP 1. 1, HTTP 2
29+ Clients sending requests to ArangoDB must use either HTTP 1.1, HTTP 2
3030or VelocyStream. Other HTTP versions or protocols are not supported by ArangoDB.
3131
3232Clients are required to include the ` Content-Length ` HTTP header with the
@@ -39,19 +39,16 @@ HTTP Keep-Alive
3939---------------
4040
4141ArangoDB supports HTTP keep-alive. If the client does not send a ` Connection `
42- header in its request, and the client uses HTTP version 1.1, ArangoDB will assume
43- the client wants to keep alive the connection.
42+ header in its request, ArangoDB will assume the client wants to keep alive the
43+ connection.
4444If clients do not wish to use the keep-alive feature, they should
4545explicitly indicate that by sending a ` Connection: Close ` HTTP header in
4646the request.
4747
48- ArangoDB will close connections automatically for clients that send requests
49- using HTTP 1.0, except if they send an ` Connection: Keep-Alive ` header.
50-
5148The default Keep-Alive timeout can be specified at server start using the
5249` --http.keep-alive-timeout ` startup option.
5350
54- Establishing TCP connections is expensive, since it takes several ping pongs
51+ Establishing TCP connections is expensive, since it takes several roundtrips
5552between the communication parties. Therefore you can use connection keep-alive
5653to send several HTTP request over one TCP-connection;
5754each request is treated independently by definition. You can use this feature
@@ -540,14 +537,13 @@ The following APIs may use request forwarding:
540537
541538- ` /_api/control_pregel `
542539- ` /_api/cursor `
543- - ` /_api/document `
544540- ` /_api/job `
545541- ` /_api/replication `
546542- ` /_api/query `
547543- ` /_api/tasks `
548544- ` /_api/transaction `
549545
550- Note: since forwarding such requests require an additional cluster-internal HTTP
546+ Note: since forwarding such requests requires an additional cluster-internal HTTP
551547request, they should be avoided when possible for best performance. Typically
552548this is accomplished either by directing the requests to the correct Coordinator
553549at a client-level or by enabling request "stickiness" on a load balancer. Since
@@ -557,3 +553,50 @@ request forwarding as a fall-back solution.
557553Note: some endpoints which return "global" data, such as ` GET /_api/tasks ` will
558554only return data corresponding to the server on which the request is executed.
559555These endpoints will generally not work well with load-balancers.
556+
557+ Overload control
558+ ----------------
559+
560+ <small >Introduced in: v3.9.0</small >
561+
562+ _ arangod_ returns an ` x-arango-queue-time-seconds ` HTTP
563+ header with all responses. This header contains the most recent request
564+ queueing/dequeuing time (in seconds) as tracked by the server's scheduler.
565+ This value can be used by client applications and drivers to detect server
566+ overload and react on it.
567+
568+ The arangod startup option ` --http.return-queue-time-header ` can be set to
569+ ` false ` to suppress these headers in responses sent by arangod.
570+
571+ In a cluster, the value returned in the ` x-arango-queue-time-seconds ` header
572+ is the most recent queueing/dequeuing request time of the Coordinator the
573+ request was sent to, except if the request is forwarded by the Coordinator to
574+ another Coordinator. In that case, the value will indicate the current
575+ queueing/dequeuing time of the forwarded-to Coordinator.
576+
577+ In addition, client applications and drivers can optionally augment the
578+ requests they send to arangod with the header ` x-arango-queue-time-seconds ` .
579+ If set, the value of the header should contain the maximum server-side
580+ queuing time (in seconds) that the client application is willing to accept.
581+ If the header is set in an incoming request, arangod will compare the current
582+ dequeuing time from its scheduler with the maximum queue time value contained
583+ in the request header. If the current queueing time exceeds the value set
584+ in the header, arangod will reject the request and return HTTP 412
585+ (precondition failed) with the error code 21004 (queue time violated).
586+ Using a value of 0 or a non-numeric value in the header will lead to the
587+ header value being ignored by arangod.
588+
589+ There is also a metric ` arangodb_scheduler_queue_time_violations_total `
590+ that is increased whenever a request is dropped because of the requested
591+ queue time not being satisfiable. Administrators can use this metric to monitor
592+ overload situations. Although all instance types will expose this metric,
593+ it will likely always be ` 0 ` on DB-Servers and agency instances because the
594+ ` x-arango-queue-time-seconds ` header is not used in cluster-internal requests.
595+
596+ In a cluster, the ` x-arango-queue-time-seconds ` request header will be
597+ checked on the receiving Coordinator, before any request forwarding. If the
598+ request is forwarded by the Coordinator to a different Coordinator, the
599+ receiving Coordinator will also check the header on its own.
600+ Apart from that, the header will not be included in cluster-internal requests
601+ executed by the Coordinator, e.g. when the Coordinator issues sub-requests
602+ to DB-Servers or Agency instances.
0 commit comments