In addition to system settings, there are configuration options pertaining to the VoltDB server process itself that can impact performance. Runtime configuration options are set as command line options when starting the VoltDB server process.
The key process configuration for VoltDB is the Java maximum heap size. It is also possible to specify which garbage collector to use and to pass other arguments to the Java Virtual Machine directly.
The heap size is a parameter associated with the Java runtime environment. Certain portions of the VoltDB server software use the Java heap. In particular, the part of the server that receives and responds to stored procedure requests uses the Java heap.
Depending upon how many transactions your application executes a second, you may need additional heap space. The higher the throughput, the larger the maximum heap needed to avoid running out of memory.
In general, a maximum heap size of two gigabytes (2048) is recommended. For production use, a more accurate measurement of the needed heap size can be calculated from the size of the schema (number of tables), number of sites per host, and what durability and availability features are in use. See the VoltDB Planning Guide for details.
It is important to remember that the heap size is not directly related to data storage capacity. Increasing the maximum heap size does not provide additional data storage space. In fact, quite the opposite. Needlessly increasing the maximum heap size reduces the amount of memory available for storage.
To set the maximum heap size when starting VoltDB, define the environment variable VOLTDB_HEAPMAX as an integer value (in megabytes) before issuing the voltdb start command. For example, the following commands start VoltDB with a 3 gigabyte heap size (the default is 2 gigabytes):
$ export VOLTDB_HEAPMAX="3072" $ voltdb start --dir=~/mydb -H serverA
The Java garbage collector (GC) intermittently frees up unused memory. Different garbage collectors use different algorithms for choosing when and how to do garbage collection. They also can have specific variables to further refine the garbage collection process.
Because Java processing can pause while the collector recycles memory, it can impact your application's latency. By default, for Java versions 8 and 11, VoltDB uses the following settings:
For Java version 17, VoltDB uses the G1GC garbage collector with default settings. You can choose an alternate Java garbage collector by specifying your choice using the standard Java syntax in the VOLTDB_GC_OPTS environment variable before starting the database process. You can include any other GC-related options at the same time. For example:
$ export VOLTDB_GC_OPTS="-XX+useG1GC -XX+UseStringDeduplication" $ voltdb start --dir=~/mydb -H serverA
See the Java documentation for your current Java implementation for more information on garbage collection and GC settings.
VoltDB does not validate the correctness of the arguments you specify using VOLTDB_GC_OPTS or their appropriateness for use with VoltDB. This feature is intended for experienced users only and should be used with extreme caution.
VoltDB sets the Java options — such as heap size and classpath — that directly impact VoltDB. There are a number of other configuration options available in the Java Virtual machine (JVM).
VoltDB provides a mechanism for passing arbitrary options directly to the JVM. If the environment variable VOLTDB_OPTS is defined, its value is passed as arguments to the Java command line. Note that the contents of VOLTDB_OPTS are added to the Java command line on the current server only. In other words, you must define VOLTDB_OPTS on each server to have it take effect for all servers.
VoltDB does not validate the correctness of the arguments you specify using VOLTDB_OPTS or their appropriateness for use with VoltDB. This feature is intended for experienced users only and should be used with extreme caution.