From 4846e1e8d6c00b15b318831389796fadf5d255da Mon Sep 17 00:00:00 2001 From: ed Date: Mon, 14 Jun 2021 19:27:34 +0200 Subject: [PATCH] mention num.clients for rproxy --- contrib/nginx/copyparty.conf | 5 +++++ docs/tcp-debug.sh | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 docs/tcp-debug.sh diff --git a/contrib/nginx/copyparty.conf b/contrib/nginx/copyparty.conf index b8c3f454..d39d8453 100644 --- a/contrib/nginx/copyparty.conf +++ b/contrib/nginx/copyparty.conf @@ -1,3 +1,8 @@ +# when running copyparty behind a reverse-proxy, +# make sure that copyparty allows at least as many clients as the proxy does, +# so run copyparty with -nc 512 if your nginx has the default limits +# (worker_processes 1, worker_connections 512) + upstream cpp { server 127.0.0.1:3923; keepalive 120; diff --git a/docs/tcp-debug.sh b/docs/tcp-debug.sh new file mode 100644 index 00000000..3a275243 --- /dev/null +++ b/docs/tcp-debug.sh @@ -0,0 +1,32 @@ +(cd ~/dev/copyparty && strace -Tttyyvfs 256 -o strace.strace python3 -um copyparty -i 127.0.0.1 --http-only --stackmon /dev/shm/cpps,10 ) 2>&1 | tee /dev/stderr > ~/log-copyparty-$(date +%Y-%m%d-%H%M%S).txt + +14/Jun/2021:16:34:02 1623688447.212405 death +14/Jun/2021:16:35:02 1623688502.420860 back + +tcpdump -nni lo -w /home/ed/lo.pcap + +# 16:35:25.324662 IP 127.0.0.1.48632 > 127.0.0.1.3920: Flags [F.], seq 849, ack 544, win 359, options [nop,nop,TS val 809396796 ecr 809396796], length 0 + +tcpdump -nnr /home/ed/lo.pcap | awk '/ > 127.0.0.1.3920: /{sub(/ > .*/,"");sub(/.*\./,"");print}' | sort -n | uniq | while IFS= read -r port; do echo; tcpdump -nnr /home/ed/lo.pcap 2>/dev/null | grep -E "\.$port( > |: F)" | sed -r 's/ > .*, /, /'; done | grep -E '^16:35:0.*length [^0]' -C50 + +16:34:02.441732 IP 127.0.0.1.48638, length 0 +16:34:02.441738 IP 127.0.0.1.3920, length 0 +16:34:02.441744 IP 127.0.0.1.48638, length 0 +16:34:02.441756 IP 127.0.0.1.48638, length 791 +16:34:02.441759 IP 127.0.0.1.3920, length 0 +16:35:02.445529 IP 127.0.0.1.48638, length 0 +16:35:02.489194 IP 127.0.0.1.3920, length 0 +16:35:02.515595 IP 127.0.0.1.3920, length 216 +16:35:02.515600 IP 127.0.0.1.48638, length 0 + +grep 48638 "$(find ~ -maxdepth 1 -name log-copyparty-\*.txt | sort | tail -n 1)" + +1623688502.510380 48638 rh +1623688502.511291 48638 Unrecv direct ... +1623688502.511827 48638 rh = 791 +16:35:02.518 127.0.0.1 48638 shut(8): [Errno 107] Socket not connected +Exception in thread httpsrv-0.1-48638: + +grep 48638 ~/dev/copyparty/strace.strace +14561 16:35:02.506310 <... accept4 resumed> {sa_family=AF_INET, sin_port=htons(48638), sin_addr=inet_addr("127.0.0.1")}, [16], SOCK_CLOEXEC) = 8127.0.0.1:48638]> <0.000012> +15230 16:35:02.510725 write(1, "1623688502.510380 48638 rh\n", 27