在1000个用户点击的页面之间维护会话 [英] Maintaining session between pages on 1000 user hits

查看:45
本文介绍了在1000个用户点击的页面之间维护会话的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设有1000个用户同时访问了您的网站,那么
您将如何保持稳定性?
您如何在用户点击页面之间维护会话? (在MVC和C#中)
或者你如何维护网站的可扩展性?





我的尝试:



尝试谷歌搜索,但在特定的

解决方案

中找不到任何内容所以你的主要问题是,你将如何一次扩展到1,000个用户。



鉴于这个问题含糊不清,而且您对自己的个人应用程序缺乏了解,这将是非常高的水平。



有很多方法可以解决你的问题,但这里可能是最常见的。



会话是由用户提供的(正如Sinisa所提到的那样)所以他们应该得到相应的处理。您可以将会话信息保存到数据库或通过cookie(在mvc中可能通过cookie保存)。



至于处理用户需要查看负载均衡器。有很多关于这个主题的文章和说明,但简而言之,负载均衡器允许您通过单个URL访问多个服务器,并且能够处理极端负载。



负载均衡器 [ ^ ]



谷歌的[<一个HREF =https://www.google.com/search?rlz=1C1SQJL_enUS793US793&ei=LmEDXKmHHaPm_Qbonp6YAw&q=IIS+load+balancing&oq=IIS+load+balancing&gs_l=psy-ab.3..0i67j0l2j0i67j0l5。 3030600.3032512..3032647 ... 0.0..0.272.1778.12j5j1 ...... 0 .... 1..gws-WIZ .... ... 0i71j0i131j35i39.rCSgaJC4jDUtarget =_ blanktitle =New Window> ^ ]



数据库通常是瓶颈。根据您的应用程序的不同,您可能需要查看缓存选项(memcache,redis,amazon elasticache ....许多选项)。这会产生自己的问题(使缓存无效/刷新),但它会使您的某些数据库操作成为应用程序中的瓶颈。



红色:什么和为什么? - codeburst [ ^ ]



Amazon ElastiCache-内存数据存储和缓存 [ ^ ]



关于mvc / .net中的缓存的谷歌搜索将提供大量的链接以供阅读。



此处还有其他选项,包括用于负载平衡的DB分片但现在我们是进入快速回答论坛范围之外的高级主题。



我还建议对高级扩展主题/可扩展性主题进行搜索以便阅读。

Suppose 1000 users hit your site simultaneously so
how would you maintain the stability ?
How would you maintian the session between the pages on User Hits ? (In MVC and C#)
Or How would you maintain the scalabilty of site ? 



What I have tried:

Tried Googling but found nothing in Specific

解决方案

So your main issue is really, how would you scale to 1,000 users all at once.

Given the vagueness of this question and lack of knowledge about your personal app you are inquiring about, this will be pretty high level.

There are many ways to solve your problem but here is probably the most common.

Sessions are by user (as Sinisa mentioned) so they should be handled accordingly. You can save session info to a DB or via cookie (in mvc its likely via cookie).

As for handling the users you'd want to look into load balancers. There is a lot of writing and how to's on this topic but in short, load balancers allow you to have more than one server accessible via a single URL with the capability to handle extreme loads.

Load Balancer[^]

Google[^]

Database are typically a bottleneck. Depending on what your app does you'll likely want to look into caching options (memcache, redis, amazon elasticache....many options). This creates its own issues (invalidating/refreshing the cache) but it frees up some of your DB operations from being the bottleneck in your application.

Redis: What and Why? – codeburst[^]

Amazon ElastiCache- In-memory data store and cache[^]

A google search about caching in mvc/.net will provide plenty of links to read through.

There are additional options here including DB sharding for load balancing but now we are getting into advanced topics beyond the scope of a quick answer forum.

I'd also suggest doing searches on advanced scaling topics/scalability topics to read up on as well.


这篇关于在1000个用户点击的页面之间维护会话的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆