lancachenet / monolithic

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

Trying to chain 2 caches, could use some advise #54

Closed FilixDark closed 5 years ago

FilixDark commented 5 years ago

Describe the issue you are having

Hi, I was thinking about having like 10 caches , cache from a main cache as I have very little bandwidth, but a lot of devices and I wanted to speed this up as good as I can. I made to test 2 vms ubuntu, 192.168.0.61 and 192.168.0.62. My lets say consumers use the lancache-dns on .61 which works fine. I set the upstream dns from .61 to 62. But when the cache was empty, it still downloaded the files directly to 61 without going through 62. Then I altered the network config of 61 to use 62 as only dns server. I tested it, and I was only able to resolve any hostnames when the 62 lancache-dns was running. But the cache is still probably using another dns server when downloading files for the cache.

Is there any way I could make it use the 62 dns server, so it would forward the download kinda to the second cache?

How are you running the container(s)?

192.168.0.61:

docker run --restart unless-stopped --name lancache -v /cache/data:/data/cache -v /cache/logs:/data/logs -p 192.168.0.61:80:80 lancachenet/monolithic:latest

docker run --restart unless-stopped --name lancache-dns -p 192.168.0.61:53:53/udp -e USE_GENERIC_CACHE=true -e LANCACHE_IP=192.168.0.61 -e CACHE_DOMAINS_REPO="https://github.com/FilixDark/cache-domains.git" -e UPSTREAM_DNS=192.168.0.62 lancachenet/lancache-dns:latest

docker run --restart unless-stopped --name lancache-sniproxy -p 192.168.0.61:443:443 lancachenet/sniproxy:latest

192.168.0.62

docker run --restart unless-stopped --name lancache -v /cache/data:/data/cache -v /cache/logs:/data/logs -p 192.168.0.62:80:80 lancachenet/monolithic:latest

docker run --restart unless-stopped --name lancache-dns -p 192.168.0.62:53:53/udp -e USE_GENERIC_CACHE=true -e LANCACHE_IP=192.168.0.62 -e CACHE_DOMAINS_REPO="https://github.com/FilixDark/cache-domains.git" lancachenet/lancache-dns:latest

docker run --restart unless-stopped --name lancache-sniproxy -p 192.168.0.62:443:443 lancachenet/sniproxy:latest

FilixDark commented 5 years ago

Ah I just realized the upstream_dns was anyway only for the dns server, so that could not have any influence on the cache resolving the hosts if they dont have the files. Is there an option to edit the dns for the cache container?

FilixDark commented 5 years ago

Silly me, seems I just used it for the dns instead of the cache. So I got it to work as a test, all fine except the speed, but that might be because of my test environment. WIndows vmware workstation 15 with 2 ubuntu 18 vms running docker. I dont get more than 70mbit out of it. Will have to make some tests without vmware.