从数据库中删除会话过期它之后? [英] Delete session from database after it expired?
问题描述
这可能是一个愚蠢的问题,但我想知道如果这将是从我的数据库中删除所有过期的会话是个好主意,每15分钟?
This might be a silly question but i was wondering if it would be a good idea to delete all expired "sessions" from my database, every 15 minutes?
或者只是离开它呢?会话X分钟后到期,其不再有用了,好像它只是占用空间?
Or just leave it there? Session expires after X minutes, its no longer useful anymore, seems like it just taking up space?
推荐答案
在我的团队部署SQL在.NET应用程序服务器会话状态,我们简单地创建SQL Server代理作业到夜间清理过期的会话(或在一些适当的间隔)。
When my team deploys SQL Server session state in a .NET application, we simply create a job with SQL Server Agent to clean up the expired sessions nightly (or at some appropriate interval).
除非你有大量的信息流,你可以做到这一点,只要它不用担心瞬间删除未使用的会话方便,但它绝对是清理一个好主意。
Unless you have massive amounts of traffic, you can do this whenever it is convenient without worrying about instantly deleting unused sessions, but it's definitely a good idea to clean up.
这篇关于从数据库中删除会话过期它之后?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!