Skip to content

bug: haproxy service timeout #369

@tanmoysrt

Description

@tanmoysrt

Describe the bug

This bug may not be seen usually. It was playing 👀 hide and seek for 2~3 weeks. It got revealed during stress testing (single process) and almost 60% of requests failed. It happens only when we have a custom port and hooked up multiple http services and domains on that port.

What's wrong ?
Check config

frontend fe_tcp_8080_test11.ip-13-200-80-4.swiftwave.xyz from unnamed_defaults_1
  mode http
  maxconn 2000
  bind :8080
  use_backend be_tes56_80 if { hdr(host) -i test11.ip-13-200-80-4.swiftwave.xyz:8080 }

frontend fe_tcp_8080_test3.ip-13-200-80-4.swiftwave.xyz from unnamed_defaults_1
  mode http
  maxconn 2000
  bind :8080 name :8080
  use_backend be_ntfy_80 if { hdr(host) -i test3.ip-13-200-80-4.swiftwave.xyz:8080 }

The current config may not looks so bad and HAProxy anyhow managed to work with this config without any kind of error & warning. But large no of requests failding and too many DNS requests goes to docker swarm internal DNS. As a result HAProxy starts taking around 20% CPU of 2 vCPU server.

Test with current config -
image


🙈 It was a blind mistake and ignored as it was working.
We should create single frontend per port and handle subdomains in that block. Like below config,

frontend fe_tcp_8080 from unnamed_defaults_1
  mode http
  maxconn 2000
  bind :8080 name :8080
  use_backend be_ntfy_80 if { hdr(host) -i test3.ip-13-200-80-4.swiftwave.xyz:8080 }
  use_backend be_tes56_80 if { hdr(host) -i test11.ip-13-200-80-4.swiftwave.xyz:8080 }

The result is just 🔥.
image

0 Failed Requests

Approach -
Need to modify haproxy_manager to handle the behaviour.

Warning

Can't be backported to v1. [going to break existing configuration format]

Device Information [optional]

- OS: Ubuntu 22.04
- Swiftwave version: 1.0.5
- Docker version: latest

Are you working on this issue?

Yes

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions