Skip to content

Simultaneous optimized downloads kill my reverse proxy #15

@DerSpatz

Description

@DerSpatz

I have set up jellyfin (jf) and the optimized versions server (ovs) behind a reverse proxy using swag and nginx.
jf can be reached from outside via jellyfin.myurl.com, and ovs can be reached from outside via jelly-dl.myurl.com with a simple proxy conf (@Digital-Yeti):

jelly-dl proxy conf
server {
    listen 443 ssl;
    listen [::]:443 ssl;
server_name jelly-dl.*;

include /config/nginx/ssl.conf;

client_max_body_size 0;

# enable for ldap auth (requires ldap-location.conf in the location block)
#include /config/nginx/ldap-server.conf;

# enable for Authelia (requires authelia-location.conf in the location block)
#include /config/nginx/authelia-server.conf;

# enable for Authentik (requires authentik-location.conf in the location block)
#include /config/nginx/authentik-server.conf;

location / {
    # enable the next two lines for http auth
    #auth_basic "Restricted";
    #auth_basic_user_file /config/nginx/.htpasswd;

    # enable for ldap auth (requires ldap-server.conf in the server block)
    #include /config/nginx/ldap-location.conf;

    # enable for Authelia (requires authelia-server.conf in the server block)
    #include /config/nginx/authelia-location.conf;

    # enable for Authentik (requires authentik-server.conf in the server block)
    #include /config/nginx/authentik-location.conf;

    include /config/nginx/proxy.conf;
    include /config/nginx/resolver.conf;
    set $upstream_app streamyfin-optimized-versions-server;
    set $upstream_port 3000;
    set $upstream_proto http;
    proxy_pass $upstream_proto://$upstream_app:$upstream_port;
}

}

In the .env of the docker container, ovs is linked to to the local ip and port 8096, it was linked to the external URL before. Both methods work, but I assumed not running the communication between jf and ovs over the proxy would be better.

Now it seems like the whole reverse proxy is going down if I try to download more than a single file simultaneously with streamyfin to my phone.
When I add multiple downloads to a queue, the transcoding works as expected and the files are cached properly, but when I try to download more than one file at the same time, the downloads fail and Jellyfin and all my other apps behind the reverse proxy are not reachable for some minutes.

My current workaround is to set MAX_CONCURRENT_JOBS=1, but this only works when the downloads are triggered as soon as the transcoding is finished (aka streamyfin is opened), and my server could handle transcoding more streams, so I would like to set it higher.

As soon as I trigger two or more downloads of cached files in streamyfin, the reverse proxy dies for a short time.
Downloading two files directly (no optimized server, max quality) works, as does downloading two transcoded files without the optimized server.

As a workaround I would suggest the admin can set different limits for transcoding jobs and downloads. This would a least keep the reverse proxy alive until the real source of the crash is found.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions