Open muhtarcanrb opened 6 years ago
Did you ever find a solution to this?
Nope.
I meet the same problem and no solution!
I meet the same problem too!
try adding these lines to your uwsgi.ini file:
buffer-size = 32768 post-buffering = 32768
do you find a slolution? this happens on occasion for me. i cannot find the reasion.
@drn8 i've set uwsgi config like that, but it doesn't work.
Any update in this issue? Or should we create issue on HAProxy side?
Using uwsgi with docker and jwilder/nginx-proxy (basic config) + django
[uwsgi-http key: x.x.x.x.x client_addr: 172.17.0.2 client_port: 47324] hr_write(): Connection reset by peer [plugins/http/http.c line 565]
[uwsgi]
http = :8080
module = demo.wsgi
master = 1
processes = 4
threads = 2
stats = :8081
static-map = /static=/app/static
static-expires = /* 7776000
offload-threads = %k
Error was shown few times when i first started the container. Now it's not here. It's just not showing anymore.
Edit: Yet it happend again.
@amadeuszkryze @bukowa
On my laptop(4c16G) , I used apache ab to test my http server, found that:
hr_read(): Connection reset by peer
appears more often when setting processes
with a small number and ab concurrency
with a big number.
So I think a main reason of hr_read(): Connection reset by peer
is low http server performance.
uwsgi: What defines the number of workers/process that a django app needs?
shows that processes
number should be confirmed after test.
On my server(8c16G), I setprocesses
with 128.
It might be that uWSGI is killing workers that have a request in progress, according to some of these settings:
max-requests = 1000 ; Restart workers after this many requests
max-worker-lifetime = 3600 ; Restart workers after this many seconds
reload-on-rss = 2048 ; Restart workers after this much resident memory
worker-reload-mercy = 60 ; How long to wait before forcefully killing workers```
the same problem with uwsgi 2.0.18
100.97.208.244 - - [12/Jun/2020:01:07:35 +0800] "HEAD / HTTP/1.0" 200 93152 226 "-" "-"
[uwsgi-http key: iZuf61ouik5mwrs7ft8ompZ client_addr: 100.97.208.244 client_port: 6217] hr_write(): Connection reset by peer [plugins/http/http.c line 565]
[uwsgi-http key: iZuf61ouik5mwrs7ft8ompZ client_addr: 100.97.208.154 client_port: 26633] hr_write(): Connection reset by peer [plugins/http/http.c line 565]
100.97.208.154 - - [12/Jun/2020:01:07:35 +0800] "HEAD / HTTP/1.0" 200 93152 245 "-" "-"
100.97.208.152 - - [12/Jun/2020:01:07:35 +0800] "HEAD / HTTP/1.0" 200 93152 275 "-" "-"
[uwsgi-http key: iZuf61ouik5mwrs7ft8ompZ client_addr: 100.97.208.152 client_port: 47282] hr_write(): Connection reset by peer [plugins/http/http.c line 565]
100.97.208.204 - - [12/Jun/2020:01:07:35 +0800] "HEAD / HTTP/1.0" 200 93152 282 "-" "-"
i solved it by raise these values: proxy_buffer_size 64k; proxy_buffers 4 32k; proxy_busy_buffers_size 64k;
any solution? @huangrongfu where did you put that values?
@esseti those are nginx configuration options.
In our case the timeouts are happening within cluster, no haproxy/nginx in between. So far our solution has been to migrate to Node.js.
This may be of interest: https://github.com/lae/ansible-role-netbox/issues/130
check haproxy config, remove option http-server-close
then it's fixed
option http-server-close
I don't have this option but still the other error. @lileixuan can you put here your uwsgi conf?
i'm wondering if it's due to the use of http
instead of http-socket
switching from http
to http-socket
solves the problem
After we activated health check in HAProxy, we started to see enormous amount of Connection reset by peer error.
We are using latest version of uWSGI (2.0.15)
uWSGI configuration: