dbcheckperf is a database performance check tool written in Go, based on the Greenplum gpcheckperf utility. It is used to test and verify host hardware performance, including disk I/O, memory bandwidth, and network performance.
- Disk I/O Testing: Uses
ddcommand to test sequential and random read/write performance, single iteration for fast completion, usesoflag=directandconv=fsyncfor accurate results - Random I/O Testing: Default 4K random read/write testing using
ddwithseek/skipparameters for random position access, 100 iterations for quick completion - Disk Latency and IOPS Testing: Uses
ddorfioto test disk read/write latency and IOPS, supports custom block size - Disk Information: Collects disk type (HDD/SSD/NVMe), model, capacity, filesystem, free space, inode usage
- Memory Bandwidth Testing: Uses STREAM benchmark method (Go implementation), actually executes Copy/Scale/Add/Triad memory operations
- Network Performance Testing: Supports iperf3/netperf/curl/TCP stream multiple test methods, automatically selects the best tool
- Network Quality Testing: Measures network latency, packet loss, error rate, TCP retransmit rate, MTU, etc.
- IO Statistics Monitoring: Gets real-time IO metrics from /proc/diskstats (r/s, w/s, await, %util, etc.)
- NUMA Information: Collects NUMA nodes, memory distribution, CPU affinity, device NUMA nodes
- Kernel Parameters: Collects VM/IO/network related kernel parameters, automatically detects unreasonable configurations with warnings
- Hardware Information Collection: Collects CPU model/cores/turbo frequency, disk model/vendor/size, RAID configuration, network card details
- System Information Collection: Automatically collects CPU cores, memory size, network card speed, etc.
- Hardware Detection: Detects VM/physical machine, RAID card model, stripe size, network bonding, queue size, etc.
- Multi-Architecture Support: Compatible with x86/x86_64 (Intel/AMD) and ARM/ARM64 architecture servers
- Tabular Output: Clearly displays test results and summary statistics for each host
- Quick Testing: Single iteration testing for fast performance checks
- SSH Password Authentication: Support testing remote hosts without SSH key-based authentication, using
-Foption to specify authentication file - Smart Advisor & Alerts: Automatic performance scoring (0-100), health status assessment, three-level alerts (INFO/WARNING/CRITICAL), and actionable optimization suggestions
- History Management: Auto-save test results, baseline comparison with previous runs, trend tracking, and tag-based search
- JSON Report Output: Structured JSON reports for integration with monitoring systems and CMDB
- Baseline Comparison:
--baselineoption automatically compares current results with the last test, showing performance change percentages
- Go 1.21 or higher
# Clone or enter project directory
cd /path/to/dbcheckperf
# Build
go build -o dbcheckperf ./cmd/main.go
# Install to GOPATH
go install .# Disk I/O and memory bandwidth testing
dbcheckperf -d <test_dir> [-d <test_dir> ...]
{-f <hostfile> | -h <host> [-h <host> ...]}
[-r ds] [-B <block_size>] [-S <file_size>] [-D] [-v|-V]
# Network testing
dbcheckperf -d <temp_dir>
{-f <hostfile> | -h <host> [-h <host> ...]}
[-r n|N|M [--duration <time>]] [-D] [-v|-V] [--buffer-size <KB>]
# SSH password authentication testing (no SSH key required)
dbcheckperf -d <test_dir> -F <ssh_auth_file> [-r ds] [-B <block_size>] [-S <file_size>] [-D] [-v|-V]| Option | Description | Default |
|---|---|---|
-B <block_size> |
Disk I/O test block size (KB) | 32KB |
-d <dir> |
Test directory (can be specified multiple times) | Required |
-D |
Display detailed results per host | false |
-f <hostfile> |
File containing host list | - |
-F <ssh_auth_file> |
SSH authentication file (format: hostname username password [port]), when specified, -f is not needed |
- |
-h <host> |
Hostname (can be specified multiple times) | - |
-r <test_type> |
Test type: d=disk, s=memory, n/N/M=network, H=hardware, l=latency/IOPS, i=IO stats, u=NUMA, k=kernel params, q=network quality, I=disk info | dsn |
-S <file_size> |
Disk I/O test file size | 2xRAM |
-v |
Verbose mode | false |
-V |
Very verbose mode | false |
--duration <time> |
Network test duration | 15s |
--netperf |
Use netperf for network testing | false |
--buffer-size <KB> |
Network test buffer size | 8KB |
--random-bs <KB> |
Random I/O block size (KB) | 4KB |
--latency-bs <KB> |
Latency and IOPS test block size (KB) | 4KB |
--iostat-interval |
IO statistics sampling interval | 1s |
--net-quality-target |
Network quality test target host | - |
--report <format> |
Report format: html,json,table (default table) | table |
--output <path> |
Report output file path | current dir |
--baseline |
Auto compare with last test result (baseline) | false |
--no-save |
Disable auto-save test results to history | false |
--version |
Display version number | - |
-? |
Display help information | - |
| Code | Test Type | Description |
|---|---|---|
d |
Disk I/O | Test sequential read/write performance |
s |
Memory Stream | Test memory bandwidth |
n |
Network Serial | Test network host by host |
N |
Network Parallel | Test all hosts simultaneously (requires even number of hosts) |
M |
Network Full Matrix | Each host tests with all other hosts |
H |
Hardware Info | Collect and display hardware configuration information |
l |
Latency/IOPS | Test disk read/write latency and IOPS |
i |
IO Statistics | Get real-time IO metrics from /proc/diskstats |
u |
NUMA | Display NUMA topology and memory distribution |
k |
Kernel Parameters | Display VM/IO/network related kernel parameters |
q |
Network Quality | Test network latency, packet loss, retransmit rate, etc. |
I |
Disk Information | Display disk type, model, capacity, filesystem, etc. |
dbcheckperf -f hosts.txt -d /data1 -d /data2 -r dsdbcheckperf -h host1 -h host2 -d /data1 -r d -D -vdbcheckperf -f hosts.txt -r N -d /tmpdbcheckperf -h localhost -d /tmp -B 16k -S 5GB -r dsdbcheckperf -f hosts.txt -r M -d /tmp --duration 30sdbcheckperf -d /tmp -r ds -vdbcheckperf -r H -vdbcheckperf -h localhost -d /tmp -r d --random-bs 8 -vdbcheckperf -h localhost -d /data/nvme -B 256k -S 10GB -r d -vThis tests sequential and random I/O with 256KB block size, suitable for high-performance NVMe SSDs.
dbcheckperf -h server1 -h server2 -h server3 -d /data -r d -D -vThis runs disk I/O tests on 3 hosts and displays detailed results for each host.
dbcheckperf -f hosts.txt -r n -d /tmp --duration 60s -vThis runs a 60-second serial network test for more accurate results.
dbcheckperf -f hosts.txt -d /data -r dsN -D -vThis runs disk I/O, memory bandwidth, and parallel network tests on all hosts.
dbcheckperf -h localhost -d /data -r l -vTest disk read/write latency and IOPS performance using default 4KB block size.
dbcheckperf -r i -vGet real-time IO statistics from /proc/diskstats, including r/s, w/s, await, %util, etc.
dbcheckperf -r u -vDisplay NUMA nodes, per-node CPU/memory distribution, CPU distance matrix.
dbcheckperf -r k -vDisplay VM/IO/network related kernel parameters with automatic detection of unreasonable configurations.
dbcheckperf -h localhost -r q --net-quality-target 8.8.8.8 -vMeasure network latency, packet loss, TCP retransmit rate and other metrics to target host.
dbcheckperf -h localhost -d /data -r I -vDisplay disk type (HDD/SSD/NVMe), model, capacity, filesystem, free space, inode usage.
dbcheckperf -h localhost -d /data -r dslIuk -vRun disk I/O, memory bandwidth, network, latency, disk info, NUMA, and kernel parameter tests in one go.
dbcheckperf -f hosts.txt -r H -vThis collects detailed hardware information from all hosts including CPU, disk, RAID, NIC, and memory details.
This will display:
- CPU Information: Model, cores, sockets, base frequency, turbo frequency, NUMA nodes
- Disk Information: Device name, model, vendor, type (HDD/SSD/NVMe), size, rotational
- RAID Information: RAID card model, cache size, stripe size, RAID level, battery backup
- Network Information: Device name, speed, MTU, queue size, bond status, bond mode, driver, MAC address
dbcheckperf -F ssh_auth.txt -d /data -r ds -vTest remote hosts using SSH password authentication without configuring SSH key-based login.
ssh_auth.txt file content:
192.168.1.100 username password123 22
192.168.1.101 username password456 22
server3 root secret123 2222
Security Recommendation:
# Set file permissions to 600
chmod 600 ssh_auth.txt====================
== System Information
====================
IP Address Virtualization CPU Model CPU Cores Memory Size OS Kernel Version Network Speed
----------------------------------------------------------------------------------------------------------------------------------
192.168.1.100 Physical Intel Xeon E5-2680 16 64.00 GB CentOS 7.9 3.10.0-1160 10000 Mbps
192.168.1.101 KVM AMD EPYC 7K62 32 128.00 GB Ubuntu 20.04 5.4.0-42 25000 Mbps
====================
== Hardware Information
====================
--- CPU Information ---
IP Address CPU Model Cores Sockets Base Freq Turbo Freq NUMA Nodes
--------------------------------------------------------------------------------------------------------------
192.168.1.100 Intel Xeon E5-2680 v3 @ 2.50GHz 12 1 2500 MHz 3300 MHz 1
--- Disk Information ---
Device Model Vendor Type Size Rotational
----------------------------------------------------------------------------------------------------
sda Samsung SSD 860 PRO 1TB Samsung SSD 1.00 TB No
sdb WDC WD4003FFBX-68LU Western Digital HDD 4.00 TB Yes
nvme0n1 INTEL SSDPE2KE016T8 Intel NVMe 1.60 TB No
--- RAID Information ---
Status RAID Model Cache Size Stripe Size RAID Level Battery Backup
-------------------------------------------------------------------------------------------------------------------------
Detected LSI MegaRAID SAS 3508 2.00 GB 256 KB RAID10 Supported
--- Network Information ---
Device Speed MTU Queue Bond Bond Mode Driver MAC Address
---------------------------------------------------------------------------------------------------------------
eth0 10000 Mbps 1500 1024 No - ixgbe 00:1a:2b:3c:4d:5e
eth1 10000 Mbps 1500 1024 No - ixgbe 00:1a:2b:3c:4d:5f
bond0 20000 Mbps 1500 1024 Yes 802.3ad bonding 00:1a:2b:3c:4d:60
====================
== Detailed Hardware Information
====================
--- RAID Information ---
IP Address Status RAID Model Cache Size Stripe Size RAID Level
-------------------------------------------------------------------------------------------------------------------
192.168.1.100 Detected LSI MegaRAID SAS 3508 2.00 GB 256 KB RAID10
192.168.1.101 Detected Broadcom MegaRAID SAS 9460-16i 4.00 GB 512 KB RAID5
--- Network Bonding Information ---
IP Address Bond Status Bond Mode Slave Count Queue Size
-----------------------------------------------------------------------------------------------
192.168.1.100 Bonded 802.3ad Dynamic link aggregation 2 1024
192.168.1.101 Unbonded - - 1000
====================
== Disk I/O Test Results
====================
--- Sequential Write Performance ---
IP Address Time (sec) Data Size Speed (MB/s)
-----------------------------------------------------------------
192.168.1.100 2.68s 7.7 GB 2872.06
192.168.1.101 2.52s 7.7 GB 3065.45
--- Sequential Read Performance ---
IP Address Time (sec) Data Size Speed (MB/s)
-----------------------------------------------------------------
192.168.1.100 2.26s 7.7 GB 3408.01
192.168.1.101 2.15s 7.7 GB 3586.12
--- Random Write Performance ---
IP Address Time (sec) Data Size Speed (MB/s)
-----------------------------------------------------------------
192.168.1.100 120.50s 4.00 GB 35.64
192.168.1.101 125.20s 4.00 GB 34.30
--- Random Read Performance ---
IP Address Time (sec) Data Size Speed (MB/s)
-----------------------------------------------------------------
192.168.1.100 85.30s 4.00 GB 50.35
192.168.1.101 88.70s 4.00 GB 48.42
====================
== Network Performance Test Results
====================
Test Mode: Parallel Mode
--- Summary ---
Total Bandwidth: 450.25 MB/s
Average Bandwidth: 112.56 MB/s
Median Bandwidth: 110.88 MB/s
Minimum Bandwidth: 105.53 MB/s
Maximum Bandwidth: 120.45 MB/s
╔══════════════════════════════════════════════════════════════╗
║ T E S T S U M M A R Y ║
╠══════════════════════════════════════════════════════════════╣
║ Sequential Write Bandwidth: 2872.06 MB/s [server1] ║
║ Sequential Read Bandwidth: 3408.01 MB/s [server1] ║
║ Random Write Bandwidth: 35.64 MB/s [server1] ║
║ Random Read Bandwidth: 50.35 MB/s [server1] ║
║ Memory Bandwidth: 181397.02 MB/s [server1] ║
║ Network Bandwidth: 110.56 MB/s ║
╚══════════════════════════════════════════════════════════════╝
====================
== Comprehensive Test Results
====================
Test Item Average Min Max Notes
---------------------------------------------------------------------------------------------------
Sequential Write 2872.06 MB/s 2872.06 MB/s 2872.06 MB/s 1 test
Sequential Read 3408.01 MB/s 3408.01 MB/s 3408.01 MB/s 1 test
Random Write 35.64 MB/s 35.64 MB/s 35.64 MB/s 1 test
Random Read 50.35 MB/s 50.35 MB/s 50.35 MB/s 1 test
Memory Bandwidth 181397.02 MB/s 181397.02 MB/s 181397.02 MB/s 1 test
Network Bandwidth 110.56 MB/s 110.56 MB/s 110.56 MB/s 1 test
Basic format, requires SSH key-based authentication:
# Basic format
hostname
# With username
username@hostname
# With SSH port
hostname:2222
# Full format
username@hostname:port
Example hosts.txt:
server1
server2
username@server3:2222
192.168.1.100
Supports SSH password authentication, no key-based login required:
# Format: hostname username password [port]
# First column is hostname or IP address
192.168.1.100 username password123 22
192.168.1.101 username password456 22
server3 root secret123 2222
Security Recommendation:
# Set file permissions to 600
chmod 600 ssh_auth.txtdbcheckperf/
├── cmd/
│ └── main.go # Main entry point
├── go.mod # Go module definition
├── README.md # This document
├── README_CN.md # Chinese README
├── QWEN.md # AI context document
├── config/
│ └── config.go # Configuration management
└── pkg/
├── checker/ # Performance checker (modularized)
│ ├── checker.go # Main API entry
│ ├── checker_test.go # Test file
│ ├── common/ # Common utilities (IP, SSH)
│ ├── disk/ # Disk I/O testing + disk info detection
│ ├── network/ # Network testing + network quality testing
│ ├── memory/ # Memory bandwidth testing
│ ├── system/ # System information collection
│ ├── latency/ # Disk latency and IOPS testing
│ ├── iostat/ # IO statistics monitoring
│ ├── numa/ # NUMA information collection
│ └── kernel/ # Kernel parameters collection
├── reporter/
│ └── reporter.go # Report generator (table output)
└── utils/
└── utils.go # Utility functions
Module Description:
- common: Common utility functions (IP resolution, SSH command execution, supports key-based and password authentication)
- disk: Disk I/O testing (sequential/random read/write) + disk type/model/capacity/filesystem detection (supports SSH password authentication)
- network: Network performance testing (iperf3/netperf/curl/TCP stream) + network quality testing (latency/packet loss/retransmit)
- memory: Memory bandwidth testing (STREAM benchmark)
- system: System information collection (CPU, memory, disk, network, virtualization)
- latency: Disk latency and IOPS testing (dd/fio)
- iostat: IO statistics monitoring (/proc/diskstats)
- numa: NUMA information collection (nodes, memory distribution, CPU affinity)
- kernel: Kernel parameters collection (VM/IO/network parameters)
- checker.go: Main API entry, type aliases, backward compatibility
| Test Type | Minimum Expected Value | Description |
|---|---|---|
| Network Bandwidth | 100 MB/s | Below this value, use -r n for serial testing |
| Disk Write | 100 MB/s | Depends on storage type (HDD/SSD) |
| Memory Bandwidth | 20000 MB/s | Depends on memory type and channel count |
- Test Directory Permissions: Users running the tool must have write permissions to all test directories
- File Size: Disk test file size is recommended to be set to 2x system RAM to ensure disk I/O is tested rather than memory cache
- Network Subnet: All hosts in the host file should be on the same subnet during network testing
- Parallel Mode: Network parallel mode (
-r N) recommends using an even number of hosts - SSH Authentication:
- Key-based Login: Traditional method requires SSH key-based authentication setup
- Password Authentication: Use
-Foption to specify SSH authentication file, no key setup required - Authentication File Format:
hostname username password [port] - Security Recommendation: Set SSH authentication file permissions to 600 (
chmod 600 ssh_auth.txt)
- Direct I/O: Uses
oflag=directandiflag=directto bypass system cache - Data Sync: Uses
conv=fsyncto ensure data is actually written to disk - Cache Clear: Clears system cache before each read test
- Data Validation: Validates write data integrity with 1% tolerance
- Quick Test: Single iteration for fast completion
- File Cleanup: Automatically deletes test files after testing
- 4K Random: Uses 4KB block size for random read/write testing by default
- Random Position: Uses
seek/skipparameters for random read/write positioning - 100 Iterations: Executes 100 random read/write operations for quick completion
- Direct I/O: Uses
oflag=directandiflag=directto bypass cache - Default Enabled: Random I/O testing is automatically included with
-r ddisk tests
- Actual Testing: Uses Go implementation of STREAM benchmark, actually executes memory operations
- Four Operations: Copy, Scale, Add, Triad four memory operation tests
- Large Array: Uses 80MB test array to ensure accurate results
- Quick Test: Single iteration for fast completion
- Multiple Methods: Prefers iperf3, then netperf, fallback to TCP stream testing
- Timeout Control: Sets reasonable connection and transfer timeouts
- Data Validation: Validates actual bytes transferred and time
- Quick Test: Single iteration for fast completion
- x86/x86_64: Supports Intel and AMD server CPU detection
- ARM/ARM64: Supports ARM architecture servers (including Qualcomm, Ampere, Apple Silicon, etc.)
- Virtualization Detection: Supports KVM, VMware, Xen, Hyper-V and other virtualization types
- RAID Detection: Supports LSI/Broadcom MegaRAID and other RAID card detection
This tool implements the main features of Greenplum gpcheckperf:
| Feature | gpcheckperf | dbcheckperf |
|---|---|---|
| Disk I/O Testing | ✓ | ✓ |
| Memory Bandwidth Testing | ✓ | ✓ |
| Network Performance Testing | ✓ | ✓ |
| Host File Support | ✓ | ✓ |
| Multi-Directory Testing | ✓ | ✓ |
| Verbose Mode | ✓ | ✓ |
| Per-Host Results | ✓ | ✓ |
| netperf Support | ✓ | ✓ |
This project is licensed under the MIT License.
Issues and feature requests are welcome!