[英]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.我想知道,如果将来我想通过在负载均衡器下安装我的 Laravel 应用程序来处理大量流量。 The process will be as follow?
过程将如下?
1 Load balancer to distribute traffic into: 1 负载均衡器将流量分配到:
2 VPS. 2个VPS。 Each one of these, with an identical Laravel application.
其中每一个都具有相同的 Laravel 应用程序。
Each web server can connect with: 1 VPS for MYSQL每个 web 服务器可以连接: 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?这是我的疑问,我是否也应该将 Redis 分开,例如 Redis 的 1 VPS 并使用 Laravel 队列维护我的作业?
Or should Redis & Laravel Queues daemon still be on each one of the 2 identical web servers?或者 Redis 和 Laravel 队列守护程序是否仍应位于两台相同的 web 服务器中的每一台服务器上?
I think the better way is to have the redis installed and set up on one of your ECS instances.我认为更好的方法是在您的一个 ECS 实例上安装和设置 redis。
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.之后,您应该在 .env 中设置 Redis 配置(
REDIS_HOST,REDIS_PORT and REDIS_PASSWORD
)以在两个 ECS 实例上连接该 ECS 实例。 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.通过这种方式,您不必设置额外的 ECS,这可能会花费您更多,同时您可以实现您想要的。 A drawback for this method is you might need to set up 2 images for your ECS, one with Redis configured and one without.
这种方法的一个缺点是您可能需要为您的 ECS 设置 2 个映像,一个配置了 Redis,一个没有配置。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.