Hi,

I'm running a setup on OpenBSD 7.3 (amd64, 16GB RAM) with relayd,
varnish, httpd and php-fpm. When uploading a large >2GB file through
our web application, *occassionally* relayd starts to consume an
increasing amount of memory (as observed with top) until it hits
resource limits from login.conf and the file upload terminates
prematurely. In /var/log/daemon:

relayd[572]: relay mysite4, session 14 (1 active),
0, xxx -> 127.0.0.1:8443, Cannot allocate memory (500 Internal
Server Error), POST: Undefined error: 0

There is no temporary file created in /var/www/tmp. 

*Sometimes* the upload does succeed, in that case memory usage of
relayd remains low and the data is being flushed to disk (a growing
temporary file in /var/www/tmp).

File uploads appear to work fine when relayd is taken out of
the loop. Obviously I could tweak login.conf, but the high memory
consumption (although temporary) may also cause other problems.

Why does relayd sometimes buffer "the whole file" in memory? Can this be
configured somehow?

Possibly related but very old, no solution:
https://marc.info/?l=openbsd-misc&m=132588522002336&w=2


Kind regards,
Erwin


/etc/relayd.conf:

table <httpd> { 127.0.0.1 }

log connection

http protocol "https" {
        tls keypair "server"
        return error
        pass
}

relay "mysite4" {
        listen on xxx port 443 tls
        protocol "https"
        forward to <httpd> port 8443 check tcp
}

Reply via email to