Mailing List Archive

out of workspace (bo)
Hello,

I have set up a server as follows :
nginx reverse proxy ? varnish ? nginx ? php-fpm ? symfony with apiplatform

All routes work fine, except one that returns a zip file (below 300 MB) and
returns a 503 error most of the time.
Even if the zip is 1 MB, it returns errors, which is weird because I have
other routes that return JSON responses of more than 3 MB and works fine.
There are no specific headers or cookies, it's only a PHP controller that
returns a zip file, nothing fancy.

I've tried increasing workspace_backend to 2 MB, but it only makes the
error occur less often.

The following logs are about a zip file of around 1 MB
*Error log :*
https://pastebin.com/ye0KGV4M
*Success log* (on the same route/response) *:*
https://pastebin.com/KUvwQLKQ

Thank you,
Kevyn.
Re: out of workspace (bo) [ In reply to ]
Here is my VCL :
https://pastebin.com/TpN8r0Um

And my varnishd command :
/usr/sbin/varnishd -a :8181 -p feature=+http2 -p
http_resp_hdr_len=200k -p http_resp_size=2M -p http_req_hdr_len=200k
-p workspace_backend=256k -p workspace_client=256k -p http_max_hdr=256
-f /etc/varnish/default.vcl -s malloc,4G

On Wed, Aug 30, 2023 at 11:50?AM Kevyn Fyleyssant <
kevyn.fyleyssant@gmail.com> wrote:

> Hello,
>
> I have set up a server as follows :
> nginx reverse proxy ? varnish ? nginx ? php-fpm ? symfony with apiplatform
>
> All routes work fine, except one that returns a zip file (below 300 MB)
> and returns a 503 error most of the time.
> Even if the zip is 1 MB, it returns errors, which is weird because I have
> other routes that return JSON responses of more than 3 MB and works fine.
> There are no specific headers or cookies, it's only a PHP controller that
> returns a zip file, nothing fancy.
>
> I've tried increasing workspace_backend to 2 MB, but it only makes the
> error occur less often.
>
> The following logs are about a zip file of around 1 MB
> *Error log :*
> https://pastebin.com/ye0KGV4M
> *Success log* (on the same route/response) *:*
> https://pastebin.com/KUvwQLKQ
>
> Thank you,
> Kevyn.
>
Re: out of workspace (bo) [ In reply to ]
Hi Kevyn,

On Wed, Aug 30, 2023 at 11:37?AM Kevyn Fyleyssant
<kevyn.fyleyssant@gmail.com> wrote:
>
> Here is my VCL :
> https://pastebin.com/TpN8r0Um
>
> And my varnishd command :
> /usr/sbin/varnishd -a :8181 -p feature=+http2 -p http_resp_hdr_len=200k -p http_resp_size=2M -p http_req_hdr_len=200k -p workspace_backend=256k -p workspace_client=256k -p http_max_hdr=256 -f /etc/varnish/default.vcl -s malloc,4G

You already have a fairly large workspace, but to solve this you will
need to further increase workspace_backend.

You configured Varnish to accept up to 200kB per header field, and up
to 2MB per response headers (all fields combined). The worst case
scenario wouldn't fit in 256kB. The file size should have no
significant effect on workspace consumption, so this recurring
overflow is probably caused by beresp headers alone.

You should first make sure you have a good understanding of the origin
server and why it may produce such large response headers.

If this is legitimate, there is no way around increasing
workspace_backend. Your VCL isn't doing workspace-intensive
operations, so a little over 2MB (for example 2MB+64kB aka 2102kB)
should be enough.

Dridi
_______________________________________________
varnish-misc mailing list
varnish-misc@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc