lancachenet / monolithic

A monolithic lancache service capable of caching all CDNs in a single instance
https://hub.docker.com/r/lancachenet/monolithic
Other
725 stars 73 forks source link

Battle.net stuck at updating #160

Closed bergi9 closed 1 year ago

bergi9 commented 1 year ago

Describe the issue you are having

Battle.net is unable to update Warzone 2.0, well it stuck and retries and the download is very slow. Steam and Windows updates are working fine with full internet bandwidth.

Disabling LanCache for blizzard it downloads in expected speed.

2022/12/14 21:00:09 [error] 1916#1916: *174 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 10.0.0.50, server: , request: "GET /tpr/auks/data/d6/ca/d6ca7e9cc9c5cb862c069a83f6f4ab19 HTTP/1.1", subrequest: "/tpr/auks/data/d6/ca/d6ca7e9cc9c5cb862c069a83f6f4ab19", upstream: "http://127.0.0.1:3128/tpr/auks/data/d6/ca/d6ca7e9cc9c5cb862c069a83f6f4ab19", host: "level3.blizzard.com"
2022/12/14 21:00:09 [error] 1916#1916: *174 unexpected status code 504 in slice response while sending to client, client: 10.0.0.50, server: , request: "GET /tpr/auks/data/d6/ca/d6ca7e9cc9c5cb862c069a83f6f4ab19 HTTP/1.1", subrequest: "/tpr/auks/data/d6/ca/d6ca7e9cc9c5cb862c069a83f6f4ab19", upstream: "http://127.0.0.1:3128/tpr/auks/data/d6/ca/d6ca7e9cc9c5cb862c069a83f6f4ab19", host: "level3.blizzard.com"
2022/12/14 21:01:20 [error] 1817#1817: *211 upstream prematurely closed connection while reading upstream, client: 10.0.0.50, server: , request: "GET /tpr/auks/data/d6/ca/d6ca7e9cc9c5cb862c069a83f6f4ab19 HTTP/1.1", subrequest: "/tpr/auks/data/d6/ca/d6ca7e9cc9c5cb862c069a83f6f4ab19", upstream: "http://127.0.0.1:3128/tpr/auks/data/d6/ca/d6ca7e9cc9c5cb862c069a83f6f4ab19", host: "eu.cdn.blizzard.com"
2022/12/14 21:02:54 [error] 1978#1978: *237 unexpected status code 429 in slice response while reading response header from upstream, client: 10.0.0.50, server: , request: "GET /tpr/auks/data/d6/ca/d6ca7e9cc9c5cb862c069a83f6f4ab19 HTTP/1.1", subrequest: "/tpr/auks/data/d6/ca/d6ca7e9cc9c5cb862c069a83f6f4ab19", upstream: "http://127.0.0.1:3128/tpr/auks/data/d6/ca/d6ca7e9cc9c5cb862c069a83f6f4ab19", host: "eu.cdn.blizzard.com"
2022/12/14 21:08:11 [error] 1831#1831: *346 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 10.0.0.50, server: , request: "GET /tpr/auks/data/75/43/754389bb229daaa615c058ebd65d42d4 HTTP/1.1", subrequest: "/tpr/auks/data/75/43/754389bb229daaa615c058ebd65d42d4", upstream: "http://127.0.0.1:3128/tpr/auks/data/75/43/754389bb229daaa615c058ebd65d42d4", host: "level3.blizzard.com"
2022/12/14 21:08:11 [error] 1831#1831: *346 unexpected status code 504 in slice response while sending to client, client: 10.0.0.50, server: , request: "GET /tpr/auks/data/75/43/754389bb229daaa615c058ebd65d42d4 HTTP/1.1", subrequest: "/tpr/auks/data/75/43/754389bb229daaa615c058ebd65d42d4", upstream: "http://127.0.0.1:3128/tpr/auks/data/75/43/754389bb229daaa615c058ebd65d42d4", host: "level3.blizzard.com"
2022/12/14 21:08:40 [error] 1817#1817: *377 unexpected status code 429 in slice response while reading response header from upstream, client: 10.0.0.50, server: , request: "GET /tpr/auks/data/75/43/754389bb229daaa615c058ebd65d42d4 HTTP/1.1", subrequest: "/tpr/auks/data/75/43/754389bb229daaa615c058ebd65d42d4", upstream: "http://127.0.0.1:3128/tpr/auks/data/75/43/754389bb229daaa615c058ebd65d42d4", host: "eu.cdn.blizzard.com"

How are you running the container(s)

docker-compose

services:
  lancache:
    image: lancachenet/monolithic:latest
    container_name: lancache
    env_file: .env
    restart: unless-stopped
    deploy:
      resources:
        limits:
          memory: 4G
    ports:
      - 80:80/tcp
      - 443:443/tcp
    volumes:
      - ${CACHE_ROOT}/cache:/data/cache
      - ${CACHE_ROOT}/logs:/data/logs
    networks:
      br0:
        ipv4_address: 10.0.0.11
    labels:
      net.unraid.docker.icon: "/boot/config/icons/lancache.png"

networks:
  br0:
    external: true

.env

## See the "Settings" section in README.md for more details

## Set this to true if you're using a load balancer, or set it to false if you're using seperate IPs for each service.
## If you're using monolithic (the default), leave this set to true
USE_GENERIC_CACHE=true

## IP addresses that the lancache monolithic instance is reachable on
## Specify one or more IPs, space separated - these will be used when resolving DNS hostnames through lancachenet-dns. Multiple IPs can improve cache priming performance for some services (e.g. Steam)
## Note: This setting only affects DNS, monolithic and sniproxy will still bind to all IPs by default
LANCACHE_IP=10.0.0.11

## IP address on the host that the DNS server should bind to
DNS_BIND_IP=10.0.0.11

## DNS Resolution for forwarded DNS lookups
UPSTREAM_DNS=1.1.1.1

## Storage path for the cached data
## Note that by default, this will be a folder relative to the docker-compose.yml file
CACHE_ROOT=/mnt/disks/lan_cache/lancache

## Change this to customise the size of the disk cache (default 2000000m)
## If you have more storage, you'll likely want to increase this
## The cache server will prune content on a least-recently-used basis if it
## starts approaching this limit.
## Set this to a little bit less than your actual available space 
CACHE_DISK_SIZE=1800000m

## Change this to allow sufficient index memory for the nginx cache manager (default 500m)
## We recommend 250m of index memory per 1TB of CACHE_DISK_SIZE 
CACHE_INDEX_SIZE=500m

## Change this to limit the maximum age of cached content (default 3650d)
CACHE_MAX_AGE=3650d

## Set the timezone for the docker containers, useful for correct timestamps on logs (default Europe/London)
## Formatted as tz database names. Example: Europe/Oslo or America/Los_Angeles
TZ=Europe/Berlin

DNS Configuration

Using uklans/cache-domains script to generate unbound config and used in pfsense with pfBlockerNG-devel which redirects all domains to 10.0.0.11.

config.json for the script:

{
    "ips": {
        "generic": ["10.0.0.11"]
    },
    "cache_domains": {
        "arenanet": "generic",
        "blizzard": "generic",
        "bsg": "generic",
        "cityofheroes": "generic",
        "daybreak": "generic",
        "epicgames": "generic",
        "frontier": "generic",
        "neverwinter": "generic",
        "nexusmods": "generic",
        "nintendo": "generic",
        "origin": "generic",
        "pathofexile": "generic",
        "renegadex": "generic",
        "riot": "generic",
        "rockstar": "generic",
        "sony": "generic",
        "square": "generic",
        "steam": "generic",
        "teso": "generic",
        "uplay": "generic",
        "warframe": "generic",
        "wargaming": "generic",
        "wsus": "generic",
        "xboxlive": "generic"
    }
}

Output of container(s)

nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
add_header X-LanCache-Processed-By $hostname;
# Including /etc/nginx/sites-available/cache.conf.d/root/99_gnu.conf
#In loving memory of Zoey "Crabbey" Lough. May she live on in the code

add_header X-Clacks-Overhead "GNU Terry Pratchett, GNU Zoey -Crabbey- Lough";
proxy_set_header X-Clacks-Overhead "GNU Terry Pratchett, GNU Zoey -Crabbey- Lough";
# Finished including /etc/nginx/sites-available/cache.conf.d/root/99_gnu.conf
add_header 'Access-Control-Expose-Headers' '*';
add_header 'Access-Control-Allow-Origin' '*';
return 204;
}
# Finished including /etc/nginx/sites-available/cache.conf.d/90_lancache_heartbeat.conf
}
# Finished including /etc/nginx/sites-enabled/10_generic.conf
# Including /etc/nginx/sites-enabled/20_upstream.conf
# Upstream server to proxy and handle inconsistent 302 redirects
# All cache traffic is passed through this proxy to allow rewriting of redirects without caching

# This is particularly important for sony / ps5 as upstreams redirect between them which confuses slice map on caching

server {

# Internal bind on 3128, this should not be externally mapped
listen localhost:3128 reuseport;

# No access_log tracking as all requests to this instance are already logged through monolithic

# access_log /data/logs/upstream-access.log cachelog;
error_log /data/logs/upstream-error.log;

# Including /etc/nginx/sites-available/upstream.conf.d/10_resolver.conf
resolver 1.1.1.1 ipv6=off;

# Finished including /etc/nginx/sites-available/upstream.conf.d/10_resolver.conf
# Including /etc/nginx/sites-available/upstream.conf.d/20_tracking.conf
# Header to track if resolved from upstream or 302 redirect
set $orig_loc 'upstream';
# Finished including /etc/nginx/sites-available/upstream.conf.d/20_tracking.conf
# Including /etc/nginx/sites-available/upstream.conf.d/30_primary_proxy.conf
# Proxy all requests to upstream
location / {
# Simple proxy the request
proxy_pass http://$host$request_uri;

# Catch the errors to process the redirects
proxy_intercept_errors on;
error_page 301 302 307 = @upstream_redirect;
}
# Finished including /etc/nginx/sites-available/upstream.conf.d/30_primary_proxy.conf
# Including /etc/nginx/sites-available/upstream.conf.d/40_redirect_proxy.conf
# Special location block to handle 302 redirects
location @upstream_redirect {
# Upstream_http_location contains the Location: redirection from the upstream server
set $saved_upstream_location '$upstream_http_location';

# Set debug header
set $orig_loc 'upstream-302';

# Pass to proxy and reproxy the request
proxy_pass $saved_upstream_location;
}
# Finished including /etc/nginx/sites-available/upstream.conf.d/40_redirect_proxy.conf
}
# Finished including /etc/nginx/sites-enabled/20_upstream.conf
}

stream {
# Including /etc/nginx/stream.d/log_format.conf
log_format stream_basic '$remote_addr [$time_local] $protocol $status $ssl_preread_server_name $bytes_sent $bytes_received $session_time';
# Finished including /etc/nginx/stream.d/log_format.conf
# Including /etc/nginx/stream-enabled/10_sni.conf
server {
listen 443;
resolver 1.1.1.1 ipv6=off;
proxy_pass $ssl_preread_server_name:443;
ssl_preread on;

access_log /data/logs/stream-access.log stream_basic;
error_log /data/logs/stream-error.log;
}
# Finished including /etc/nginx/stream-enabled/10_sni.conf
}

# Finished including /etc/nginx/nginx.conf
Checking nginx config
Config check successful
Starting Supervisord
stale[bot] commented 1 year ago

This issue has been automatically marked as inactive because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] commented 1 year ago

This issue has been automatically closed after being inactive for 30 days. If you require further assistance please reopen the issue with more details or talk to us on discord