Zum Inhalt springen

Dieser Inhalt ist noch nicht in deiner Sprache verfügbar.

Performance Tuning

ALTCHA Sentinel is built for production use with minimal operational configuration and no external dependencies such as databases or services. The official Docker image includes everything needed for a smooth deployment, including built-in databases.

The default setup should support approximately 2,000 requests per second (RPS) on critical endpoints like /v1/challenge and /v1/verify, with rate-limiting and logging enabled. This throughput is sufficient for many use cases. However, if you need to optimize performance further, review the tuning tips below.

Scaling Up

You can scale ALTCHA Sentinel either vertically or horizontally depending on your needs:

  • Single-instance deployments:
    Scale vertically by adding more CPU cores or vCPUs to take advantage of multi-threading. RAM beyond 16GB typically offers no additional benefit.

  • Multi-instance deployments:
    Scale horizontally by deploying multiple instances. For this, refer to the Clustering guide. Horizontal scaling requires an Enterprise license.

Redis Optimization

ALTCHA Sentinel includes a built-in Redis-compatible (partial compatibility) database for seamless deployment. However, it is not as performant as the official Redis or Valkey implementations.

While the built-in Redis-like store is suitable for low-to-moderate workloads, we recommend using an external Redis 7+ or Valkey 7+ instance or HA cluster for higher performance and throughput. Internal testing shows that Redis 7 can be up to 8x faster than the built-in database.

Why Redis Matters

Redis is primarily used to store rate-limiting data, and is accessed with every request when rate limiting is enabled. This makes it a potential performance bottleneck.

Requirements

  • Requires a Redis 7 compatible database (supports the EXPIRE [NX] command)
  • Recommended options: Redis 7+ or Valkey 7+

Enabling External Redis

To use an external Redis instance, set the REDIS_URL environment variable. Review additional Redis-related environment variables as needed to fine-tune the connection and behavior.

ClickHouse

To achieve high-performance analytics and reduce load on the primary database, configure ClickHouse to store request logs used for dashboards and reporting.

Benefits

  • Offloads logging from the built-in primary database
  • Supports efficient querying and aggregation for analytics
  • Reduces disk I/O on container volumes
  • Allows log analysis using external tools such as ClickHouse clients or BI platforms

Requirements

  • ClickHouse version 22.6 or later
  • Proper network access and schema configuration (refer to Logging to ClickHouse)

Recommendation

Use ClickHouse for high-traffic environments or when detailed request-level analytics are required. For low-traffic setups or when analytics are not critical, built-in logging may suffice.

Primary Database and Storage Volumes

The built-in primary database stores persistent data on a volume attached to the container. If the volume has low throughput, it may negatively impact system performance.

Although Sentinel uses in-memory caching for API keys and configurations, request logs are written directly to the database with every request when logging is enabled.

To reduce disk usage and improve performance:

  • Disable request logging entirely in the API Key settings
  • Limit logging to only verification requests
  • Use ClickHouse for high-performance, external log storage and analytics

This reduces disk write operations and improves overall performance.