This script is used to benchmark the performance of different time-series databases.
- Setup the database you want to benchmark. For example, if you want to benchmark InfluxDB, you should setup InfluxDB first.
- Setup the tables or buckets in the database.
- Replace the configuration in your intended database's benchmarking script. For example, if you want to benchmark InfluxDB, you should replace
<host>
tolocalhost
etc. - Configure the filename to store the benchmarking result.
filename := "influx-2vCPU-latency.csv"
orfilename := "influx-4vCPU-latency.csv"
- Run the benchmarking script.
go run ./cmd/influx/main.go
- Sync the benchmarking script to the VM instance using SFTP
- Run the benchmarking script on remote VM instance in background
These strategies are used to avoid back-and-forth debugging between local and remote VM instance.
- Install https://marketplace.visualstudio.com/items?itemName=Natizyskunk.sftp in vscode
- Configure the sftp.json file
{
"name": "Benchmarking Client",
"host": "<IP>",
"protocol": "sftp",
"port": 22,
"username": "<username>",
"remotePath": "/home/<username>/benchmarking",
"privateKeyPath": "/Users/<username>/.ssh/google_compute_engine",
"uploadOnSave": true,
"useTempFile": false,
"openSsh": false,
"ignore": [".vscode", ".git", ".DS_Store", "node_modules", "results"]
}
- SSH to the VM instance
gcloud compute ssh --zone "asia-southeast1-b" "benchmarking-client" --project "<project-id>"
- Run the benchmarking script in background
cd benchmarking
nohup go run ./cmd/clickhouse/. > clickhouse-2vCPU.out 2> clickhouse-2vCPU.err < /dev/null &