Skip to content

Instantly share code, notes, and snippets.

@nickva
Created September 27, 2023 03:06
Show Gist options
  • Select an option

  • Save nickva/9d53e03e54fda24e77daa236b894a346 to your computer and use it in GitHub Desktop.

Select an option

Save nickva/9d53e03e54fda24e77daa236b894a346 to your computer and use it in GitHub Desktop.
CouchDB Haproxy With Quick Client Disconnect
global
maxconn 10000
spread-checks 5
defaults
mode http
log global
option httplog
log stdout format raw local0
balance roundrobin
option redispatch
retries 4
timeout client 150s
timeout server 360s
timeout connect 500
option abortonclose
frontend http-in
option clitcpka
clitcpka-cnt 3
clitcpka-intvl 1s
clitcpka-idle 3s
bind *:5984
default_backend servers
backend servers
option httpchk GET /_up
server node1 127.0.0.1:15984 check inter 600s
@nickva
Copy link
Copy Markdown
Author

nickva commented Sep 27, 2023

CouchDB logs show the request process is killed within 5 seconds or so

[notice] 2023-09-27T03:03:22.837658Z node1@127.0.0.1 <0.18737.0> 47b8291a4c 127.0.0.1:5984 127.0.0.1 adm PUT /db?q=1 201 ok 114
[notice] 2023-09-27T03:03:22.920781Z node1@127.0.0.1 <0.18737.0> e1ca592e21 127.0.0.1:5984 127.0.0.1 adm POST /db/_bulk_docs 201 ok 79
[notice] 2023-09-27T03:03:22.999434Z node1@127.0.0.1 <0.18737.0> fdbba7a0ee 127.0.0.1:5984 127.0.0.1 adm POST /db/_bulk_docs 201 ok 75
[notice] 2023-09-27T03:03:23.075838Z node1@127.0.0.1 <0.18737.0> f9af5e4d9a 127.0.0.1:5984 127.0.0.1 adm POST /db/_bulk_docs 201 ok 73
[notice] 2023-09-27T03:03:23.152235Z node1@127.0.0.1 <0.18737.0> 888ea8db06 127.0.0.1:5984 127.0.0.1 adm POST /db/_bulk_docs 201 ok 73
[error] 2023-09-27T03:03:23.155898Z node1@127.0.0.1 <0.18737.0> b311b36392  ++++++++++TRACING _find++++++++ mango_httpd:handle_find_req@208 REQPID:<0.18737.0>
(<0.18737.0>) spawn <0.19452.0> as erlang:apply(#Fun<rexi_monitor.1.77517421>,[])
(<0.18737.0>) link <0.19452.0>
(<0.18737.0>) spawn <0.19453.0> as erlang:apply(#Fun<fabric_streams.3.91837225>,[])
(<0.18737.0>) exit {shutdown,client_disconnected}

@nickva
Copy link
Copy Markdown
Author

nickva commented Sep 27, 2023

Capture traffic from both client <-> haproxy:5984 and haproxy <-> couchdb:15984 connections

tcp port 5984 or tcp port 15984

Screenshot 2023-09-26 at 11 10 04 PM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment