简体   繁体   中英

Should I separate Redis from the webserver if I would like to have my Laravel application under a Load Balancer?

I am wondering, if in the future I would like to handle high volume traffic by having my Laravel application under a Load Balancer. The process will be as follow?

1 Load balancer to distribute traffic into:

2 VPS. Each one of these, with an identical Laravel application.

Each web server can connect with: 1 VPS for MYSQL

And here is my doubt, should I also separate Redis such as 1 VPS for Redis and maintaining my Jobs with Laravel Queues?

Or should Redis & Laravel Queues daemon still be on each one of the 2 identical web servers?

I think the better way is to have the redis installed and set up on one of your ECS instances.

After that, you should set your Redis config ( REDIS_HOST,REDIS_PORT and REDIS_PASSWORD ) in the.env to connect that ECS instance, on both ECS instances. So it will become as below:

A ECS -- A ECS redis service B ECS -- A ECS redis service

In this way, you does not have to set up an extra ECS which might cost you more and during the same time you can achieve what you want. A drawback for this method is you might need to set up 2 images for your ECS, one with Redis configured and one without.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM