# How Zerops scales KeyDB Zerops automatically scales your KeyDB service based on actual database usage. When your database needs more power, resources increase. When demand drops, resources scale down to reduce costs. :::tip Read More For complete scaling details across all services, see [Automatic Scaling and High Availability](/features/scaling). ::: ## How KeyDB scaling works KeyDB services use **vertical scaling** to adjust CPU, RAM, and disk resources within containers based on usage patterns. Unlike runtime services, KeyDB does not use horizontal scaling (adding/removing containers). Instead, KeyDB services use deployment modes for high availability. ## Configure scaling You can configure scaling settings: - **During service creation** - Set initial scaling parameters when [creating](/keydb/how-to/create) your KeyDB service - **During import** - Define scaling configuration in your YAML import file using `verticalAutoscaling` parameters - **After service creation** - Navigate to your KeyDB service and select **Automatic scaling configuration** to modify settings ### Basic settings **CPU Mode**: Choose between shared (cost-effective, variable performance) or dedicated (consistent performance, higher cost). You can change CPU mode once per hour. See [pricing](https://zerops.io/#pricing) for costs. **Resource limits**: Configure minimum and maximum resources for your KeyDB service: - **Lower the maximum** to control costs and prevent over-scaling - **Raise the minimum** when you need guaranteed baseline performance - **Set minimum = maximum** to disable automatic scaling for that specific resource **Deployment mode**: Choose the reliability configuration for your KeyDB service: - **Single Container**: One container with vertical scaling only. Suitable for development environments. - **Highly Available**: Multiple containers with built-in redundancy. Recommended for production environments. :::warning Deployment mode cannot be changed after service creation. ::: When a container fails in HA mode, Zerops automatically replaces it with a new container on a different physical machine and synchronizes data from healthy copies. ### Advanced settings **Start CPU cores**: Determines how many CPU cores are allocated during database startup. Increase this value if your KeyDB service starts slowly or requires more processing power during initialization. **RAM thresholds**: Help prevent out-of-memory crashes by maintaining buffer space: - **Absolute (GB)**: Maintains this amount of free RAM at all times - **Percentage**: Keeps this percentage of total RAM free Consider increasing these values if your database experiences memory-related issues. :::info Read More For detailed technical parameters and scaling behavior, see [Automatic Scaling and High Availability](/features/scaling#resource-scaling-behavior). ::: ## Monitor usage Navigate to your KeyDB service and select **Service containers & Overview** to view: - CPU, RAM, and disk usage over time - Historical scaling events - Container health status ## Technical details Zerops monitors database usage and automatically adjusts resources based on predefined thresholds and timing parameters. The scaling behavior follows the same principles as other services in the platform. For complete technical specifications including: - Resource monitoring intervals and thresholds - Scale-up and scale-down timing parameters - Scaling increments and steps - Detailed scaling behavior patterns See [Resource Scaling Behavior](/features/scaling#resource-scaling-behavior) in the general scaling documentation. ## Common issues **Out of memory errors** - Increase minimum free RAM settings in your scaling configuration - Consider raising the minimum RAM allocation - Check for memory-intensive operations **Higher than expected costs** - Consider lowering your maximum resource limits - Review scaling patterns in the monitoring dashboard **Slow database startup** - Increase the "Start CPU cores" setting - Consider switching to dedicated CPU mode for consistent performance *Need help? Join our [Discord community](https://discord.gg/zerops) for assistance!*