Richard Williams2

Q: server 5 proxy timeout settings

I recently upgraded to Server 5.0.4 and then to 5.0.15.  I host a number of websites and one of them uses an external server to obtain data and this can take a few minutes, depending on the search requested.  This ran fine on previous versions of server but I was getting error 502 on Server 5.0.x due to the reverse proxy timing out before the external server had responded.  On Server 5.0.4 I tried to avoid this by setting up a second Wi-Fi connector and setting Apache to listen for port 80 on the extra IP address and this worked.  However as soon as I upgraded to 5.0.15, my settings were overwritten again and I was back to square one.  It took me quite a long time to find a solution having tried adding ProxyTimeout statements in various places to no avail.  Here's what finally worked for me.

In /library/server/Web/Config/proxy/apache_serviceproxy.conf I modified the generic ProxyPass statement right at the end of the VirtualHost *:80 section to add a timeout as follows:
ProxyPass / http://127.0.0.1:34580/ timeout=300
and this increased the default timeout to 5 minutes (300 seconds).

I hope this might help someone else with the same problem.

Mac mini, OS X El Capitan (10.11.1), Server 5.0.15

Posted on Nov 10, 2015 6:48 AM

Close

Q: server 5 proxy timeout settings

  • All replies
  • Helpful answers

Previous Page 2
  • by Jarv15,

    Jarv15 Jarv15 Jan 8, 2016 9:14 AM in response to Bunnyfu
    Level 1 (14 points)
    Servers Enterprise
    Jan 8, 2016 9:14 AM in response to Bunnyfu

    Thank you Bunnyfu that timeout def helps a lot with PM throwing errors. It was getting frustrating.

  • by Bosco1983,

    Bosco1983 Bosco1983 Jan 29, 2016 12:54 AM in response to 4nNtt
    Level 1 (61 points)
    Servers Enterprise
    Jan 29, 2016 12:54 AM in response to 4nNtt

    Hi 4nNtt,

     

    what does that command do exactly?

     

    cheers

  • by 4nNtt,

    4nNtt 4nNtt Jan 30, 2016 8:00 AM in response to Bosco1983
    Level 1 (0 points)
    Jan 30, 2016 8:00 AM in response to Bosco1983

    It lists current activity in the Postgres database.  The timeouts are occurring because the database is overloaded due to an inefficient stored procedure.  By monitoring activity you can check to see when the load has dropped far enough to continue using the web interface.  Basically if everything lists as idle then performance should be good again.   The problematic stored procedures are related to VPP.  It appears to have gotten worse after device assignment was added.  They are called to get license counts for apps at the user, group, device, or device group levels.  The apps section only gets the overall license counts which have no performance impact.

  • by Bosco1983,

    Bosco1983 Bosco1983 Feb 1, 2016 4:47 AM in response to 4nNtt
    Level 1 (61 points)
    Servers Enterprise
    Feb 1, 2016 4:47 AM in response to 4nNtt

    Ace, cheers.

  • by Richard Williams2,

    Richard Williams2 Richard Williams2 May 19, 2016 9:18 AM in response to Richard Williams2
    Level 1 (34 points)
    Mac OS X
    May 19, 2016 9:18 AM in response to Richard Williams2

    Since my original post I have upgraded to Server 5.1.5 and my suggestion no longer worked.  The only setting I can get to work now is to put ProxyTimeout 300 immediately after the Listen lines at the head of apache_serviceproxy.conf.  It doesn't seem to work if the ProxyTimeout is put inside the <virtual> sections.

  • by Bosco1983,

    Bosco1983 Bosco1983 May 20, 2016 12:58 AM in response to Richard Williams2
    Level 1 (61 points)
    Servers Enterprise
    May 20, 2016 12:58 AM in response to Richard Williams2

    Ace thanks.  Since the update my profile manager seems a LOT better.  I'll hold off adding the timeout command for now but handy to have it just in case.

  • by Richard Williams2,

    Richard Williams2 Richard Williams2 Aug 9, 2016 3:21 AM in response to Richard Williams2
    Level 1 (34 points)
    Mac OS X
    Aug 9, 2016 3:21 AM in response to Richard Williams2

    What hasn't been said is that whenever the proxy settings are changed, the proxy service must be restarted.  This is not the same as restarting the web service.  One way to do this is a Restart, obviously.  The other way is to execute the command

    sudo /Applications/Server.app/Contents/ServerRoot/usr/sbin/serviceproxyctl restart

     

    If the proxy server is not restarted none of the ProxyPass settings will be active.

  • by Bosco1983,

    Bosco1983 Bosco1983 Aug 11, 2016 7:26 AM in response to Richard Williams2
    Level 1 (61 points)
    Servers Enterprise
    Aug 11, 2016 7:26 AM in response to Richard Williams2

    Latest server update fixed this for me

Previous Page 2