简体   繁体   English

具有负载平衡的 Umbraco 8 应用程序

[英]Umbraco 8 application with load balancing

I have an Umbraco 8.2.2 application which is hosted in AWS EC2 server.我有一个托管在 AWS EC2 服务器中的 Umbraco 8.2.2 应用程序。
Recently, I encounter server availability issues that caused downtimes once in a while.最近,我遇到服务器可用性问题,偶尔会导致停机。
One of the solutions I've thought about is to maintain an additional AWS EC2 server which hosts the same application (Same code, same database) and configure load balancing between them.我考虑过的解决方案之一是维护一个额外的 AWS EC2 服务器,该服务器托管相同的应用程序(相同的代码,相同的数据库)并在它们之间配置负载平衡。
It will host both client and server.它将托管客户端和服务器。

To what extent is this possible, in your experience?根据您的经验,这在多大程度上是可能的?
How can I handle obstacles like shared media & cache folders, as they should be the same?我该如何处理共享媒体和缓存文件夹等障碍,因为它们应该是相同的?
I've heard about S3 as an option.我听说过 S3 作为一个选项。
What additional obstacles may I face, and what should I put my focus on?我可能会面临哪些额外的障碍,我应该关注什么?
Thanks.谢谢。

This sounds like a good use case for Amazon EFS which offers you a shared POSIX file system.这听起来像是 Amazon EFS 的一个很好的用例,它为您提供了一个共享的 POSIX 文件系统。 You can mount the directories where your media and cache folders are located to the EFS share and then mount the EFS share to the backend EC2 instances that are behind the load balancer.您可以将媒体和缓存文件夹所在的目录挂载到 EFS 共享,然后将 EFS 共享挂载到负载均衡器后面的后端 EC2 实例。 This solution requires very little or no changes to your application itself, you will just be changing the storage media for certain files in your application.此解决方案需要对您的应用程序本身进行很少或不需要更改,您只需更改应用程序中某些文件的存储介质。

As for obstacles, EFS is a.network filesystem, therefore, it is generally not recommended to execute code from your EFS share or to use it for applications that require very low storage latency.至于障碍,EFS 是一个网络文件系统,因此,通常不建议从 EFS 共享执行代码或将其用于需要非常低存储延迟的应用程序。 If that's the case then you can consider Amazon FSx but that's a very expensive solution.如果是这种情况,那么您可以考虑使用 Amazon FSx,但这是一个非常昂贵的解决方案。

If you can't avoid executing your code from EFS, just try it out and see how it affects your application's performance.如果您无法避免从 EFS 执行您的代码,只需尝试一下,看看它如何影响您的应用程序的性能。 EFS works fine for plenty of web application use cases. EFS 适用于大量 web 应用程序用例。 Here is a tutorial on how to host a simple website using EFS behind a load balanced environment to get you started.这是一个教程,介绍如何在负载平衡环境后使用 EFS 托管一个简单的网站,以帮助您入门。

If EFS is not an option, then you could try to offload your static content to Amazon S3 and serve it through CloudFront.如果 EFS 不是一个选项,那么您可以尝试将您的 static 内容卸载到 Amazon S3 并通过 CloudFront 提供它。 This is probably a cheaper option and offloads a lot of traffic from your load balancer and EC2 instances but it is also probably more work because you have to refractor your application to serve your content through CloudFront.这可能是一个更便宜的选择,可以从您的负载均衡器和 EC2 实例中卸载大量流量,但它也可能需要更多工作,因为您必须重构您的应用程序以通过 CloudFront 为您的内容提供服务。 Here is a tutorial (there are plenty more online) on how to create a static website that serves content through CloudFront.这是一个关于如何创建一个 static 网站的教程(还有更多在线教程),该网站通过 CloudFront 提供内容。 In your case, you would be serving the content (ie your media files) through S3/CloudFront and then update the links used in your applications to retrieve that content from the CloudFront endpoint instead of retrieving them directly from your application/load balancer endpoint... so the work you need to do is on two fronts, setting up the S3/CloudFront environment, and configuring your application to offload the content to S3 and serve it through CloudFront.在您的情况下,您将通过 S3/CloudFront 提供内容(即您的媒体文件),然后更新应用程序中使用的链接以从 CloudFront 端点检索该内容,而不是直接从您的应用程序/负载均衡器端点检索它们。 .. 所以你需要做的工作有两个方面,设置 S3/CloudFront 环境,配置你的应用程序以将内容卸载到 S3 并通过 CloudFront 提供它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 使用应用程序负载平衡和 MSSQL AlwaysOn 将应用程序托管在 AWS 中 - Having Application hosted in AWS with Application Load Balancing and MSSQL AlwaysOn AWS Application Load Balancing:看到极长的初始连接时间 - AWS Application Load Balancing: Seeing extremely long initial connection time WordPress & 谷歌云平衡负载平衡 - WordPress & Load balancing on Google Cloud Balancing 非托管实例组的负载平衡 - load balancing for unmanaged instance group Azure 云服务的负载平衡不工作 - Azure Load Balancing of Cloud Service not working GKE - 使用 Ingress 和内部负载平衡公开服务 - GKE - expose service with Ingress and Internal Load Balancing Kubernetes 服务:IPVS 负载均衡算法 - Kubernetes Service: IPVS load balancing algorithm GCP 负载平衡(非经典)- URL 重写 - GCP Load Balancing (non classic) - URL rewrite 为有状态集副本地址启用负载平衡和连接管理 - Enable load balancing and connection management for stateful set replica address 弹性负载平衡 w.r.t EC2 Memory - Elastic Load Balancing w.r.t EC2 Memory
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM