ASPState tempdb or persistent

Last post 04-18-2008 4:47 PM by Joco. 4 replies.

Sort Posts:

  • ASPState tempdb or persistent

    04-18-2008, 3:15 PM
    • Member
      131 point Member
    • Joco
    • Member since 07-23-2002, 8:42 AM
    • Posts 41

    Hi,

    In  C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322 there are two scripts:

    1- InstallPersistsqlState.sql (store ASP.NET session data in ASPState database)
    2- InstallsqlState.sql (store in tempdb)

    I am aware that the approach using tempdb requires to recreate the user permissions to tempdb..ASPStateTempApplications and tempdb..ASPStateTempSessions every time SQL Server (2000) is restarted. Other than that, is there any signficant differences? (Either in performance, maintenance, scalability, etc.).

    Also which approach is better for more recent .NET framework (2.0 and 3.5)?

    Thanks in advance for any help.
     


     


     

  • Re: ASPState tempdb or persistent

    04-18-2008, 3:46 PM
    • Participant
      1,018 point Participant
    • ely79
    • Member since 03-17-2008, 1:56 PM
    • Denver, Colorado
    • Posts 188

    The big difference between the two, is that if you store session in tempdb, you will lose session state if sql server reboots.  If you want to persist your session state, save it in aspstate.  Besides that, there isn't any performance benefits you would get from using one over another.

  • Re: ASPState tempdb or persistent

    04-18-2008, 4:23 PM
    • Member
      131 point Member
    • Joco
    • Member since 07-23-2002, 8:42 AM
    • Posts 41

    Our SQL Server is rarely rebooted, and if it does, it is OK to lose session state for our application. For the ASPState, which approach is more popular?

  • Re: ASPState tempdb or persistent

    04-18-2008, 4:29 PM
    Answer
    • Participant
      1,018 point Participant
    • ely79
    • Member since 03-17-2008, 1:56 PM
    • Denver, Colorado
    • Posts 188

    Two ways to look at it then, and you can decide which one is for you:

    If you store in tempdb, the db will stay small and not get bloated because tempdb is dumped every time.  However, in a reboot, you will lose state.

    If you store in ASPState, you won't have to worry about losing state.  I'm not for sure, but I imagine there is some type of process that purges expired sessions from the table, so this table probably won't become bloated as well.

    Out of the two options, I would imagine that ASPState is the more popular choice.  It is easier to setup and requires less security privileges.

  • Re: ASPState tempdb or persistent

    04-18-2008, 4:47 PM
    • Member
      131 point Member
    • Joco
    • Member since 07-23-2002, 8:42 AM
    • Posts 41

    If the SQL Server doesn't reboot, tempdb will not be recreated and could bet big. Even if ASP.NET states are stored in tempdb you still need to run the SQL Job to purge the expired data (Job name = ASPState_Job_DeleteExpiredSessions) which runs every 1 to 5 minutes (ours is every 1 minute).

    I was wondering about recommended practice in terms of maintenance, security or compatibility with recent .NET frameworks.
     

Page 1 of 1 (5 items)