Page MenuHomeVyOS Platform

Allow configuring more timeouts for HAProxy
Closed, ResolvedPublicFEATURE REQUEST

Description

Summary

Allow configuration of timeout client for frontends and default values for timeouts.

Use case

We have a couple of applications that by necessity can only respond slowly to some requests (600s and more).

In an ideal world we could change the protocol to incorporate a heartbeat or a polling approach, but unfortunately we don't control the client applications.

The existing (but undocumented) backend timeout configuration is not enough, haproxy closes the connection after 50s with the current defaults.

Additional information

By manually modifying the generated haproxy.cfg file, we were able to check that setting timeout client 600s in the defaults section does indeed resolve the problem for us - until the next regeneration of the config.

Ideally there would be something like
set load-balancing haproxy service <frontend-name> timeout client <seconds>
to configure an individual frontend timeout (similar to what already works for setting the backend timeout).

And maybe

set load-balancing haproxy timeout server <seconds>
set load-balancing haproxy timeout client <seconds>

to set the server wide defaults.

Details

Version
-
Is it a breaking change?
Perfectly compatible
Issue type
Feature (new functionality)

Event Timeline

Viacheslav triaged this task as Wishlist priority.Feb 22 2025, 1:55 PM

@treo Do you know is such timeout could be configurable for global-default/frontend/backend? I mean all the sections support them?

timeout client xx
timeout connect xx
timeout server xx
timeout check xx

According to the documentation the timeouts are supported like that:
timeout client: defaults, frontend, listen
timeout connect: defaults, listen, backend
timeout server: defaults, listen, backend
timeout check: defaults, listen, backend

Viacheslav changed the task status from Open to In progress.Feb 22 2025, 2:50 PM
Viacheslav claimed this task.

PR https://github.com/vyos/vyos-1x/pull/4360

set load-balancing haproxy service web backend 'bk01'
set load-balancing haproxy service web port '80'
set load-balancing haproxy service web timeout client '600'

set load-balancing haproxy backend bk01 server srv01 address '127.0.0.1'
set load-balancing haproxy backend bk01 server srv01 port '8888'

set load-balancing haproxy timeout check '4'
set load-balancing haproxy timeout client '600'
set load-balancing haproxy timeout connect '12'
set load-balancing haproxy timeout server '120'
Viacheslav changed the task status from In progress to Needs testing.Feb 24 2025, 7:45 PM

@treo Could you check the latest rolling to confirm if everything works as expected?

Forgot to circle back on this. But it does work.

Viacheslav moved this task from Need Triage to Completed on the VyOS Rolling board.