存储大量数据,在Asp.net会议 [英] Storing large amounts of data in the Asp.net session

查看:96
本文介绍了存储大量数据,在Asp.net会议的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在写一个C#/ asp.net页面,目前大量的数据(如100 000日期时间INT对),我拉出来的数据库在页面加载,加载但相同的数据每个页面加载似乎有点愚蠢。我认为存储在会话此值,但多个浏览器标签似乎导致的问题。

I'm writing a C#/asp.net page, and currently lots of data (say 100 000 Datetime int pairs) that i pull out of a database on page load, however loading the same data every page load seems a little silly. I've considered storing this value in the session, but multiple browser tabs seems to be causing an issue.

有没有更好的方式来存储这些值,如果我需要支持多个浏览器标签使用会话是否合适?

Is there a better way to store these values, and is using the session appropriate if i need to support multiple browser tabs?

推荐答案

您会吃掉大量的服务器内存。你可以在你的会话存储在数据库中(这违背了目的,因为这就是为什么你想将它们存储在第一会议地点的原因),但字里行间(为什么每个访问者需要100000独特的日期时间对?)我想你应该考虑在缓存中存储这些值(如果他们是为所有用户相同)。

Your session eats up a lot of server memory. You could store your session in a database (which defeats the purpose since this is the reason why you want to store them in the session in the first place), but reading between the lines (why would each visitor need 100,000 unique datetime pairs?) I think you should really look into storing these values in the cache (if they're the same for all users).

在会话存储100K INT对的问题是,它可能会为1或2,甚至地狱的12名用户,也许工作。但是,当你的网站被越来越多的不可扩展的。服务器将不能够存储的每个100k的INT成对500000用户会话。 您会很快耗尽内存pretty的

The problem with storing 100k int pairs in the session is that it might work for 1 or 2, hell even a dozen users maybe. But when your website gets popular its not scalable at all. Your server won't be able to store 500,000 user sessions of 100k int pairs each. You'll run out of memory pretty quickly

这篇关于存储大量数据,在Asp.net会议的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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