karlomikus / bar-assistant

Bar assistant is a all-in-one solution for managing your home bar
https://barassistant.app
MIT License
595 stars 22 forks source link

an upstream response is buffered to a temporary file #371

Open reefland opened 1 day ago

reefland commented 1 day ago

Describe the bug Getting a lot of warning messages in bar-assistant logs.

To Reproduce [If possible, steps to reproduce the behavior.]

Versions:

Additional context, log outputs...

2024/11/30 19:31:21 [warn] 193#193: *1394 an upstream response is buffered to a temporary file /var/cache/nginx/fastcgi_temp/1/00/0000000001 while reading upstream, client: 10.42.2.202, server: _, request: "GET /api/cocktails?per_page=50&page=1&sort=-created_at&&include=ratings%2Cingredients.ingredient%2Ctags%2Cimages HTTP/1.0", upstream: "fastcgi://127.0.0.1:9000", host: "bar-assistant-api.bar-assistant.svc:8080", referrer: "https://bar.[redacted]/cocktails"

2024/11/30 19:31:24 [warn] 194#194: *1412 an upstream response is buffered to a temporary file /var/cache/nginx/fastcgi_temp/2/00/0000000002 while reading upstream, client: 10.42.2.202, server: _, request: "GET /api/cocktails?per_page=50&page=1&sort=-created_at&filter[name]=a&include=ratings%2Cingredients.ingredient%2Ctags%2Cimages HTTP/1.0", upstream: "fastcgi://127.0.0.1:9000", host: "bar-assistant-api.bar-assistant.svc:8080", referrer: "https://bar.[redacted]/cocktails?per_page=50&page=1&sort=-created_at&filter%5Bname%5D=a"

2024/11/30 19:31:50 [warn] 196#196: *1472 an upstream response is buffered to a temporary file /var/cache/nginx/fastcgi_temp/3/00/0000000003 while reading upstream, client: 10.42.2.202, server: _, request: "GET /api/cocktails?per_page=50&page=1&sort=-created_at&&include=ratings%2Cingredients.ingredient%2Ctags%2Cimages HTTP/1.0", upstream: "fastcgi://127.0.0.1:9000", host: "bar-assistant-api.bar-assistant.svc:8080", referrer: "https://bar.[redacted]/cocktails"

I think this is just a tuning issue with nginx. But before I randomly tweak various buffer settings, figure I'd ask for a recommendation on what to look for.

Size on my bar at the moment:

reefland commented 1 day ago

If helpful, this is the nginx default.conf file:

        server {
            listen 3000 default_server;
            listen [::]:3000 default_server;
            server_name _;

            location = /favicon.ico { access_log off; log_not_found off; }
            location = /robots.txt  { access_log off; log_not_found off; }

            client_max_body_size 100M;

            # bar-assistant
            location /bar/ {
                proxy_pass http://bar-assistant-api.bar-assistant.svc:8080/;
            }

            # meilisearch
            location /search/ {
                proxy_pass http://bar-assistant-search.bar-assistant.svc:7700/;
            }

            # salt-rim
            location / {
              proxy_pass http://bar-assistant-frontend.bar-assistant.svc:8080/;
            }
        }
karlomikus commented 1 day ago

Don't really have any recs, seems like this happens on responses with large body content so it buffers them to temp file.

I guess you can increase buffer size since I don't think it will increase disk usage too much