1 2 Previous Next 21 Replies Latest reply on Jan 16, 2014 9:07 AM by DavidJondreau

    Filemaker/PHP connections stay logged in too long

    Tom_Droz

      Hi

       

      I have been noticing many of my web connections are logged in for long periods of time. I tested myself and with the extend privilege to 1 minute (fmreauthenticate1) the connections persist.

      Is there a better way to reduce the connection time? Every page has a login. Should every page also log out after the data is collected or would this slow down the process?

       

      Any ideas on reducing the server load would be appreciated!


      Thank you

      Tom

        • 1. Re: Filemaker/PHP connections stay logged in too long
          beverly

          This is for FMGO only. You can see If you change timeout with PHP directly.

           

          http://www.sitepoint.com/php-sessions/

           

          http://www.php.net/manual/en/function.msession-timeout.php

           

           

           

          -- sent from my iPhone4 --

          Beverly Voth

          --

          • 2. Re: Filemaker/PHP connections stay logged in too long
            mdenyse

            Tom,

             

            Are you referring to connections showing in the admin console? If so, since FM 12 the FM PHP API (in conjunction with the server) uses a cookie to keep sessions alive for a short amount of time (approx 5 minutes) to reduce the overhead of multiple page requests. Overall this is a good thing so I wouldn't worry about it being an issue.

             

            Mark

            • 3. Re: Filemaker/PHP connections stay logged in too long
              Tom_Droz

              Thanks Mark

              Yes i am referring to the admin console.  I just checked and I have multiple connections lasting over 30 minutes.  Do you know where the time in the API can be adjusted?

               

              Thanks Tom

              • 4. Re: Filemaker/PHP connections stay logged in too long
                mdenyse

                Hi Tom,

                 

                I'm not sure it can be adjusted; there's certainly no PHP method to call that I've ever noticed, and I don't think there's anything in the admin console (but double check just to make sure).

                 

                On these 30 minute connections: is that 30 minutes from the last request? I was under the impression that the timeout was about 5 minutes from the last request. I've honestly never watched it that carefully to time it - maybe others can chime in with more hard data...

                 

                Is there a reason you're so concerned about these connections? There's little overhead for them as they are different than an active connection with Pro or Go - there isn't any data actually flowing back and forth. This entire feature was added in 12 to increase performance so the server didn't have to keep building/tearing down connections on each PHP request.

                 

                Mark

                • 5. Re: Filemaker/PHP connections stay logged in too long
                  Tom_Droz

                  Hi Mark

                   

                  I am on a paid hosting site and I get this message sometimes twice a day

                   

                  FMS WARNING webserver

                   

                  Some problems were detected in the WS COMPONENT: COMPONENT IS NOT RESPONDING.

                   

                  My provider thinks that it might be because i have web user that are getting hung up.     I frequently have 20 FM users and 30+ web users at the same time.  I am guessing that the webusers is artificially high because of the connection issue.

                   

                  Tom

                  • 6. Re: Filemaker/PHP connections stay logged in too long
                    mdenyse

                    Hi Tom,

                     

                    I'd be surprised if these hibernated web connections are dragging down the server. If you can, I would open your admin console and then make a single php request and see how long it takes to time out. Then you'll at least know what the timeout is for your server.

                     

                    As to the warning message, that could be almost anything although it does sound like the server is overloaded wih requests. I'll leave that to others who may have more experience to know what it really means.

                     

                    Mark

                    • 7. Re: Filemaker/PHP connections stay logged in too long
                      Tom_Droz

                      Mark

                      Good idea.  I open a page then just left it and 20+ minutes later that connections is still live on my server. 

                       

                      Tom

                      • 8. Re: Filemaker/PHP connections stay logged in too long
                        mdenyse

                        Hi Tom,

                         

                        The time out should be about 3 minutes (I mentioned 5 previously but read up that it was closer to 3) so 20 minutes is rather odd. Is there any chance you could schedule a time to restart the server to see if this will magically clear things?

                         

                        To be clear: that was really just one PHP request? There aren't any AJAX calls occurring in the background keeping the connection alive?

                         

                        Mark

                        • 9. Re: Filemaker/PHP connections stay logged in too long
                          Tom_Droz

                          Mark

                           

                          Yes a restart clears the old, but the problem continues for any new connections. 

                          • 10. Re: Filemaker/PHP connections stay logged in too long
                            kamar

                            Hi Tom,

                             

                            My understanding is (and it's just my understand, based on what I've read, been told and observed)

                             

                            FMS11 :  each php request would initiate a new connection, perform the request and then disconnect the request.   This could add a huge overhead to each request depending on how many files had to be opened to complete the request.

                             

                             

                            FMS12+:  the first request would initiate a new connection, perform the request and return the data.   However, the php/cwp web session between the WPE and FMS would remain open / idle and wouldn't disconnect until the idle period had passed.

                            If another request comes in, it would then reuse the already open connection (in effect, resetting the idle counter).

                            Think of it as just another client who is doing occasional requestes - but not a single one user from your perspective.

                             

                             

                            It's also important to note that web requests are not linked to a specific client.  By this I mean,  the first request may be initiated by you - but the second may be another web client entirely.

                            If you are seeing a session open for 20+ minutes - it's entirely possible that you've had other web clients come in over that time who have reset the idle counter - making it appear like your connection is still live.

                             

                            FMS12+ will only open another web connection if it receives a second web request at the same time (ie.  the first web session is still in use).

                             

                             

                            This change is a huge improvement on FM11.   Imagine you have a web page which performs 3 separate queries to FMS.   In FMS11,  this would have resulted in three separate new connections.  In FMS12+,   the 2nd & 3rd queries would reuse the same connection  (already a overhead saving).    If the user then reloads the page (for example).  In FMS11, this would result in three whole new connections again.  In FMS12+, not only would it reuse the same connection - but also the files/tables will already be open - yet more of an overhead saving.

                             

                             

                            If you are seeing 30+ webusers connected in FMS Admin Console - then this means you have 30+ simultaneous connections coming in - or you aren't letting the connections close properly.   This is entirely possible and I would spend some time looking into this possibility.

                             

                             

                            It's important to remember that script triggers still fire in a web session.    Do you have any on first window opener script triggers or a on last window closing script triggers happening ?    Maybe add a if[ get( ApplicationVersion ) ... check with a 'Exit Script'  within if it's a server or web client  into these script triggers.

                            Are the layouts you are using dedicated for web or shared ?  If shared, are there any layout script triggers happening ?

                             

                            If you are seeing web connections initiated, but never going away - then it's entirely possible their 3 minute idle time is being reached - then some script is stopping them from closing properly.

                             

                             

                            regards

                             

                            Kent.

                            1 of 1 people found this helpful
                            • 11. Re: Filemaker/PHP connections stay logged in too long
                              Tom_Droz

                              Thanks Kamar

                               

                              I added an exit in my opener script.  Tested and now it seems to be exiting based on the timer.   Why that would work I have no idea, but it seems to for the moment!

                              • 12. Re: Filemaker/PHP connections stay logged in too long
                                mdenyse

                                Hi Tom,

                                 

                                Can you explain more what you did? It sounds like your script wasn't terminating, but if that was true how was your PHP code getting any data?

                                 

                                Mark

                                • 13. Re: Filemaker/PHP connections stay logged in too long
                                  kamar

                                  Hi Tom / Mark,

                                   

                                  I was thinking about that.

                                   

                                  The opener script must have been exiting - otherwise (as Mark has mentioned) you wouldn't be getting any data back.

                                   

                                   

                                  It's probably more the flow on effects of what the opener script was doing - that would be causing the real issues.

                                   

                                  eg.  If the opener script was going to another layout / file and leaving it there.  Then, it would still return data via the php query.

                                   

                                  But,  if that layout had a 'on exit layout' script trigger - or the other file had a 'on last Window Closed' script trigger - then that would explain why the issue is with disconnecting the session.

                                   

                                  regards

                                   

                                  Kent.

                                  • 14. Re: Filemaker/PHP connections stay logged in too long
                                    Tom_Droz

                                    I spoke too soon, problem still persist

                                    1 2 Previous Next