这是错的吗? [英] Is this so wrong?

查看:80
本文介绍了这是错的吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为了优化性能,我计划在会话缓存/变量中为用户提供任何有用的信息

。我们的网络服务器将有2GB的内存启动

out。


因为我将放入我将放入的数据量非常宽松会话,

我知道会占用大量的内存资源。但我的计划是监控

网络服务器活动,当流量增加时,我需要做的就是添加另外2GB的
,然后另外2GB,直到我最大化盒子上允许使用内存。

当我无法再添加内存时,我会添加另一个盒子来为网站服务。


我的计划是这样的简单,等错?请与我分享您的

体验和您的想法。非常感谢提前。

To optimize performance, I plan on putting any useful information for a user
in a session cache/variable. Our web server will have 2GB of memory to start
out with.

Since I will be very liberal in the amount of data I''ll put in the session,
I know that will use lots of memory resource. But my plan is to monitor the
web server activity, and when traffic ramping up, all I need to do is add
another 2GB, then another 2GB until I max out memory allowed on the box.
When I can''t add anymore memory, I will add another box to serve the site.

Is my plan so simplistic, and so wrong? Please share with me your
experiences and your thoughts. Thanks so much in advance.

推荐答案

" Ethan V" < aa*@aaa.aaa>在消息中写道

news:uF ************** @ TK2MSFTNGP02.phx.gbl ...
"Ethan V" <aa*@aaa.aaa> wrote in message
news:uF**************@TK2MSFTNGP02.phx.gbl...
To优化性能,我计划在会话缓存/变量中为
用户提供任何有用的信息。我们的网络服务器将有2GB的内存开始使用。

因为我会在
会话中放入数据量非常宽松,我知道会占用大量的内存资源。但我的计划是监控网络服务器活动,当流量增加时,我需要做的就是再添加2GB,然后再增加2GB,直到我最大限度地允许内存为止。框。当我不能再添加内存时,我会添加另一个盒子来为网站服务。

我的计划是如此简单,如此错误?请与我分享您的经验和想法。非常感谢提前。
To optimize performance, I plan on putting any useful information for a
user in a session cache/variable. Our web server will have 2GB of memory
to start out with.

Since I will be very liberal in the amount of data I''ll put in the
session, I know that will use lots of memory resource. But my plan is to
monitor the web server activity, and when traffic ramping up, all I need
to do is add another 2GB, then another 2GB until I max out memory allowed
on the box. When I can''t add anymore memory, I will add another box to
serve the site.

Is my plan so simplistic, and so wrong? Please share with me your
experiences and your thoughts. Thanks so much in advance.




在Session中缓存用户数据是一个好主意 - 但只有在你需要的时候...

那里没什么特别的正确的或错误的关于这样做 -

会话对象毕竟是用的...


只有你可以决定存储多少元素或多少元数据。 ..


例如如果你有很多很多并发用户,那么你可以做的任何事情都可以做到最好尽量减少重复数据库查询。这可能是一个好主意。


但是,如果你'最初的前提是,你所要做的就是在你的网站上投入更多的资金,而且一切都会很好,你真的好了。

应该退后一步尝试正确设计你的网站。



Caching user data in Session is a great idea - but only if you need to...
There''s nothing particularly "right" or "wrong" about doing this - the
Session object is there to be used after all...

Only you can decide how much or how little metadata to store...

E.g. if you have lots and lots of concurrent users, anything you can do to
minimise repetitive database querying is probably a good idea.

However, if you''re initial premise is that all you have to do is throw more
hardware resources at your site and everything will be well, you really
should take a step back and try to design your site properly.


只要确保看到你为这个记忆消费购买的东西,即制作

你肯定要把缓存的东西放到那里经常使用(所有用户使用的东西,而不是一个用户可能是第一个候选人等等,而不是b $ b等...)。在缓存之前你也可以查看是否可以改善查询

等等...


-

Patrice


" Ethan V" < aa*@aaa.aaa> écritdansle message de news:
uF ******* *******@TK2MSFTNGP02.phx.gbl ...
Just make sure to see what you buy for this memory comsumption i.e. make
sure you put on cache something that is frequently used (things used by all
users rather than by one user would be likely the first candidate etc
etc...). Also before caching something you may want to check if the query
could be improved etc...

--
Patrice

"Ethan V" <aa*@aaa.aaa> a écrit dans le message de news:
uF**************@TK2MSFTNGP02.phx.gbl...
为了优化性能,我计划在会话缓存中为
用户提供任何有用的信息/变量。我们的网络服务器将有2GB的内存开始使用。

因为我会在
会话中放入数据量非常宽松,我知道会占用大量的内存资源。但我的计划是监控网络服务器活动,当流量增加时,我需要做的就是再添加2GB,然后再增加2GB,直到我最大限度地允许内存为止。框。当我不能再添加内存时,我会添加另一个盒子来为网站服务。

我的计划是如此简单,如此错误?请与我分享您的经验和想法。非常感谢提前。
To optimize performance, I plan on putting any useful information for a
user in a session cache/variable. Our web server will have 2GB of memory
to start out with.

Since I will be very liberal in the amount of data I''ll put in the
session, I know that will use lots of memory resource. But my plan is to
monitor the web server activity, and when traffic ramping up, all I need
to do is add another 2GB, then another 2GB until I max out memory allowed
on the box. When I can''t add anymore memory, I will add another box to
serve the site.

Is my plan so simplistic, and so wrong? Please share with me your
experiences and your thoughts. Thanks so much in advance.



Ethan V写道:
Ethan V wrote:
为了优化性能,我计划为<给出任何有用的信息br />会话缓存/变量中的用户。我们的网络服务器将有2GB的内存开始。
To optimize performance, I plan on putting any useful information for
a user in a session cache/variable. Our web server will have 2GB of
memory to start out with.




您可能希望将会话缓存设置为使用aspnet_state服务

因此,如果您更新网站,当前会话不会丢失其状态(或者当工作进程被回收时)。或者甚至使用SQL

服务器来保存会话数据,这可以(据我所知)保持数据即使在机器重启时也能保证数据。


Andrew



You might want to set the session cache to use the aspnet_state service
so that if you update the site the current sessions don''t lose their
states (or when the worker process gets recycled). Or even use SQL
server to hold the session data, which can (as far as I read) keep data
even over a machine reboot.

Andrew


这篇关于这是错的吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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