reyk / relayd

OpenBSD relayd daemon -experimental
Other
78 stars 11 forks source link

relayctl reload causes relayd to "hang" #6

Closed mischapeters closed 8 years ago

mischapeters commented 9 years ago

When issuing the command "relayctl reload" on OpenBSD 5.7 with the below config it seems relayd "hangs" and hogs the CPU. At this stage it's no longer possible to connect. I am not seeing anything in the debug log that stands out, any way I can pin down what is going on?

After a minute or so I am seeing:

  PID USERNAME PRI NICE  SIZE   RES STATE     WAIT      TIME    CPU COMMAND
27955 _relayd   64    0 1544K 3732K onproc    -         2:38 99.12% relayd
 5881 _relayd   64    0 1456K 3508K onproc    -         2:39 99.02% relayd
 7728 _relayd   64    0 1456K 3520K onproc    -         0:00 99.02% relayd

The processes need to be killed manually for relayd to start again.

table <wwwhosts> { <ips> }
table <redirecthost> { 127.0.0.1 }

relay www {
        listen on egress port 80
        forward to <redirecthost> port 80
}

http protocol httpsfilter {
        match request header set "X-ClientIP" value "$REMOTE_ADDR"
        match request header append "X-Forwarded-For" value "$REMOTE_ADDR"
        match request header append "X-Forwarded-By" value "$SERVER_ADDR:$SERVER_PORT"
        match request header set "Connection" value "close"
        tls { no client-renegotiation, edh params 2048 }
}

relay wwwtls {
        listen on egress port 443 tls
        protocol httpsfilter
        forward to <wwwhosts> port 80 mode roundrobin check http "/" code 200
}
hb9cwp commented 9 years ago

The following appears to have fixed similar issues with relayd on 5.7 i386 for me (also "relayctl reload" now works without relayd dying at every reload :-) :

"015: RELIABILITY FIX: September 28, 2015 All architectures Various problems were identified in relayd and merged back from current to 5.7 in this maintanance update. http://ftp.openbsd.org/pub/OpenBSD/patches/5.7/common/015_relayd.patch.sig

from http://www.openbsd.org/errata57.html