您实际上可以保存多少应用程序会话数据?

发布于 2024-07-06 04:56:24 字数 790 浏览 4 评论 0原文

我目前有一个应用程序,每天有超过 20,000 个用户访问,他们大多查看一个数据表。 该数据表填充了大约 20 行,但是是从数据库中的“数据表”中提取的,表中有 200,000-600,000 条信息记录。 编辑:这 20 行是“动态的”,如果用户通过文本框输入任何信息,它们就会发生变化。

我目前还保存用户数据和个人资料数据。

目前,每次显示数据表时,我都会进行大约 4 次回调,但无法将其减少到 1 次。

问题:我想知道是否真的可以每 5 秒用 200,000-600,000 行数据填充应用程序状态,并且它实际上会加速系统吗? 编辑:对用户或任何其他用户输入的动态行进行操作,内容需要经常刷新。

问题 2:我实际上可以在应用程序缓存中保存多少内容,并且仍然可以使其运行得更快?

编辑: 由于有超过 20,000 个用户访问这 200,000 行,我需要缓存所有这些行,或者至少我认为这是最佳实践。 当用户访问我的网站时,这是他们查看的主要页面之一,每次访问可能会返回 2-5 次。

编辑:用户确实看到一组唯一的 20 行,可能与用户看到的任何其他 20 行不同。 这是一个非常动态的网站,几个不同的行可以每秒更新一次。

编辑:如果存储在会话状态中,那么它只会加快人们查看页面的次数。 不是整个应用程序,因为一个人只能查看该页面一次然后离开。

I currently have an application that gets hit with over 20,000 users daily and they mostly look at one data table. This data table is filled with about 20 rows but is pulled from a "datatable" in a db with 200,000-600,000 records of information in the table. Edit: These 20 rows are "dynamic" and do change if the user enters in any information via a text box.

I also currently hold user data along with profile data.

I am currently making about 4 call backs each time a datatable is displayed and I am unable to get it down to 1 call.

Question: I was wondering if I could actually fill the application state every 5 seconds with the 200,000-600,000 rows of data and would it actually speed up the system? Edit: do to the dynamic rows that a user or any other user enters in, the content needs to be refreshed often.

Question 2: How much can I actually hold in application cache and still get away with it going faster?

Edit: With over 20,000 users accessing these 200,000 rows, I would need to cache all of them or at least I think for best practices. When the user comes to my site, this is one of the main pages they look at and probably come back to 2-5 times per visit.

Edit: The user does see a unique set of 20 rows that could be different than any other 20 rows the users see. It is a VERY Dynamic site which a couple of different rows can get updated around once a second.

Edit: If stored in session state, then it will only speed up the amount of times a person views the page. Not the over all application because a person could only view the page once and then leave.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

可是我不能没有你 2024-07-13 04:56:24

您能否帮我澄清一下 - 您是说用户获得了一个包含 20 条记录的数据表,该数据表对于该用户来说是唯一的,并且是查询 600K 表的结果? 用户的记录是静态的吗?

如果只有 20 条记录在与用户关联后保持静态,您能否创建可根据请求流式传输给用户的序列化对象? 也就是说,将它们置于准备就绪的状态,这样您就不必访问数据库。

Can you clarify for me - are you saying a user gets a datatable of 20 records that is unique to that user and is the result of querying the 600K table? Are the records static for the user?

If there are only 20 records that remain static once they are associated with the user, can you create serialized objects that can streamed to the user on request? That is, put them in a state where they are ready to go so you don't have to hit the DB.

颜漓半夏 2024-07-13 04:56:24

你说他们主要查看一张表,并且该表从 200 行拉到 600K 行。 该表多久被拉一次? 这是用户主要查看第一页数据的“主页”类型场景吗? 为什么缓存所有 200K 行,为什么不缓存前 20 行?

You say they mostly look at one table, and that table is pulled from 200 to 600K rows. How often is that table pulled? Is this a "homepage" type scenario where users are mostly looking at the first page of data? Why cache all 200K rows, why not cache the first 20?

深空失忆 2024-07-13 04:56:24

您确定要将其存储在会话状态中吗? 如果它们使用相同的数据库,我更喜欢应用程序状态,这样只有一个数据集将存储在内存中。

我认为内存限制是由IIS控制的。 有最大虚拟内存最大已用内存限制。
不要忘记检查数据的可用性。

检查这个: 在工作进程隔离模式下配置 ASP.NET 应用程序 (IIS 6.0)

Are you sure you want to store that in Session state? I'd prefer Application state if they use the same database, this way just one dataset will be stored in memory.

I think the memory limit is controlled by IIS. There are Maximum virtual memory and Maximum used memory limits.
Don't forget to check availability of data.

Check this: Configuring ASP.NET Applications in Worker Process Isolation Mode (IIS 6.0)

萌无敌 2024-07-13 04:56:24

从技术上讲,我相信你想做的事情是可能的,但我不会推荐它。 在走这条路之前,您必须考虑几个因素。

  1. 你们有硬件支持吗? 如果您没有用于此类配置的内存并且必须进行页面交换,那么您可能会失去将其缓存在内存中的大部分速度优势。 如果您使用的是进程外状态服务器,那么系统就有处理序列化的开销。

  2. 您打算如何在这么多行中搜索某些内容? 数据库服务器在幕后为您处理大量搜索和排序工作。 他们使用一些非常复杂的算法,如果您将数据缓存在网络服务器上,您将丢失这些算法。

对于什么时候数据库中的速度比内存中的速度更快,没有真正严格的快速规则。 这实际上取决于应用程序的设置方式以及数据的存储方式。

Technically, I believe what you want to do is possible, but I wouldn't reccomend it. There are several factors you have to consider before going down this path.

  1. Do you have the hardware to support it? If you don't have the memory for such a configuration and you have to page swap, then you'll probably lose most of speed benefit of having it cached in memory. If you are using an out of process state server, then the system has the overhead of dealing with serialization.

  2. How do you plan on searching for something in that many rows? A database server handles alot of searching and sorting for you behind the scenes. There's some pretty complex algorithms that they use which you're going to lose if you cache the data on the webserver.

There is no real hard an fast rule as to when something is faster in the database as to opposed to in memory. It really depends on how the application is setup and how the data is stored.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文