5 Replies Latest reply on Jul 9, 2014 7:24 AM by BKBK

    Maximum number of sessions?

    ACS LLC

      Could anybody tell me if there is a maximum number of sessions that can be active at any time and if so what that is and if it is effected by factors such as memory?

       

      This would be on a Windows Server 2008 64bit, with 4gig of Ram

       

      Thanks

       

      Mark

        • 1. Re: Maximum number of sessions?
          BKBK Adobe Community Professional & MVP

          The statement I would make is that the number of sessions affects memory, rather than that memory affects the number of sessions. May I ask why you wish to know?

           

          In any case, the maximum number of sessions is in the millions. The chance that you will 'max out' on 64Bit-4GB is practically zero.

           

          You can in fact work it out yourself. Run <cfdump var="#session#">. Count the total number of characters in the values of the session variables. Mine is 232, which I will round up to 250. One character is 1 byte, so that is 250 bytes. Assuming that the amount of memory available to my application is  1 GB, this gives a maximum of 4 000 000 sessions.

          • 2. Re: Maximum number of sessions?
            ACS LLC Level 1

            I am currently developing a mobile app that will utilize data from the server displaying it within the webkit, so in effect at times it will be like the user is visiting our web site, and as they have an account in the system I'll need to keep them logged in and authenticated. I can use a key to have the server reestablish the session. My concern was the amount of sessions could be significant, but it looks like that should not be a concern,

             

            Looking at the server right now out of the 4gig of RAM it has roughly

            1.5gig cached

            1.7fif available

            174meg free

             

            So based on what you are saying I'd still have plenty of capacity, the site is in development right now, but I know that the amount of data stored in the session will be very small just a few small ID's, and a couple of other small bits of info.

             

            So if push came to shove and it looks like it would not, more memory would immediately increase capacity. I could put it on a 32gig server and never have to think about it.

             

            Is there impact to the server performance as the number of active sessions grow? Let's say you literally had 500,000 in memory, would there be any potential issues?

            • 3. Re: Maximum number of sessions?
              BKBK Adobe Community Professional & MVP

              As I showed, you can actually work it out yourself. Suppose you have 500 000 active sessions in memory, each having a load of 1000 bytes, and 1 GB memory available in the Java Virtual Machine. Then there will likely be memory issues. It all depends on the server, the Virtual Machine and your application.

               

              This estimation method is just a rule of thumb. It makes the unrealistic assumption that the Virtual Machine is only busy with session management. After you factor in the memory demands of the server, the JVM and your application, and the type of memory configuration, it may turn out that just 1 to 5% of the memory is available for sessions. Divide this amount by the average number of bytes in a session, to get an estimate for the maximum number of sessions.

              • 4. Re: Maximum number of sessions?
                ACS LLC Level 1

                Got it. I'll just have to watch it, but even with conservative numbers it looks like I am going to in reasonably good shape still.. If I ever have 500,000 sessions running, I'll consider it a nice problem to have

                • 5. Re: Maximum number of sessions?
                  BKBK Adobe Community Professional & MVP

                  You should have no worries. In my experience, the 'workable' maximum number of sessions on the ColdFusion 10 server is of the order of tens of thousands.

                   

                  Even so, I only encountered such maxima in a test environment. As a matter of fact, if you use a load-testing tool to simulate tens of thousands of requests, issues will arise earlier from the web server and from the database connection than from the Coldfusion server.