简体   繁体   English

多服务器部署的ASP.net解决方案注意事项

[英]ASP.net solution considerations for multi server deployment

I've done all my development of an ASP.net website under the assumption that it will be deployed to a single server. 我已经完成了对ASP.net网站的所有开发,假设它将部署到单个服务器上。 Since we're expanding we're looking at hosting scalably in the cloud with multiple VM's running the website. 由于我们正在扩展,我们正在寻找在云中托管可扩展的多个虚拟机运行网站。 We are taking expert advise on deployment, but the hired help we have are expecting an ASP.net site that will work in a load balanced environment. 我们正在采取有关部署的专家建议,但我们所聘请的帮助预计将在负载均衡的环境中工作的ASP.net站点。

I'm researching what in my solution may need to change for it to work on a multi server deployment. 我正在研究我的解决方案中可能需要更改的内容,以便在多服务器部署中工作。

So far, I've found that all my caching needs to be done on a distributed cache such as NCache. 到目前为止,我发现我的所有缓存都需要在分布式缓存(如NCache)上完成。 The code changes required for this don't look too bad. 为此所需的代码更改看起来并不太糟糕。

We don't use sessions for user authentication, it's all done via cookies so I don't think that will cause any issues. 我们不使用会话进行用户身份验证,这些都是通过cookie完成的,所以我认为这不会导致任何问题。

What other general considerations need to be made? 还需要做出哪些其他一般性考虑? (I've looked for a guide but can't find one). (我找了一个指南,却找不到一个)。

If you use sessions to store data between calls, you are going to need to move to the SqlServerSessionProvider. 如果使用会话在调用之间存储数据,则需要转到SqlServerSessionProvider。 you'll also need to have the same machine key for all servers on the load balancer or viewstate won't work. 您还需要为负载均衡器上的所有服务器使用相同的计算机密钥,否则viewstate将无法运行。

Here's a link from Scott Hanselman that list the gotchas. 这是Scott Hanselman列出陷阱的链接

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

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