Skip to content

Latest commit

 

History

History
145 lines (104 loc) · 3.54 KB

File metadata and controls

145 lines (104 loc) · 3.54 KB

Data Serving - Cassandra Database Workload

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.

For Docker (runc/runsc)

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" \
  mydataserving

Wait 60 seconds for Cassandra server startup

Run Workload

Load test (runs for 15 minutes):

docker exec worker ./load.sh 127.0.0.1 10000000 5000 4 4500000

With 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 4500000

For Firecracker (fc)

Building the Firecracker Image

Resize 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.sh

Copy 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.sh

Update /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/hosts

1. Environment Setup

Set required environment variables:

export CASSANDRA_HOME=/opt/cassandra
export CASSANDRA_CONFIG=/etc/cassandra
export PATH="$CASSANDRA_HOME/bin:$PATH"

2. Network Configuration

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

3. Start Cassandra Server

/root/start_server.sh

Wait 60 seconds for server startup

4. Run Workload

Load test:

./load.sh 127.0.0.1 10000000 5000 4 4500000

With 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 4500000

Cleanup logs:

/root/cleanup.sh

Load Test Parameters

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)

Command Reference

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

Files

  • 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