Load Balancer with certificate in Forwarding rules return 504 gateway timeout at minute

Posted June 19, 2020 924 views
Load Balancing


I have a legacy application in php 5.6, with the runtime at 3,600.

To give it greater availability, a new server was configured and a DO load balancer was used, this generated the problem that when changing the server, the user’s session is closed, to fix it, Sticky sessions were activated, but this forced me to add the SSL certificate. in Forwarding rules.

However, this started generating timeout with processes of more than 1 minute, I have done several tests and when I use Passthrought in Forwarding rules it allows processes of up to 5 minutes without generating timeout.

At this time I must choose between the user logout every time the server changes or processes fall for more than a minute. Is there a way to modify the timeout of the balancer when using SSL certificate?

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
1 answer

Hi there @oscarricardosan,

I believe that it is not possible to change the timeout of the Loadbalancer.

What I could suggest instead is using a caching solution like Redis or Memcache to store your PHP sessions in.

You can take a look at this tutorial on how to setup a Redis server as a session handler for PHP on Ubuntu:

Hope that this helps!

by Erika Heidi
Redis is an open source key-value cache and storage system, also referred to as a data structure server for its advanced support for several data types, such as hashes, lists, sets, and bitmaps, amongst others. It also supports clustering, which makes it often used for highly-available and scalable environments. In this tutorial, we'll see how to install and configure an external Redis server to be used as a session handler for a PHP application running on Ubuntu 14.04.