Speed Test for Wasabi With Dell ObjectScale

Prev Next

If you are using the Wasabi US-East-1 region, you can use one of the scripts in this article (depending on your platform—Mac/Linux or Windows) to run a speed test against your Wasabi account. Note:

  • Install s5cmd and Python to run the script.

  • When the script prompts, enter your Wasabi access and secret keys before running the test.

  • The script runs upload and download speed tests using a 500 MB file.

  • The speed is displayed in MB/s. Multiply by 8 for the speed in Mb/s.

Bash Script

#!/bin/bash
set -e

# ==============================
# Configuration
# ==============================
BUCKET="bw-test1-speedtest-$(date +%s)"
ENDPOINT="https://s3.us-east-1-dell-obs.wasabisys.com:9021"
REGION="us-east-1"
TEST_FILE="s3_testfile.bin"
DOWNLOAD_FILE="downloaded_s3_testfile.bin"
FILE_SIZE_MB=500
NUMWORKERS=32

# ==============================
# Prompt for credentials
# ==============================
read -p "Enter S3 Access Key: " AWS_ACCESS_KEY_ID
read -s -p "Enter S3 Secret Key: " AWS_SECRET_ACCESS_KEY
echo

export AWS_ACCESS_KEY_ID
export AWS_SECRET_ACCESS_KEY
export AWS_DEFAULT_REGION="$REGION"

# ==============================
# Create bucket
# ==============================
echo "Creating bucket: $BUCKET"
s5cmd --numworkers $NUMWORKERS --endpoint-url "$ENDPOINT" mb "s3://$BUCKET"

# ==============================
# Create test file
# ==============================
echo "Creating ${FILE_SIZE_MB}MB test file..."
dd if=/dev/zero of="$TEST_FILE" bs=1M count="$FILE_SIZE_MB" status=progress

# ==============================
# Upload test
# ==============================
echo "Starting upload test (numworkers=$NUMWORKERS)..."
START=$(date +%s)
s5cmd --numworkers $NUMWORKERS --endpoint-url "$ENDPOINT" \
      cp "$TEST_FILE" "s3://$BUCKET/$TEST_FILE"
END=$(date +%s)

UPLOAD_TIME=$((END - START))
if [ "$UPLOAD_TIME" -le 0 ]; then UPLOAD_TIME=1; fi
UPLOAD_SPEED=$(awk "BEGIN {printf \"%.2f\", $FILE_SIZE_MB / $UPLOAD_TIME}")

echo "Upload time: ${UPLOAD_TIME}s"
echo "Upload speed: ${UPLOAD_SPEED} MB/s"

# ==============================
# Download test
# ==============================
echo "Starting download test (numworkers=$NUMWORKERS)..."
START=$(date +%s)
s5cmd --numworkers $NUMWORKERS --endpoint-url "$ENDPOINT" \
      cp "s3://$BUCKET/$TEST_FILE" "$DOWNLOAD_FILE"
END=$(date +%s)

DOWNLOAD_TIME=$((END - START))
if [ "$DOWNLOAD_TIME" -le 0 ]; then DOWNLOAD_TIME=1; fi
DOWNLOAD_SPEED=$(awk "BEGIN {printf \"%.2f\", $FILE_SIZE_MB / $DOWNLOAD_TIME}")

echo "Download time: ${DOWNLOAD_TIME}s"
echo "Download speed: ${DOWNLOAD_SPEED} MB/s"

# ==============================
# Cleanup S3
# ==============================
echo "Cleaning up S3 objects and bucket..."
s5cmd --numworkers $NUMWORKERS --endpoint-url "$ENDPOINT" \
      rm "s3://$BUCKET/$TEST_FILE"
s5cmd --numworkers $NUMWORKERS --endpoint-url "$ENDPOINT" \
      rb "s3://$BUCKET"

# ==============================
# Local cleanup
# ==============================
rm -f "$TEST_FILE" "$DOWNLOAD_FILE"

# ==============================
# Remove credentials
# ==============================
unset AWS_ACCESS_KEY_ID
unset AWS_SECRET_ACCESS_KEY
unset AWS_DEFAULT_REGION

echo "Speed test complete. Credentials cleared."

PowerShell Script

# ==============================
# Configuration
# ==============================
$Bucket = "bw-test1-speedtest-$([int][double]::Parse((Get-Date -UFormat %s)))"
$Endpoint = "https://s3.us-east-1-dell-obs.wasabisys.com:9021"
$Region = "us-east-1"
$TestFile = "s3_testfile.bin"
$DownloadFile = "downloaded_$TestFile"
$FileSizeMB = 5000
$NumWorkers = 32

# ==============================
# Prompt for credentials
# ==============================
$Env:AWS_ACCESS_KEY_ID = Read-Host "Enter S3 Access Key"
$Env:AWS_SECRET_ACCESS_KEY = Read-Host "Enter S3 Secret Key"
$Env:AWS_DEFAULT_REGION = $Region

# ==============================
# Create bucket
# ==============================
Write-Host "Creating bucket $Bucket..."
s5cmd --numworkers $NumWorkers --endpoint-url $Endpoint mb s3://$Bucket

# ==============================
# Create test file
# ==============================
Write-Host "Creating $FileSizeMB MB test file..."
fsutil file createnew $TestFile ($FileSizeMB * 1MB)

# ==============================
# Upload test
# ==============================
Write-Host "Starting upload test (numworkers=$NumWorkers)..."
$start = Get-Date
s5cmd --numworkers $NumWorkers --endpoint-url $Endpoint `
      cp $TestFile s3://$Bucket/$TestFile
$end = Get-Date

$uploadTime = ($end - $start).TotalSeconds
if ($uploadTime -le 0) { $uploadTime = 1 }
$uploadSpeed = [math]::Round($FileSizeMB / $uploadTime, 2)

Write-Host "Upload time: $uploadTime seconds"
Write-Host "Upload speed: $uploadSpeed MB/s"

# ==============================
# Download test
# ==============================
Write-Host "Starting download test (numworkers=$NumWorkers)..."
$start = Get-Date
s5cmd --numworkers $NumWorkers --endpoint-url $Endpoint `
      cp s3://$Bucket/$TestFile $DownloadFile
$end = Get-Date

$downloadTime = ($end - $start).TotalSeconds
if ($downloadTime -le 0) { $downloadTime = 1 }
$downloadSpeed = [math]::Round($FileSizeMB / $downloadTime, 2)

Write-Host "Download time: $downloadTime seconds"
Write-Host "Download speed: $downloadSpeed MB/s"

# ==============================
# Cleanup S3
# ==============================
Write-Host "Removing test object..."
s5cmd --numworkers $NumWorkers --endpoint-url $Endpoint `
      rm s3://$Bucket/$TestFile

Write-Host "Deleting bucket $Bucket..."
s5cmd --numworkers $NumWorkers --endpoint-url $Endpoint `
      rb s3://$Bucket

# ==============================
# Local cleanup
# ==============================
Remove-Item $TestFile, $DownloadFile -Force

# ==============================
# Remove credentials
# ==============================
Remove-Item Env:AWS_ACCESS_KEY_ID
Remove-Item Env:AWS_SECRET_ACCESS_KEY
Remove-Item Env:AWS_DEFAULT_REGION

Write-Host "Speed test complete. Credentials cleared."