10 Replies Latest reply on Feb 12, 2014 3:56 AM by iancook

    FMS 13 WPE crashing. How can I terminate PHP queries?

    iancook

      Hi

       

      Hope I've posted this question in the right place.

       

      I'm having big issues with WPE crashing - had it on 12 and was hoping that 13 might fix it - seemed to run OK for a bit and then the same old crashes started during periods of increased web activity.

       

      ====== The Set-up =====

       

      I've got FMSv13 running on a new mac mini server 10.9.1 with 8GB RAM (512 allocated to DB)

       

      Running 4 databases with 25 FMPro clients.

       

      No other software is installed (no AV, no Server)

       

      Web Publishing is enabled, but PHP, Webdirect and XML are all turned off

       

      Connecting to this server are two web servers via PHP API (the new FM13 version). Both are on the same network. One is an intranet for the staff to view the jobs and the other has external access for clients to access their jobs.

       

      The web pages have more than one FileMaker request in each page (there is a secuirty section to pass before the web page is served up).

       

      Both machines are OS X 10.9, they are running PHP 5.4.17 amd Apache 2.2.24

       

      Each machine uses a different account name to access FileMaker.

       

      Max web clients is set to 200

       

      ======= The Problem ======

       

      There are no issues on the FMPro side - everything is stable, all the issues are related to the WPE.

       

      The WPE gets swamped by requests and the web becomes unresponsive.

       

      When this happens, there are approx 200 web clients showing in the client activity list, and the RAM allocation to WPE sky rockets.

       

      Normally there are 2 web clients - one called IntranetDataUser and another called clientDataUser - this is to make sure that the same client account is not called from a different IP as I know that this can be an issue for WPE

       

      I've done a lot of testing to replicate the problem. At the weekend I turned off the Intranet server and set 4 machines to randomly load one of 10 web pages from the client server every 20 seconds. All runs fine for a while and then all of a sudden more clients appear in the activity list (all the same useranme), and then it snowballs, the client number hits 200 and the memory goes up, 1GB, 2GB etc

       

      So I increased the number of client sessions to 2000. After a while there were 2000 web clients in my activity list and the WPE was over 4GB.

       

      If I turn off the web server it takes 3 minutes for all the client web sessions to disappear.

       

      I tried it with 2 machines, seemed to run OK, then with 10 machines it also ran OK for a bit. A few times there were 3 or 4 clients, and then it went mad again.

       

      ======== The Question ======

       

      Why is the WPE hanging onto the requests for 3 minutes? Is it waiting for a reponse from the PHP API on the web server?

       

      When coding PHP and MySQL, at the end of the MqSQL data request I set it to NULL,

       

      e.g.

      $db = new PDO( etc...

      ...

      $db = NULL;

       

      As far as I know this closes the connection and tells the database server to move onto other requests.

       

      Is there a command for the PHP API that has the same effect?

       

      Thanks for any light that anyone can shed on this issue.

       

      Cheers

      Ian

        • 1. Re: FMS 13 WPE crashing. How can I terminate PHP queries?
          databuzz

          Hi Ian,

           

          The persistent connection for PHP clients was a new feature introduced in FileMaker Server v12. There doesn't appear to be much (if any) documentation around this feature - see earlier discussion here:

           

          https://fmdev.filemaker.com/message/110759

           

          It was designed to improve performance so the same client didn't have to continually authenticate every time they accessed a page within the 3 minute period. There's no equivalent command to close the connection using the PHP API that I'm aware of.

           

          HTH,

          Andrew

           

          FileMaker 12/11/10/9/8 Certified Developer

          Databuzz

          - - - - - - - - - - - - - - - - -

          Phone: +61 2 9484 6565

          Mobile: +61 418 468 103

          Email: andrew@databuzz.com.au

          http://www.databuzz.com.au

          • 2. Re: FMS 13 WPE crashing. How can I terminate PHP queries?
            iancook

            Thanks Andrew that's really helpful.

             

            We've been running this solution for years and all was OK till we updated to 12, so I think there must be some weakness in the persistent connections. All was fine during v12 testing and during the first few weeks of going live, but then the WPE crashes started and by then it was too late to step back to 11.

             

            Yesterday the Web Publishing on FMS13 completely died. We restarted a few times, sometimes even the Admin Console just refused to load. So I reinstalled FMS13. All was OK for 3 hours and then web publishing died again.

             

            I've just installed FMS12.0v6 in the hope of some stability. At least if WPE does crash on 12, we can easily restart it via terminal.

            • 3. Re: FMS 13 WPE crashing. How can I terminate PHP queries?
              Malcolm

              Web Publishing is enabled, but PHP, Webdirect and XML are all turned off

               

              How are your web clients communicating with FMS, via xDBC?

               

              malcolm

              • 4. Re: FMS 13 WPE crashing. How can I terminate PHP queries?
                iancook

                Hi Malcolm

                 

                In FMS13, you can have Web Publishing turned on, even though the other services (PHP, Web Direct, XML Publishing) are not enabled. I presume that the 2 web servers connect to the WPE.

                 

                I turned PHP, Web Direct, XML Publishing on to see if it made any difference, but there was no change.

                 

                Ian

                • 5. Re: FMS 13 WPE crashing. How can I terminate PHP queries?
                  Malcolm

                  In FMS13, you can have Web Publishing turned on, even though the other services (PHP, Web Direct, XML Publishing) are not enabled. I presume that the 2 web servers connect to the WPE.

                   

                  How are you connecting?

                   

                  Malcolm

                  • 6. Re: FMS 13 WPE crashing. How can I terminate PHP queries?
                    iancook

                    I have one machine running FMS with Web Publishing turned on. This machine does not have any web traffic (80/443) directed to it. There are no webpages served direct from this machine.

                     

                    I have two other machines that are Web Servers.

                     

                    The Web Servers direct their FileMaker queries to the FMS machine via the PHP API

                     

                    Ian

                    • 7. Re: FMS 13 WPE crashing. How can I terminate PHP queries?
                      iancook

                      Hi Andrew

                       

                      I've been thinking about this and the 3 minute persitent connection seems to be a good idea if each web user is connecting to the FileMaker server directly - as with IWP and WebDirect. But with PHP on a remote server I can see that this means that all the queries from a web server are going to try and go through one client session - and that is bombing it out and causing confusion with multiple copies.

                       

                      I notice on FM13 the option to have a 3 machine set up has been removed and the WPE has to be either on the FMS or the Web server. I am wondering if this is the case as WPE can only handle direct connections as it has to allocate one the of the persistent web client sessions to a user.

                       

                      I am going to test a new idea. I have created 20 identical php user accounts in the filemaker file. idu00, idu01, idu02 etc. On the php server connect script I will allocate a user account to the web connection based on the numerical value of it's php session id. I know that with only 20 accounts there will be some sharing, btu hopefully it will create a primitive form of load balancing, sharing the requests over 20 user accounts, thus allowing some to close and release memory in the WPE.

                       

                      If there was a way of reducing the 3 minute allocation as well to say 10 seconds, then that would be great.

                      • 8. Re: FMS 13 WPE crashing. How can I terminate PHP queries?
                        databuzz

                        Hi Ian,

                         

                        There's no preference/setting to change the default connection time that I'm aware of unfortunately. It would be good to have some documentation around this feature.

                         

                        Andrew

                        • 9. Re: FMS 13 WPE crashing. How can I terminate PHP queries?
                          user19752

                          You can see the WPE  log at

                          /library/FileMaker Server/Web Publishing/publishing-engine/jwpc-tomcat/logs

                          I found that there are SEVERE memory leaking and some WARNING about miss configurations, but I can't resolve it.

                          • 10. Re: FMS 13 WPE crashing. How can I terminate PHP queries?
                            iancook

                            Yes, leaking has always been a problem that no one on the forums has found a definitive answer for. Especially in PHP API. I tried 13 but we had problems with FMS13. WPE got worse over a matter of days and then it would not restart. So we restarted the machine and the admin console would not come up, then Filemaker Pro clients would not connect. Then finally got it restarted but WPE did not work at all. So I re-installed it overnight and it happened again within 24 hours. We have gone back to FMS12 but as we were on Mavericks used the new version 6. We are now getting more crashes than ever. WPE leaking like a sinking ship with the slightest hint of several web users - currently crashing twice an hour. Everyone is sick of it. I've tired everything, compacting, restarting etc... Client has had enough and we are busy rewriting in MySQL.