Skip to content

Commit 5dac9a7

Browse files
nerpaulaSimran-B
andauthored
Compression of requests and responses between ArangoDB server and client tools (#393)
* compression of requests and responses * Review --------- Co-authored-by: Simran Spiller <[email protected]>
1 parent a5f66fb commit 5dac9a7

File tree

2 files changed

+83
-10
lines changed

2 files changed

+83
-10
lines changed

site/content/3.12/components/tools/arangorestore/examples.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,17 @@ also restored or already present on the server.
191191

192192
See [_arangodump_](../arangodump/examples.md#encryption) for details.
193193

194+
## Compression
195+
196+
You can optionally let *arangorestore* compress the data for the network transfer
197+
with the `--compress-transfer` startup option. This can reduce the traffic and
198+
thus save time. Set the `--compress-request-threshold` startup option to define
199+
the minimum size for request bodies (in bytes) at which compression is applied.
200+
201+
```
202+
arangorestore --input-directory "dump" --compress-transfer --compress-request-threshold 250
203+
```
204+
194205
## Reloading Data into a different Collection
195206

196207
_arangorestore_ restores documents and edges with the exact same `_key`,

site/content/3.12/release-notes/version-3.12/whats-new-in-3-12.md

Lines changed: 72 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,63 @@ The previously fixed limit of 128 MiB for [Stream Transactions](../../develop/tr
201201
can now be configured with the new `--transaction.streaming-max-transaction-size`
202202
startup option. The default value remains 128 MiB.
203203

204+
### Transparent compression of requests and responses between ArangoDB servers and client tools
205+
206+
The following startup options have been added to all
207+
[client tools](../../components/tools/_index.md) (except the ArangoDB Starter)
208+
and can be used to enable transparent compression of the data that is sent
209+
between a client tool and an ArangoDB server:
210+
211+
- `--compress-transfer`
212+
- `--compress-request-threshold`
213+
214+
If the `--compress-transfer` option is set to `true`, the client tool adds an
215+
extra `Accept-Encoding: deflate` HTTP header to all requests made to the server.
216+
This allows the server to compress its responses before sending them back to the
217+
client tool.
218+
219+
The client also transparently compresses its own requests to the server if the
220+
size of the request body (in bytes) is at least the value of the
221+
`--compress-request-threshold` startup option. The default value is `0`, which
222+
disables the compression of the request bodies in the client tool. To opt in to
223+
sending compressed data, set the option to a value greater than `0`.
224+
The client tool adds a `Content-Encoding: deflate` HTTP header to the request
225+
if the request body is compressed using the deflate compression algorithm.
226+
227+
The following options have been added to the ArangoDB server:
228+
229+
- `--http.compress-response-threshold`
230+
- `--http.handle-content-encoding-for-unauthenticated-requests`
231+
232+
The value of the `--http.compress-response-threshold` startup option specifies
233+
the threshold value (in bytes) from which on response bodies are sent out
234+
compressed by the server. The default value is `0`, which disables sending out
235+
compressed response bodies. To enable compression, the option should be set to a
236+
value greater than `0`. The selected value should be large enough to justify the
237+
compression overhead. Regardless of the value of this option, the client has to
238+
signal that it expects a compressed response body by sending an
239+
`Accept-Encoding: gzip` or `Accept-Encoding: deflate` HTTP header with its request.
240+
If that header is missing, no response compression is performed by the server.
241+
242+
If the `--http.handle-content-encoding-for-unauthenticated-requests`
243+
startup option is set to `true`, the ArangoDB server automatically decompresses
244+
incoming HTTP requests with `Content-Encodings: gzip` or
245+
`Content-Encoding: deflate` HTTP header even if the request is not authenticated.
246+
If the option is set to `false`, any unauthenticated request that has a
247+
`Content-Encoding` header set is rejected. This is the default setting.
248+
249+
{{< info >}}
250+
As compression uses CPU cycles, it should be activated only when the network
251+
communication between the server and clients is slow and there is enough CPU
252+
capacity left for the extra compression/decompression work.
253+
254+
Furthermore, requests and responses should only be compressed when they exceed a
255+
certain minimum size, e.g. 250 bytes.
256+
257+
Request and response compression is only supported for responses that use the
258+
HTTP/1.1 or HTTP/2 protocol, and not when using the VelocyStream (VST) protocol.
259+
{{< /info >}}
260+
204261
### LZ4 compression for values in the in-memory edge cache
205262

206263
<small>Introduced in: v3.11.2</small>
@@ -309,16 +366,6 @@ the queue might grow and eventually overflow.
309366
You can configure the upper bound of the queue with this option. If the queue is
310367
full, log entries are written synchronously until the queue has space again.
311368

312-
## Client tools
313-
314-
### arangodump
315-
316-
_arangodump_ now supports a `--ignore-collection` startup option that you can
317-
specify multiple times to exclude the specified collections from a dump.
318-
319-
It cannot be used together with the existing `--collection` option for specifying
320-
collections to include.
321-
322369
## Miscellaneous changes
323370

324371
### Active AQL query cursors metric
@@ -445,6 +492,14 @@ The following metric as been added:
445492

446493
### arangodump
447494

495+
### `--ignore-collection` startup option
496+
497+
_arangodump_ now supports a `--ignore-collection` startup option that you can
498+
specify multiple times to exclude the specified collections from a dump.
499+
500+
It cannot be used together with the existing `--collection` option for specifying
501+
collections to include.
502+
448503
#### Improved dump performance and size
449504

450505
From version 3.12 onward, _arangodump_ has extended parallelization capabilities
@@ -535,5 +590,12 @@ The following file extensions are automatically detected:
535590
If the file extension doesn't correspond to any of the mentioned types, the
536591
import defaults to the `json` format.
537592

593+
### Transparent compression of requests and responses
594+
595+
Startup options to enable transparent compression of the data that is sent
596+
between a client tool and the ArangoDB server have been added. See the
597+
[Server options](#transparent-compression-of-requests-and-responses-between-arangodb-servers-and-client-tools)
598+
section above that includes a description of the added client tool options.
599+
538600
## Internal changes
539601

0 commit comments

Comments
 (0)