Skip to main content

Use NitroPack with Load Balancing

Updated over a week ago

What is Load Balancing?

Load balancing is the process of distributing network traffic across multiple servers, computers, or other resources to optimize resource utilization, improve performance, and increase the availability and reliability of applications or services.

Can NitroPack operate with Load Balancing?

NitroPack can work with Load Balancing.

However, you must ensure that the server stack have Redis installed and configured.

Once you have ensured that Redis is a part of your network, there is one last step to take.

That step will differ depending on your website’s platform.

WordPress

The configuration requires the following constants to be set within a website's wp-config.php file:

mceclip0.png
if (!defined("NITROPACK_USE_REDIS")) define("NITROPACK_USE_REDIS", false); // Set this to true to enable storing cache in Redis
if (!defined("NITROPACK_REDIS_HOST")) define("NITROPACK_REDIS_HOST", "127.0.0.1"); // Set this to the IP of your Redis server
if (!defined("NITROPACK_REDIS_PORT")) define("NITROPACK_REDIS_PORT", 6379); // Set this to the port of your Redis server
if (!defined("NITROPACK_REDIS_PASS")) define("NITROPACK_REDIS_PASS", NULL); // Set this to the password of your redis server if authentication is needed
if (!defined("NITROPACK_REDIS_DB")) define("NITROPACK_REDIS_DB", NULL); // Set this to the number of the Redis DB if you'd like not to use the default one

⚠️ Please note that the values should be adjusted according to your Redis configuration. You should be able to obtain this information from your hosting provider - the Redis IP address, port, passwords, and database (if any).

Did this answer your question?