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

  • Documentation
  • Privacy Statement
  • License Agreement
  • Contact Us

This view

  • Original page
  • New address

GeezerVison is showing docs.voltactivedata.com — 5.2. Setting the Database to Read-Only Mode When System Resources Run Low

  • 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
  • VoltDB V16
    • 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
5.2. Setting the Database to Read-Only Mode When System Resources Run Low

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 Existing VoltDB Installations
      • 4.4.1. Upgrading the VoltDB Software
      • 4.4.2. Upgrading VoltDB Using Save and Restore
      • 4.4.3. Upgrading Older Versions of VoltDB Manually
      • 4.4.4. Performing an In-Service Upgrade of a Single Cluster
      • 4.4.5. Performing an Online Upgrade Using Multiple XDCR Clusters
      • 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 Prometheus
    • 5.4. Integrating VoltDB with Datadog
  • 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. Snapshot Management
      • A.3.4. Import and Export
      • A.3.5. Command Logging
      • A.3.6. Heartbeat
      • A.3.7. Temp Table Size
      • A.3.8. Query Timeout
      • A.3.9. Flush Interval
      • A.3.10. Long-Running Process Warning
      • A.3.11. Copying Array Parameters
      • A.3.12. 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. Internal Server Port
      • A.5.4. Metrics Port
      • A.5.5. Replication Port
      • A.5.6. Zookeeper Port
      • A.5.7. TLS/SSL Encryption (Including HTTPS)
  • B. Volt Active Data Metrics▶
    • B.1. Database Tables and Indexes
    • B.2. Transactions, Procedures, and the Planner
    • B.3. Memory and CPU Usage
    • B.4. Client Connections and I/O
    • B.5. High Availability and Durability
    • B.6. Streaming Data
    • B.7. User-Defined Tasks
    • B.8. System and Cluster Status
  • C. Snapshot Utilities▶
    • snapshotconvert
    • snapshottransfer
    • snapshotverifier

5.2. Setting the Database to Read-Only Mode When System Resources Run Low

VoltDB, like all software, uses system resources to perform its tasks. First and foremost, as an in-memory database, VoltDB relies on having sufficient memory available for storing the data and processing queries. However, it also makes use of disk resources for snapshots and caching data for other features, such as export and database replication.

If system resources run low, one or more nodes may fail impacting availability, or worse, causing a service interruption. The best solution for this situation is to plan ahead and provision sufficient resources for your needs. The goal of the VoltDB Planning Guide is to help you do this.

However, even with the best planning, unexpected conditions can result in resource shortages or overuse. In these situations, you want the database to protect itself against all-out failure.

You can do this by setting resource limits in the configuration. System resource limits are set within the deployment.systemsettings.resourcemonitor property. For example:

deployment:
  systemsettings:
    resourcemonitor:
      frequency: 30
      memorylimit:
        size: "70%"
        alert: "60%"
      disklimit:
        snapshots:
          size: "75%"
          alert: "60%"
        droverflow:
          size: "60%"

The deployment file lets you set limits on two types of system resources:

  • Memory Usage

  • Disk Usage

For each resource type you can set the maximum size and, optionally, the level at which an alert is sent if SNMP is enabled. In all cases, the allowable amount of the resource to be used can be specified as either a value representing a number of gigabytes or a percentage of the total available. If the limit set by the alert property is exceeded and SNMP is enabled, an SNMP alert is sent. If the limit set by the size property is exceeded, the database will be "paused", putting it into read-only mode to avoid using any further resources or possibly failing when the resource becomes exhausted. When the database pauses, an error message is written to the log file (and the console) reporting the event. This allows you as the system administrator to correct the situation by reducing memory usage or deleting unnecessary files. Once sufficient resources are freed up, you can return the database to normal operation using the voltadmin resume command.

The resource limits are checked every 60 seconds by default. However, you can adjust how frequently they are checked — to accommodate the relative stability or volatility of your resource usage — using the deployment.systemsettings.resourcemonitor.frequency property. In the preceding example, the frequency has been reduced to 30 seconds.

Of course, the ideal is to catch excessive resource use before the database is forced into read-only mode. Use of SNMP and system monitors such as Nagios and New Relic to generate alerts at limits lower than the VoltDB resource monitor are strongly recommended. And you can integrate other VoltDB monitoring with these monitoring utilities as described in Section 5.3, “Integrating VoltDB with Prometheus”. But the resource monitor size limit is provided as a last resort to ensure the database does not completely exhaust resources and crash before the issue can be addressed.

The following sections describe how to set limits for the individual resource types.

5.2.1. Monitoring Memory Usage

You specify a memory limit in the configuration using the memorylimit property and specifying the maximum allowable resident set size (RSS) for the VoltDB process in the size subproperty. You can express the limit as a fixed number of gigabytes or as a percentage of total available memory. Use a percent sign to specify a percentage.

In addition to pausing the database, you can specify that it runs a full compaction of table data to recover whatever unused space is available due to fragmentation. This is the equivalent of running the voltadmin defrag --full command manually. By setting the compact property to true, when the memory limit is exceeded, the database will pause, defragment all table data on the affected node, and if enough space is recovered to bring memory usage down under the limit, the database will automatically resume normal operation. See the chapter on "Understanding Memory Usage" in the Volt Performance and Customization guide for more information about memory compaction.

For example, the following setting will cause the VoltDB database to go into read-only mode and perform a full compaction if the RSS size exceeds 10 gigabytes on any of the cluster nodes.

deployment:
  systemsettings:
    resourcemonitor:
      memorylimit:
        size: 10
        compact: true

Whereas the following example sets the limit at 70% of total available memory but does not automatically compact memory used for table data.

deployment:
  systemsettings:
    resourcemonitor:
      memorylimit:
        size: "70%"

You can also set a trigger value for SNMP alerts — assuming SNMP is enabled — using the alert property. For instance, the following example sets the SNMP trigger value to 60%.

deployment:
  systemsettings:
    resourcemonitor:
      memorylimit:
        size: "70%"
        alert: "60%"

If you do not specify a limit in the configuration

file, VoltDB automatically sets a maximum size limit of 80% and an SNMP alert level of 70% by default.

5.2.2. Monitoring Disk Usage

You specify disk usage limits in the configuration using the disklimit property. The disklimit property specifies the limits for a device based on the Volt feature that utilizes it, using the feature name as a subproperty. For example, to set a limit on the amount of space used on the device where automatic snapshots are stored, you add the snapshots subproperty and specify the limit as a number of gigabytes or as a percentage of total space on the disk. The following configuration sets the disk limit for snapshots at 200 gigabytes and the limit for command logs at 70% of the total available space:

deployment:
  systemsettings:
    resourcemonitor:
      disklimit:
        snapshots:
          size: 200
        commandlog:
          size: "70%"

You can also set a trigger value for SNMP alerts — assuming SNMP is enabled — using the alert subproperty. For instance, the following example sets the SNMP trigger value to 150 gigabytes for the snapshots disk and 60% for the commandlog disk.

deployment:
  systemsettings:
    resourcemonitor:
      disklimit:
        snapshots:
          size: 200
          alert: 150
        commandlog:
          size: "70%"
          alert: "60%"

Note that you specify the device based on the feature that uses it. However, the limits applies to all data on that device, not just the space used by that feature. If you specify limits for two features that use the same device, the lower of the two limits will be applied. So, in the previous example, if snapshots and command logs both use a device with 250 gigabytes of total space, the database will be set to read-only mode if the total amount of used space exceeds the command logs limit of 70%, or 175 gigabytes.

It is also important to note that there are no default resource limits or alerts for disks. If you do not explicitly specify a disk limit, there is no protection against running out of disk space. Similarly, unless you explicitly set an SNMP alert level, no alerts will be sent for the associated device.

You can identify disk limits and alerts for any of the following Volt features, using the specified keywords as the subproperty name:

  • Automated snapshots (snapshots)

  • Command logs (commandlog)

  • Command log snapshots (commandlogsnapshot)

  • Database replication overflow (droverflow)

  • Export overflow (exportoverflow)

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.