ArangoDB Server JavaScript Options

JavaScript code execution

—javascript.allow-admin-execute

This option can be used to control whether user-defined JavaScript codeis allowed to be executed on server by sending via HTTP to the API endpoint/admin/execute with an authenticated user account.The default value is _false, which disables the execution of user-definedcode. This is also the recommended setting for production. In test environments,it may be convenient to turn the option on in order to send arbitrary setupor teardown commands for execution on the server.

V8 contexts

—javascript.v8-contexts number

Specifies the maximum number of V8 contexts that are created for executingJavaScript code. More contexts allow executing more JavaScript actions inparallel, provided that there are also enough threads available. Please notethat each V8 context will use a substantial amount of memory and requiresperiodic CPU processing time for garbage collection.

Note that this value configures the maximum number of V8 contexts that can beused in parallel. Upon server start only as many V8 contexts will be created asare configured in option —javascript.v8-contexts-minimum. The actual number ofavailable V8 contexts may float at runtime between —javascript.v8-contexts-minimumand —javascript.v8-contexts. When there are unused V8 contexts that linger around,the server’s garbage collector thread will automatically delete them.

—javascript.v8-contexts-minimum number

Specifies the minimum number of V8 contexts that will be present at any timethe server is running. The actual number of V8 contexts will never drop below thisvalue, but it may go up as high as specified via the option —javascript.v8-contexts.

When there are unused V8 contexts that linger around and the number of V8 contextsis greater than —javascript.v8-contexts-minimum the server’s garbage collectorthread will automatically delete them.

—javascript.v8-contexts-max-invocations

Specifies the maximum number of invocations after which a used V8 context isdisposed. The default value of —javascript.v8-contexts-max-invocations is 0,meaning that the maximum number of invocations per context is unlimited.

—javascript.v8-contexts-max-age

Specifies the time duration (in seconds) after which time a V8 context is disposedautomatically after its creation. If the time is elapsed, the context will be disposed.The default value for —javascript.v8-contexts-max-age is 60 seconds.

If both —javascript.v8-contexts-max-invocations and —javascript.v8-contexts-max-ageare set, then the context will be destroyed when either of the specified thresholdvalues is reached.

Garbage collection frequency (time-based)

—javascript.gc-frequency frequency

Specifies the frequency (in seconds) for the automatic garbage collection ofJavaScript objects. This setting is useful to have the garbage collection stillwork in periods with no or little numbers of requests.

Garbage collection interval (request-based)

—javascript.gc-interval interval

Specifies the interval (approximately in number of requests) that the garbagecollection for JavaScript objects will be run in each thread.

V8 options

—javascript.v8-options options

Optional arguments to pass to the V8 Javascript engine. The V8 engine will runwith default settings unless explicit options are specified using thisoption. The options passed will be forwarded to the V8 engine which will parsethem on its own. Passing invalid options may result in an error being printed onstderr and the option being ignored.

Options need to be passed in one string, with V8 option names being prefixedwith double dashes. Multiple options need to be separated by whitespace. To geta list of all available V8 options, you can use the value ”—help” as follows:

  1. --javascript.v8-options="--help"

Another example of specific V8 options being set at startup:

  1. --javascript.v8-options="--log"

Names and features or usable options depend on the version of V8 being used, andmight change in the future if a different version of V8 is being used inArangoDB. Not all options offered by V8 might be sensible to use in the contextof ArangoDB. Use the specific options only if you are sure that they are notharmful for the regular database operation.

Enable or Disable V8 JavaScript Engine entirely

  1. --javascript.enabled bool

In certain types of ArangoDB instances you can now completely disable the V8JavaScript engine. Be aware that this is an highly experimental feature andit is to be expected that certain functionality (e.g. some API endpoints, theWebUI, some AQL functions etc) will be missing or severely broken. Neverthelessyou may wish to reduce the footprint of ArangoDB by disabling V8.

This option is expected to only work reliably on a single server, DBServer,or agency. Do not try to use this feature on a coordinator or in the ActiveFailover setup.

Copy JavaScript Installation files

  1. --javascript.copy-installation bool

Copy contents of ‘javascript.startup-directory’ on first start of the server. This optionis intended to be useful for rolling upgrades. Setting this to true means that you canupgrade the underlying ArangoDB packages, without influencing the running arangod instance.Setting this value does only make sense if you use ArangoDB outside of a container solution,like Docker, Kubernetes, etc.