LanCache Tutorial | Speed Up Steam, Origin, Uplay, Epic, Battle.net, …

LanCache Tutorial | Speed Up Steam, Origin, Uplay, Epic, Battle.net, …


Hi my name is Chris and this is Battle(non)sense Most of us won’t have access to Gigabit
internet anytime soon, so if you share your internet connection with
other gamers, or play the same games on multiple PC’s
then you need a creative solution to make do with the bandwidth or data cap you have. Now I really don’t want to complain about
my download bandwidth as I can download games and patches at more
than 9 MegaBytes Per Second. But even with that bandwidth
and without a data cap it is still very annoying to install a game
with 80GB’s, or a patch with 10GB’s on more than one
PC. So I used to download a game on one PC,
And then copy the entire installation folder over to the other PCs
to avoid redownloading the entire thing – on each of my PCs. But as if manually copying those big games
to my other PC’s wouldn’t be annoying enough,
I sometimes ran into the issue that the launcher on another PC would still re-download a big
part of the game before I could use it. So, if you also have more than one gaming
PC at home, Or if you share your internet connection with
other gamers, then you surly know what I am talking about
here. LAN parties and events face the exact same
challenge, just on a much larger scale. To deal with that issue, they deploy a LanCache
server which Simply put
intercepts download requests from the clients on the network
and then stores or caches the downloaded data. When a client then requests a file that is
already in the cache then it will get the file from the cache server,
instead of downloading it again from the internet. This means that the first download will happen
at the speed of your internet connection. But when another client wants to download
a game or patch that is already inside the cache,
then the client will get that data from the cache server
instead of downloading it from the internet again.
and so the download speed will only be limited by the speed of your network
and how fast the cache server can read the files from its storage. So if you have just one gaming PC at home
then you don’t need a LanCache server. But as soon as you share your internet connection
with other players, or when you have more than 1 PC that you play
the same games on, then a LanCache server will make your live
a lot easier. So in todays video I will show you how to
create your own LanCache server Which will then cache downloads from
Steam Origin
Uplay Battle net
Warframe the epic launcher and many others
even Windows Updates will be cached. LanCache is available as a docker container,
so if you have a NAS at home which supports docker
then you might want to try to get it deployed that way. But since that depends on what kind of NAS
you have, I decided to show you how you how to use an
old PC or a Virtual Machine to deploy a LanCache. If you don’t intent to host LAN Parties
for more than 10 people then you don’t need a high end PC with a lot of RAM to host your
LanCache server. That said an SSD is recommended to store the
cache on, especially if you have multiple clients store or grab data from the server
at the same time. Now before we begin, let me make clear that
I am not a Linux expert. So, I’m sure that a few of the things that
I will show in today’s video might not be considered ideal.
but it will help you to get a LanCache Server up and running. Now, after I ran into some issues while trying
to setup the LanCache Server with Ubuntu and CentOS
I ended up using the 64bit Cinnamon edition of Mint 19.3
which I deployed as a Virtual Machine on my ESXi server. So after you installed Mint on your PC or
as a Virtual Machine You go to the network settings Select IPv4 And change Addresses
from Automatic to manual Now you must enter a static IP address. To find out which address you can use you
have to connect to your router, find the DHCP service
and look at the DHCP range. In my case the DHCP range starts at 192.168.1.100
and ends at 192.168.1.200 So static IP adresses must be outside that
range to not cause a conflict with the DHCP service. So, I use 192.168.1.35 for the address
24 for the netmask And 192.168.1.1 for the gateway, as that is
the address of my router. Now, if you want to tweak the performance
of the LanCache then you can add additional Addresses.
I had good results with a total of 4 static IPs. Then I add my router as DNS server
Click on apply Edit the network settings again to disable
IPv6 And click on apply again. For the changes to take effect you simply
disable And then enable the wired network again. Next you open a terminal and update your installation
of linux which can take a few minutes. In the description you can also find a list
of all the commands I use in this video. Next Install curl
And install docker Once docker is installed you want to check
the status of docker And if it says active, then you can move on
and install docker-compose Next Install Git And then you grab lancache from github Now it’s time to configure lancache First you enter the lancache folder
And then edit the env file In here you must now change the LANCACHE IP
entry and enter all IP addresses you added to the
network connection before. For DNS BIND IP you enter the first address
you set for the network connection For UPSTREAM DNS you can enter any DNS server
you want, like 8.8.8.8. I prefer to enter the IP of my router as that
serves as DNS server in my network. If you want to store the cache in a different
location, like on a 2nd hard disk or SSD Then you can change the CACHE ROOT location
here. The CACHE DISK SIZE is set to 1 terrabyte
per default, you must change this value if the size of
the disk you store your cache on is larger or smaller than that. The CACHE SLIZE SIZE is 1 megabyte per default.
If you want to tweak that size, which can have a positive impact on the download
speed in Origin and battle.net, then you can set it to 8 megabytes If you change the cache slice size later,
then you must also delete your entire cache folder and start clean. If you want the lancache services to start
automatically when you boot your PC Then you just have to edit the docker compose
yml file and add restart always to each service Now it’s time to start the lancache
which will take some time as it has to download a few things first And once that is done you use docker stats
to make sure that all 3 services are running So now the lancache is up and running
and it will start automatically when you boot the PC. To ensure that the lancache will still work
in a few weeks or even months from now, you must make sure that it always uses the
latest domain list. Which is quite easy to do as we just have
to restart the services to have lancache grab the latest domain list from github. So to do that you right click on the desktop
Select Open in new terminal And type in nano lancache underscore restart
dot sh Which creates a new file on your desktop
Inside that file we then tell the script to enter the lancache folder
And restart docker compose After you’ve saved the file you use chmod
plus x so that the script can be executed Now right click on the script
Select properties And copy the location Next you use sudo crontab hyphen e
And have the restart script executed every minute, so that you can test if it’s working Then you keep an eye on the docker stats
And when you see the services restart one after the other then this means that the script
is working Now you go back to crontab
And set the job to start at like 3 AM in the morning And lastly,
you want to make sure that the docker services do start automatically
by restarting the machine. And then checking the docker stats. Now you just have to get your PC’s to use
the LanCache. If your router allows it,
then you could add the LanCache server as preferred DNS server in the DHCP Service. Or you simply go to the properties of the
network interface Select Internet Protocol Version 4
Click on edit Select use the following DNS server addresses
Enter the first IP of the LanCache server as preferred DNS Server
And to avoid that you lose access to the internet when the lancache server is offline
You enter the IP any other DNS server or the IP of your router for the alternative DNS
Server Next open the command prompt
And clear the local DNS cache Next type in nslookup steam dot cache dot
lancache dot net And you should get the IP addresses of your
LanCache server When you now download a game or a patch,
Then the lancache server knows about that download
since you configured the lancache server as your preferred dns server. So, the first download of a game or patch
will be done at whatever downstream bandwidth your internet connection offers.
In my case I at nearly 10 MegaBytes per second. When I then download the same game on a different
PC, or uninstall the game and install it again,
Then my PC gets the data directly from the LanCache server at a much higher speed. As I said this also works with Uplay
Battlenet the Epic Launcher
and many other services. It also works with EA’s Origin,
which will alert you that there is a local cache server which stores and provides the
files. And as you can see here,
downloading a game that is already in the LanCache is a lot faster
and maxes out my Gigabit Ethernet connection. So that is how you setup your own LanCache
server. As I said I’m not a Linux expert
so I’m sure that a few of the things I did are not ideal,
but with my tutorial you should still get your first LanCache server up and running. If you want to learn more about the LanCache
project, and what else you can do to tweak the performance,
then you can find a link to the LanCache website in the description. And that’s all for today.
Big shout out to my patrons as their support allows me to create videos like this one. If you enjoyed this video then please give
it a like subscribe for more
ring the bell to get notified when I upload my next video
and I hope to see you next time! Until then,
Stay safe, take care of yourself and your family

80 thoughts to “LanCache Tutorial | Speed Up Steam, Origin, Uplay, Epic, Battle.net, …”

  1. http://lancache.net/

    ► Install Linux
    ———–

    mint 19.3 Cinnamon 64-bit (ubuntu)

    https://www.linuxmint.com/download.php

    ► Configure Network
    ————

    network settings -> edit -> ipv4

    switch adress from "Automatic" to "manual"

    set a static IP

    (optional performance tweak) add 4 more IP's

    enter DNS IP

    Apply

    disable IPv6

    Apply

    disable network connection

    enable network connection

    ► Update Linux & Install LanCache
    ————

    sudo su

    apt update && apt upgrade -y

    apt install curl -y

    curl -sSL https://get.docker.com/ | sh

    systemctl status docker

    apt install docker-compose

    apt install git

    git clone https://github.com/lancachenet/docker-compose/ lancache

    ► Configure LanCache
    ————

    cd lancache

    nano .env

    //(optional performance tweak – add) CACHE_SLICE_SIZE=8m

    LANCACHE_IP=192.168.1.35 192.168.1.36 192.168.1.37 192.168.1.38

    nano docker-compose.yml

    add "restart: always" at the end of each service to get them to start automatically.

    ► Update & Launch LanCache
    ————

    docker-compose up -d

    docker stats

    ► Create cron job to restart LanCache which will also pull latest domain list
    ————

    right mouse click on desktop -> Open in Terminal

    nano lancache_restart.sh

    #!/bin/sh

    cd /home/USERNAME/lancache

    docker-compose restart

    chmod +x lancache_restart.sh

    //right click on lancache_restart.sh -> properties -> copy the location (needed for the cron job we create next)

    sudo crontab -e

    * * * * * /home/USERNAME/Desktop/lancache_restart.sh

    //after 1 minute you should see the lancache services restart one after the other

    //if that did work then set a time you want that restart to occur. i.e. 3AM daily

    sudo crontab -e

    0 3 * * * /home/USERNAME/Desktop/lancache_restart.sh

    ► Configure Network DNS
    ————

    either have your routers DHCP service tell all clients to use the LanCache Server as primary DNS server or set it manually on each client.

    and lastly, clear the dns cache on your windows machines

    inside a command promt

    ipconfig /flushdns

  2. There have been a bunch of solutions like this in the past but the crazy part here seems to be that EPIC and Valve actually worked with them to make changes to get this working better than previously. Crazy!

  3. Will you/did you ever talk about dynamic resolution scaling? It would probably make an AMAZING video, at least for me 😀 talking about the impact on fps, frame time etc…

  4. `sudo -i` gives you an interactive shell too. `sudo su` is like running cmd to run powershell to perform some tasks.

  5. is there not a easy way to do this? this is just what i need, but.. im an idiot gamer that is mechanic, with low IQ… idk something in that line. i really need this, BUT.. a "press this button and its all done" would be nice :s

  6. thank you for taking a look into linux! i left a comment on the last video to take a look into this os, whether you saw it or not, I'm happy to see people moving to open source solutions

  7. Meanwhile the internet backbone is limited to 10MBps and ping times are up by 50-200%. Stay safe during quarantine guys…. Then get off my damned intertubes blocking it all up 😉

  8. Windows does not use always the primary DNS server. It can happen that it randomly asks the secondary, so be careful with that.

  9. I got a question. if I dl a game and delete it later but I rela download it later and there were patches released in between that time, do I download the game from my cache sever and the update from the internet ? its probably a stupid question.

  10. Sir, two things to say about your content: it is pure Quality; and Thank you for that ❤️

    You are the best!

  11. Hey Chris! Do you think this will work in docker for OpenMediaVault? As i have already OMV running on a Odroid HC1 with an SSD that I use for smb server and sonar/radar.

  12. How does the cache server know if a game is updated between download on PC1 and PC2? Or does it soley depend on the files to download have different names?

  13. If multiple pcs are downloading the same update, would the cache still work for every PC but the first? Or does the download need to be complete for the first PC before other computers can take from the cache?

  14. Literally just got gigabit 3 days ago, but I still have a 1tb data limit so I've been copying games manually for awhile

  15. Hey Chris, Can the lancache server store the games update? I would like to know if it is possible… Cause will be useful if the server autoupdate the game files, the night for example, and when I turn my main pc on, the update automatically will be installed directly from the lancache server…
    I hope you understand my idea.
    Be strong you and your family. We'll make it💪👊.
    Cheers from Italy.

  16. Very good video, I'm using Squid as caching service.
    Btw, for a gigabit lan you can use a good HDD, no need for SSD.

  17. And her IAM praying for staple 3MB WITH 30 frame time so I can get 30 or 40 FPS Warframe Every now and then, heh boloks non scenes/ WiFi in the middle East Oooff

  18. I really like this video. I really want to set it up, because I have a second computer. HOWEVER! It has limited storage on it, my internet connection is near gigabit, I'm the only likely user of LanCache in the house, and it would be a waste of power keeping the second PC on. Still, if I was stuck in a house with a bunch of gamers on a VDSL connection and everyone pooled together for some large storage, this would be really perfect.

  19. Much easy way to do this use Resilio Sync its free. Download on PC and it will then Sync to all the other devices once setup. What I do is take my laptop to work download the game then Sync when I'm home. It also uses your internal network.

  20. Best to run a lan cache on a small switch like Netgears 10G gaming switch then link the switch via ethernet cat6a to your router.

  21. Hey chris! I am a network engineer! This is my area of expertise, if you have any questions feel free to ask away!

  22. Hey Chris, I really enjoy your content. Just had a question. What benefit do you get by assigning multiple IP addresses to the same interface? Do you have some sort load balancing for the VM client or server?

  23. Definitely don't use regular HDD for your Lancache server. Your transfer speed will be much less then just good internet download speed.

  24. 10:26 A few? Nearly all of them lol

    But that's absolutely fine. Hacking together such a solution is fun and very accessible for a less technically inclined user which makes this is perfect for a youtube video aimed at gamers with above-average interest in technology which I assume most of your viewers to be. Well done!

  25. Hi.I'm too Greece play black squad. (Steam) I play for 60-64ping .I have try everything. Is it possible you to help me?

  26. Great video, thanks! I might give this another try. My past attempts were not successful. My biggest concern is due to data cap. I don't want to have to download 50-100GB game multiple times, at release , or even in the future.

    Do you know if there is a way to "seed" your cache with games already installed locally?

    I ended up downloading my entire Steam and GOG catalog of games to my home server (12TB in total, mostly over free 25Mbps free wifi – yikes – that took nearly three months to complete). For now, I do like you did, and just copy/paste game files to my other PC's. A cache would make it so much more convenient.

  27. This is crazy, I was talking to my GF earlier today about how inconvenient it is to copy/paste games over to her PC, and you uploaded this amazing video shortly after!

  28. Why not just add a static lease in dhcp server on router?
    This gives you full overview of what addresses you have set aside and to what purpose.

  29. Could you test if using a program that automatically clears the Windows standby list and modifies the system timer actually improves performance in games? I've been testing this but I don't see any noticeable improvement in performance despite claims from other people.

  30. well thats looking sweet for me here im downloading games at around 50/60mb/s here in the netherlands soon going to 1gigabit fiber. for now stuck on 500/500 for around 40/50 euros
    no data cap btw

Leave a Reply

Your email address will not be published. Required fields are marked *