GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • V11 Documentation
  • Privacy Statement
  • License Agreement
  • Contact Us

This view

  • Original page
  • New address

GeezerVison is showing docs.voltdb.com — 2.3. Configure Memory Management

  • Volt Active Data
  • Developer Hub
  • Books
    • VoltDB Tutorial
    • Using VoltDB
    • VoltDB Guide to Performance and Customization
    • VoltDB Administrator's Guide
    • Volt Kubernetes Administrator's Guide
    • VoltDB Quick Reference
  • Current docs ▶
  • VoltDB V11
    • VoltDB V16
    • VoltDB V15.3 LTS
    • VoltDB V14.3 LTS
    • VoltDB V13.3 LTS
    • VoltDB V12.3 LTS
    • VoltDB V11.4
    • VoltDB V10.2
    • VoltDB V9.3
2.3. Configure Memory Management

Administrator's Guide

  • Preface▶
    • 1. Structure of This Book
    • 2. Related Documents
  • 1. Managing Volt Active Data Databases▶
    • 1.1. Getting Started
    • 1.2. Understanding the VoltDB Utilities
    • 1.3. Management Tasks
  • 2. Preparing the Servers▶
    • 2.1. Server Checklist
    • 2.2. Install Required Software
    • 2.3. Configure Memory Management
      • 2.3.1. Disable Swapping
      • 2.3.2. Disable Transparent Huge Pages
      • 2.3.3. Enable Virtual Memory Mapping and Overcommit
    • 2.4. Turn off TCP Segmentation
    • 2.5. Configure Time Services
    • 2.6. Increase Resource Limits
    • 2.7. Configure the Network
    • 2.8. Assign Network Ports
    • 2.9. Eliminating Server Process Latency
  • 3. Starting and Stopping the Database▶
    • 3.1. Configuring the Cluster and Database
    • 3.2. Initializing the Database Root Directory
    • 3.3. Starting the Database
    • 3.4. Loading the Database Definition
      • 3.4.1. Preloading the Schema and Classes When You Initialize the Database
      • 3.4.2. Loading the Schema and Classes After the Database Starts
    • 3.5. Stopping the Database
    • 3.6. Restarting the Database
    • 3.7. Starting and Stopping Individual Servers
  • 4. Maintenance and Upgrades▶
    • 4.1. Backing Up the Database
    • 4.2. Updating the Database Schema
      • 4.2.1. Performing Live Schema Updates
      • 4.2.2. Performing Updates Using Save and Restore
    • 4.3. Upgrading the Cluster
      • 4.3.1. Performing Server Upgrades
      • 4.3.2. Performing Rolling Hardware Upgrades on K-Safe Clusters
      • 4.3.3. Adding Servers to a Running Cluster with Elastic Scaling
      • 4.3.4. Removing Servers from a Running Cluster with Elastic Scaling
      • 4.3.5. Reconfiguring the Cluster During a Maintenance Window
    • 4.4. Upgrading VoltDB Software
      • 4.4.1. Upgrading VoltDB Using Save and Restore
      • 4.4.2. Upgrading Older Versions of VoltDB Manually
      • 4.4.3. Upgrading VoltDB With Reduced Downtime Using a DR Replica
      • 4.4.4. Performing an Online Upgrade Using Multiple XDCR Clusters
      • 4.4.5. Performing an Online Upgrade With Limited Hardware
      • 4.4.6. Downgrading, or Falling Back to a Previous VoltDB Version
    • 4.5. Updating the VoltDB Software License
  • 5. Monitoring VoltDB Databases▶
    • 5.1. Monitoring Overall Database Activity
      • 5.1.1. Volt Management Center
      • 5.1.2. System Procedures
      • 5.1.3. SNMP Alerts
    • 5.2. Setting the Database to Read-Only Mode When System Resources Run Low
      • 5.2.1. Monitoring Memory Usage
      • 5.2.2. Monitoring Disk Usage
    • 5.3. Integrating VoltDB with Other Monitoring Systems
      • 5.3.1. Integrating with Prometheus
      • 5.3.2. Integrating with Nagios
      • 5.3.3. Integrating with New Relic
  • 6. Logging and Analyzing Activity in a VoltDB Database▶
    • 6.1. Introduction to Logging
    • 6.2. Creating the Logging Configuration File
    • 6.3. Changing the Timezone of Log Messages
    • 6.4. Managing VoltDB Log Files
    • 6.5. Enabling Your Custom Log Configuration When Starting VoltDB
    • 6.6. Changing the Configuration on the Fly
  • 7. What to Do When Problems Arise▶
    • 7.1. Where to Look for Answers
    • 7.2. Handling Errors When Restoring a Database
      • 7.2.1. Logging Constraint Violations
      • 7.2.2. Safe Mode Recovery
    • 7.3. Collecting the Log Files
  • A. Server Configuration Options▶
    • A.1. Server Configuration Options
      • A.1.1. Network Configuration (DNS)
      • A.1.2. Time Configuration
    • A.2. Process Configuration Options
      • A.2.1. Maximum Heap Size (VOLTDB_HEAPMAX)
      • A.2.2. Garbage Collector (VOLTDB_GC_OPTS)
      • A.2.3. Other Java Runtime Options (VOLTDB_OPTS)
    • A.3. Database Configuration Options
      • A.3.1. Sites per Host
      • A.3.2. K-Safety
      • A.3.3. Network Partition Detection
      • A.3.4. Automated Snapshots
      • A.3.5. Import and Export
      • A.3.6. Command Logging
      • A.3.7. Heartbeat
      • A.3.8. Temp Table Size
      • A.3.9. Query Timeout
      • A.3.10. Flush Interval
      • A.3.11. Long-Running Process Warning
      • A.3.12. Copying Array Parameters
      • A.3.13. Transaction Prioritization
      • A.3.14. Clock Skew
    • A.4. Path Configuration Options
      • A.4.1. VoltDB Root
      • A.4.2. Snapshots Path
      • A.4.3. Export Overflow Path
      • A.4.4. Command Log Path
      • A.4.5. Command Log Snapshots Path
    • A.5. Network Ports
      • A.5.1. Client Port
      • A.5.2. Admin Port
      • A.5.3. Web Interface Port (http)
      • A.5.4. Internal Server Port
      • A.5.5. Replication Port
      • A.5.6. Topics Port
      • A.5.7. Zookeeper Port
      • A.5.8. TLS/SSL Encryption (Including HTTPS)
  • B. Snapshot Utilities▶
    • snapshotconvert
    • snapshotverifier

2.3. Configure Memory Management

Because VoltDB is an in-memory database, proper memory management is vital to the effective operation of VoltDB databases. Three important aspects of memory management are:

  • Swapping

  • Memory Mapping (Transparent Huge Pages)

  • Virtual memory

The following sections explain how best to configure these features for optimal performance of VoltDB.

2.3.1. Disable Swapping

Swapping is an operating system feature that optimizes memory usage when running multiple processes by swapping processes in and out of memory. However, any contention for memory, including swapping, will have a very negative impact on VoltDB performance and functionality. You should disable swapping when using VoltDB.

To disable swapping on Linux systems, use the swapoff command. Alternately, you can set the kernel parameter vm.swappiness to zero.

2.3.2. Disable Transparent Huge Pages

Transparent Huge Pages (THP) are another operating system feature that optimizes memory usage for systems with large amounts of memory. THP changes the memory mapping to use larger physical pages. This can be helpful for general-purpose computing running multiple processes. However, for memory-intensive applications such as VoltDB, THP can actually negatively impact performance.

Therefore, it is important to disable Transparent Huge Pages on servers running VoltDB. The following commands, run as root or from another privileged account, disable THP:

$ echo never >/sys/kernel/mm/transparent_hugepage/enabled 
$ echo never >/sys/kernel/mm/transparent_hugepage/defrag

Or:

$ echo madvise >/sys/kernel/mm/transparent_hugepage/enabled 
$ echo madvise >/sys/kernel/mm/transparent_hugepage/defrag

For RHEL systems (including CentOS), replace "transparent_hugepage" with "redhat_transparent_hugepage".

Note, however, that these commands disable THP only while the server is running. Once the server reboots, the default setting will return. Therefore, we recommend you disable THP permanently as part of the startup process. For example, you can add the following commands to a server startup script (such as /etc/rc.local):

#!/bin/bash
for f in /sys/kernel/mm/*transparent_hugepage/enabled; do
    if test -f $f; then echo never > $f; fi
done
for f in /sys/kernel/mm/*transparent_hugepage/defrag; do
    if test -f $f; then echo never > $f; fi
done 

THP are enabled by default in Ubuntu 14.04 and later as well as RHEL 6.x and 7.x. To see if they are enabled on your current system, use either of the following pair of commands:

$ cat /sys/kernel/mm/transparent_hugepage/enabled
$ cat /sys/kernel/mm/transparent_hugepage/defrag

$ cat /sys/kernel/mm/redhat_transparent_hugepage/enabled
$ cat /sys/kernel/mm/redhat_transparent_hugepage/defrag

If THP is disabled, the output from the preceding commands should be either “always madvise [never]” or “always [madvise] never”.

2.3.3. Enable Virtual Memory Mapping and Overcommit

Although swapping is bad for memory-intensive applications like VoltDB, the server does make use of virtual memory (VM) and there are settings that can help VoltDB make effective use of that memory. First, it is a good idea to enable VM overcommit. This avoids VoltDB encountering unnecessary limits when managing virtual memory. This is done on Linux by setting the system parameter vm.overcommit_memory to a value of "1".

$ sysctl -w vm.overcommit_memory=1

Second, for large memory systems, it is also a good idea to increase the VM memory mapping limit. So for servers with 64 Gigabytes or more of memory, the recommendation is to increase VM memory map count to 1048576. You do this on Linux with the system parameter max_map_count. For example:

$ sysctl -w vm.max_map_count=1048576

Remember that for both overcommit and the memory map count, the parameters are only active while the system is running and will be reset to the default on reboot. So be sure to add your new settings to the file /etc/sysctl.conf to ensure they are in effect when the system is restarted.

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.