会话状态和应用程序池 [英] Session State and Application Pool

查看:64
本文介绍了会话状态和应用程序池的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个网络服务器,我的团队已将网络应用程序的应用程序池设置为 3,以提高弹性和性能.但是,我们偶然发现了一个问题,即部分应用程序不能完全正常工作.

I have a webserver, and my team have set the application pool for the web application to 3 for resilence and performance. However, we have stumbled upon a problem where part of the application is not fully working.

我们认为问题出在应用程序的这部分使用会话的地方,我们认为当数据被回传时,它没有链接回正确的工作进程.

We believe the problem lies where this part of the application uses sessions, and we think that when the data is posted back it doesn't link back to the correct worker process.

但是,我不确定这一点,或者我是否应该在 web.config 中使用 SessionState.如果我是对的,模式应该是 InProc、SessionState 还是其他什么?会话是否应该超时?

However, I am not sure about this, or whether I should be using SessionState in the web.config. If I am right, should the mode be InProc, SessionState, or whatever? Should there be a timeout on the session?

有人可以给我建议吗?

推荐答案

如果不能保证每个请求都进入同一个线程,就不能以多线程方式(应用程序池中有 3 个线程)使用 InProc.

You cannot use InProc in a multithreaded way (3 threads in the app pool) without guaranteeing that each request goes to the same thread.

InProc 字面意思是在进程中,就像在当前线程的内存中一样.

InProc literally means in process, as in the memory of the current thread.

如果您转移到另一种存储方法,例如数据库,则会话可以在给定应用程序的所有实例之间共享.

If you move to another storage method, say, to the database, then session can be shared across all instances of a given application.

我建议阅读这个

这篇关于会话状态和应用程序池的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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