Error: redis server service failed with result start limit hit

What's Causing This Error

When you receive the error message 'redis server service failed with result start limit hit', it means that the Redis server was unable to start due to exceeding the system's start limit. This can occur if the Redis server is set to automatically start but fails to do so or repeatedly crashes. As a result, the system restricts the number of times the service can restart within a certain timeframe, leading to this error.

Insufficient memory resources can also cause this error. If there isn't enough memory available for the Redis server to start, it may fail to do so and generate this error.

Solution - Here's How To Resolve It

To resolve this issue, you should follow these steps:

  1. Check the Redis configuration file for any issues: First, open the Redis configuration file using the command sudo nano /etc/redis/redis.conf. Ensure that the configuration file is accurately configured with the appropriate parameters. If you find any errors, correct them. For instance, if the maxmemory setting is too low, increase it according to your server capacity.

  2. Restart the Redis Server: Once you have made necessary changes in the configuration file, save and exit by pressing Ctrl + X, then Y, then Enter. After that, try restarting the Redis server with the command systemctl restart redis.service.

  3. Examine the system's memory availability: If the Redis configuration file is correct, review the system's memory usage using monitoring tools like 'top' or 'htop'. These tools can be used by simply typing either top or htop in your terminal. If the system has insufficient memory, free up some memory by stopping unimportant services with systemctl stop [service-name], or consider increasing the system's memory capacity.

  4. Increase the restart limit for the Redis server service: If the error still persists, the restart limit of the Redis service can be increased. This can be done by modifying the systemd configuration file for the Redis service (/etc/systemd/system/redis.service). Increase the 'StartLimitIntervalSec' and 'StartLimitBurst' parameters to permit the service to restart more frequently within a specified time frame.

For example, you can set StartLimitIntervalSec to 0 and StartLimitBurst to any large number like 5000.

You can make these changes with the following commands:

sudo nano /etc/systemd/system/redis.service # Change StartLimitIntervalSec=0 and StartLimitBurst=5000 # Save and exit using Ctrl + X, then Y, then Enter

After making these changes, reload the systemctl daemon to apply the changes with the command systemctl daemon-reload, and try restarting the Redis server again with systemctl restart redis.service.

Was this content helpful?

Start building today

Dragonfly is fully compatible with the Redis ecosystem and requires no code changes to implement.