This workload tests Cassandra database performance for data serving scenarios using both container runtimes (runc/runsc) and Firecracker microVMs.
Note: This workload uses standalone mode where the same container image contains both the Cassandra server and client load testing tools.
Use the provided Dockerfile to build the standalone data serving image.
# Build the image
docker build -t mydataserving .
# Start container (this automatically starts Cassandra server)
docker run -id --rm --name worker \
--cpuset-cpus="0-3" \
--memory="24g" \
mydataservingWait 60 seconds for Cassandra server startup
Load test (runs for 15 minutes):
docker exec worker ./load.sh 127.0.0.1 10000000 5000 4 4500000With warmup (if needed):
# First run warmup
docker exec worker ./load.sh 127.0.0.1 10000000 5000 4 4500000
# Then run actual workload
docker exec worker ./load.sh 127.0.0.1 10000000 5000 4 4500000Resize the base image to 32GB (Cassandra data requires more space), then boot the VM and run:
# Install Java + Cassandra 4.1.0 + YCSB (mirrors commons/cassandra/4.1.0/install.sh)
bash fc/setup.shCopy the runtime files into the VM:
cp fc/hosts /etc/hosts
cp fc/start_server.sh /root/start_server.sh
cp fc/cleanup.sh /root/cleanup.sh
cp server/docker-entrypoint.py /root/server-entrypoint.py
cp client/load.sh /root/load.sh
chmod +x /root/start_server.sh /root/cleanup.sh /root/server-entrypoint.py /root/load.shUpdate /etc/hosts to map the hostname to the microVM IP:
sed -i "s/^127\.0\.1\.1.*/# &/" /etc/hosts
echo "169.254.0.1 $(hostname)" >> /etc/hostsSet required environment variables:
export CASSANDRA_HOME=/opt/cassandra
export CASSANDRA_CONFIG=/etc/cassandra
export PATH="$CASSANDRA_HOME/bin:$PATH"Update hostname resolution:
# Comment out default localhost entry
sed -i "s/^127\.0\.1\.1.*/# &/" /etc/hosts
# Add microVM hostname resolution
echo "169.254.0.1 $(hostname)" >> /etc/hosts/root/start_server.shWait 60 seconds for server startup
Load test:
./load.sh 127.0.0.1 10000000 5000 4 4500000With warmup (if needed):
# First run warmup
./load.sh 127.0.0.1 10000000 5000 4 4500000
# Then run actual workload
./load.sh 127.0.0.1 10000000 5000 4 4500000Cleanup logs:
/root/cleanup.sh| Parameter | Description | Example |
|---|---|---|
| Server IP | Cassandra server address | 127.0.0.1 |
| Record Count | Number of records to insert/query | 10000000 (10M) |
| Target Load | Operations per second | 5000 |
| Threads | Number of worker threads | 4 |
| Operation Count | Total operations to perform | 4500000 (5000 * 900s) |
Based on the stress testing script, the workload runs for 15 minutes (900 seconds) at 5000 ops/sec, totaling 4.5M operations.
Standard load test:
./load.sh 127.0.0.1 10000000 5000 4 4500000- Dockerfile - Standalone container with server and client
- server/ - Server-specific configurations
- client/ - Client load testing tools
- fc/ - Firecracker-specific setup scripts
- fc/hosts - Host file for microVM networking