CupidDB Server
The CupidDB server was designed for speed and efficiency, written in Rust to ensure both high performance and correctness.
At its core, the server uses a concurrent hashmap, enabling CupidDB to manage multiple client connections simultaneously.
You can find the source code at GitHub and the Docker image at Docker Hub.
Environment Variables
Environment variables are used to configure CupidDB’s behavior.
They allow you to customize aspects like server ports, logging levels, and more.
Below is a list of the key environment variables supported by CupidDB, along with their default values.
Variable Name | Description | Possible Values | Default Value |
CUPID_BIND_ADDRESS | The address CupidDB will bind to | IP address | 0.0.0.0 |
CUPID_PORT | The port number CupidDB will listen to | Port number | 5995 |
CUPID_LOG_LEVEL | Log level | ERROR, WARN, INFO, DEBUG, TRACE | INFO |
CUPID_WORKER_THREADS | Number of worker threads CupidDB will use. The recommended value is the number of CPU cores. | Positive integer | Number of CPU cores available |
CUPID_CACHE_SHARDS | Number of separate buckets, each with its own lock, allowing multiple threads to access different shards concurrently. | 2^n | 64 |
CUPID_INITIAL_CAPACITY | Number of key-value pairs the map can hold before needing to resize | Positive integer | 64 |
CUPID_GRACEFUL_TIMEOUT | Number of seconds CupidDB will wait for client's command to complete before completely shutting down | Positive integer | 30 |
Example
docker run --rm -p 5995:5995 \
-e CUPID_WORKER_THREADS=4 \
-e CUPID_GRACEFUL_TIMEOUT=60 \
cupiddb/cupiddb:latest