Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
jakkuh_t

Steam Caching Tutorial

Recommended Posts

4 minutes ago, GoTeamScotch said:

My PC is running Windows as its main OS. I'm running Ubuntu inside of a virtual machine within Windows. Ubuntu is running Docker and the steamcache containers.

 

should dedicate a separate system to run your caching stuff

IMO


Can Anybody Link A Virtual Machine while I go download some RAM?

 

Link to post
Share on other sites

Hey guys,

I have read a lot of this posts here and I tried it also using Docker.

But I was thinking what about Squid did anyone tried making a cache server for Steam or other games as  well over Steam?

Link to post
Share on other sites
4 hours ago, unijab said:

 

should dedicate a separate system to run your caching stuff

IMO

Yup, running it from a VM is temporary just while I get the process worked out. But still, I'm using a PC with an i7 & 16GB of RAM and running the VM from an SSD while using gigabit ethernet throughout my network. I would assume that would be enough to get more than 50mbps. Looking through some of the other replies in this thread, it looks like I'm not the only one having this problem.

3 minutes ago, sinaps1 said:

Hey guys,

I have read a lot of this posts here and I tried it also using Docker.

But I was thinking what about Squid did anyone tried making a cache server for Steam or other games as  well over Steam?

Squid is a much more complex beast to setup and configure. I started out looking into setting up a Squid caching server before I found out about this project and it's just a really tedious setup process. Be forewarned.

Link to post
Share on other sites
7 minutes ago, GoTeamScotch said:

But still, I'm using a PC with an i7 & 16GB of RAM and running the VM from an SSD while using gigabit ethernet throughout my network. I would assume that would be enough to get more than 50mbps. Looking through some of the other replies in this thread, it looks like I'm not the only one having this problem.

 

 

Would probably need to watch system stats and network stats while its in use to see where the bottleneck is.

 

It seems pretty common, so it might just be normal overhead for the caching process. idk


Can Anybody Link A Virtual Machine while I go download some RAM?

 

Link to post
Share on other sites
On 8/21/2018 at 6:00 AM, Unieveth said:

I have it working to a point where the DNS is not crashing, but now the issue is that I see no traffic going through the server when I'm downloading a game from steam.  It still seems to be bypassing the server.  I have changed the DNS settings on my local PC to test it and it's not going through the server.  Here is an image of the settings along with putty with nload running: https://i.imgur.com/mcqwyOA.png I have also flushed the DNS on my system so unless I'm missing something it should be working.  I have also checked the stream cache and it has 1 item in it: https://i.imgur.com/zIhwXQq.png

 

Fixed it

 

How did you end up fixing it?

 

I've reinstalled multiple times brought it back to basics with just steam but its still not caching.

 

DNS is working fine and activity is disllayed in the dns logs.

 

No activity in the steam cache logs.

 

Im running it in a VM under proxmox with Ubuntu 18.04.

Opnsense as the firewall.

 

Thanks!!

Link to post
Share on other sites
Posted · Original PosterOP
10 hours ago, BrianLi said:
can we apply this procedure through Virtualbox with ubunto on it? Host pc platform is windows 10.

The virtual machine would need to support docker ie. a KVM based virtual machine.

 

I'm not sure if virtualbox supports it.


widget.png?style=banner2   -  7700K, 16GB RAM, GTX 1080 Ti FE, 2*4TB, 512GB 850 Evo


 

Link to post
Share on other sites
On 11/21/2018 at 3:00 AM, jakkuh_t said:

The virtual machine would need to support docker ie. a KVM based virtual machine.

 

I'm not sure if virtualbox supports it.

it works on Virtualbox

Link to post
Share on other sites
On 9/7/2018 at 10:59 PM, dnsfail said:


I'm having this issue as well. If I stop sniproxy, steam will use 80 and it works fine. If sniproxy is running, steam switches to 443 and won't cache.

Wanted to follow up in case anyone else hits this.

Whats my problem was: Steam was downloading via Comcast's servers instead of its own and Comcast's end up using 443 for whatever reason (RIP cache).

Solution: Nothing simple, I ended up leaving sniproxy disabled. Some steam images wont load, but it's otherwise unimpactful. If you're caching something that needs sniproxy, I don't have a solution for you, but I suspect it'd work if you can somehow make sniproxy or the dns blackhole the comcast IP's.

 

To confirm you have the same issue I do, you'll see this in sniproxy log:
https://gist.github.com/MatthewM/f5be266da56219ba1f1a61327ab4ee65


Other threads on the issue I came across:

https://github.com/uklans/cache-domains/pull/19
https://github.com/steamcache/steamcache-dns/issues/47
 

Link to post
Share on other sites

Tip for native linux installs.
Had trouble getting it to actually save stuff to the cache directory and found out it was a permissions issue. If you're not seeing files in the /data/cache folder of your server, check the error.log. You'll see a line that looks like this:
 

asudouser@cache:/media/steamcache$ cat /media/steamcache/logs/error.log

2018/12/23 05:07:14 [crit] 48#48: *465 open() "/data/cache/cache/ef/db/c3f2f550f48baef4623627398df8dbef.0000000217" failed (13: Permission denied) while rea ding upstream, client: 192.168.11.192, server: , request: "GET /serverlist/95/20/ HTTP/1.1", upstream: "http://162.254.193.24:80/serverlist/95/20/", host: " valve614.steamcontent.com"
2018/12/23 05:07:14 [crit] 40#40: *467 open() "/data/cache/cache/ef/db/c3f2f550f48baef4623627398df8dbef.0000000218" failed (13: Permission denied) while rea ding upstream, client: 192.168.11.192, server: , request: "GET /serverlist/95/20/ HTTP/1.1", upstream: "http://162.254.193.52:80/serverlist/95/20/", host: " valve619.steamcontent.com"
...
...
...
2018/12/23 05:07:14 [crit] 47#47: *471 open() "/data/cache/cache/ef/db/c3f2f550f48baef4623627398df8dbef.0000000220" failed (13: Permission denied) while rea ding upstream, client: 192.168.11.192, server: , request: "GET /serverlist/95/20/ HTTP/1.1", upstream: "http://207.35.48.42:80/serverlist/95/20/", host: "va lve176.steamcontent.com"

The root of the issue is the user id of the owner of the cache directory on your machine has to be the same as the www-data user on the container. In Ubuntu it's 33 so just have to make sure it matches. You can check the permissions in the container by running

docker exec steam-cache ls -al /data

It should look like this:

drwxr-xr-x 5 www-data www-data 4096 Dec 19 21:56 .
drwxr-xr-x 1 root     root     4096 Dec 23 04:56 ..
drwxrwx--- 2 www-data www-data 0 Dec 23 04:49 cache
drwxr-xr-x 2 www-data www-data 4096 Dec 19 21:56 info
drwxrwx--- 2 www-data www-data 0 Dec 23 04:49 logs

But it may look something like this if your permissions aren't right:

drwxr-xr-x 5 www-data www-data 4096 Dec 19 21:56 .
drwxr-xr-x 1 root     root     4096 Dec 23 04:56 ..
drwxrwx--- 2 www-data 1001     0 Dec 23 04:49 cache
drwxr-xr-x 2 www-data www-data 4096 Dec 19 21:56 info
drwxrwx--- 2 www-data 1001     0 Dec 23 04:49 logs

To fix it, find out the user id number on the container matches the one on your local machine (should be www-data in ubuntu). Then recursively set the ownership to that user.

asudouser@cache:/media/steamcache$ docker exec steam-cache cat /etc/passwd | grep www-data
www-data:x:33:33:www-data:/var/www:/usr/sbin/nologin
asudouser@cache:/media/steamcache$ cat /etc/passwd | grep 33
www-data:x:33:33:www-data:/var/www:/usr/sbin/nologin
asudouser@cache:/media/steamcache$ chown -R www-data:www-data /media/steamcache

 

Link to post
Share on other sites
32 minutes ago, drcheeseman said:

To fix it, find out the user id number on the container matches the one on your local machine

That's a bit misleading, in your example it's group that is set to guid 1001 not the user, chown usage is 

Quote

chown [options] [user]:[group] path

You should be using the second number from /etc/passwd, the docker sandbox users primary group id*, grep "^www-data" /etc/passwd|awk -F ':' '{print $4}', but it's totally redundant to go any further as chown accepts both guid or group name as the [group] parameter.

You could have used chown -R :www-data ./ or  chown -R :33 ./ to fix the perms you showed, if it still didn't work after that then it's not group perms causing issues and you need to look deeper in the directory tree, considering the www-data user already had rwx access as a user (the bold in drwxrwx---) I'm inclined to think the issue was deeper, and you stomped on it when pushing www-data: as a owner recursively.

 

*assuming the binary runs as www-data

Link to post
Share on other sites

I can never get the multiple IPs off of one connection to work - I type in the settings exactly, verify that there are no conflicts, but can't ping the cache machine from another computer... any help with this?

Link to post
Share on other sites

Hello , i have successfully done the server but can i add my game from my pc to the cache of the server ?

Thank you for help

Link to post
Share on other sites

hello i did everything like in the description , i have steam working on cache and it is on the main ip but blizzard and riot arent working on cache there is no traffics on nload when i download from blizzard or riot , i can ping all the ip in my server , anyone know whats wrong with it ? in cointaner ls i see blizzard and riot up also thanks in advance

Link to post
Share on other sites

Has anyone had any luck with setting this up without using Docker? I'm trying to set it up with nginx, and I managed to complete the setup process in the arsTechnica article but it doesn't seem to be working at all.

Link to post
Share on other sites

What's everyones average download speeds after caching? I am seeing about 48 - 51 MB/s! :D I managed to get all docker containers running and the traffic is routing through my steamcache server.

 

I have:

 

Linksys WRT3200acm (Running OEM Firmware, I might switch to DDWRT so I can ensure QoS is off)

1 Gigabit Switch split between my computer and the steamcache server

2 additional computers (gf and her work computer hooked directly into Linksys Router)

4 laptops, other roommates xbox one (all the garbage devices are on WiFi)

 

The steam cache server has a 240GB SSD Crucial for /dev/sda and I've mounted a Samsung 840 1TB from /dev/sdc

 

So my PC, I'm seeing around 48/51 MB/s - however my gf is directly connected to the Linksys router is only seeing 20-30 MB/s. Shouldn't we be seeing higher speeds closer to 100 MB/s or above? Could we be bottlenecked somewhere? It's definitely working since our download speeds through the modem is around 15 MB/s (150Mbps down)

 

Link to post
Share on other sites

Am I getting this right? In order to work with Origin, etc. you need to change the DNS each time to download a game from the docker it contains?

Link to post
Share on other sites

Hi, Can anyone help me with this? I followed every step in Jacks post/video, but I can't get it to work. When I download a game form steam, it directly goed to the 1.1.1.1 dns. There is little to none network activity on the ubuntu server. I set my pc's dns server to the server ip, so that's not the problem

Link to post
Share on other sites

I've got the steam portion working. However, when I try to start containers for other services, I get this error: 

 

Error response from daemon: driver failed programming external connectivity on endpoint blizzard-cache (9b179f3d714d0d2f7ff1f80bed72d3acd0a74bb38c4296979d041e3f32707cb5): Error starting userland proxy: listen tcp 10.0.0.67:80: bind: address already in use

 

Also, when I try to install the SNI container, I get this error: 

 

Unable to find image 'steamcache/sniproxy:latest' locally
docker: Error response from daemon: Get https://registry-1.docker.io/v2/: dial tcp: lookup registry-1.docker.io on [::1]:53: read udp [::1]:50754->[::1]:53: read: connection refused.
See 'docker run --help'.

 

I'm happy with the performance of the Steam cache, but I'm really eager to get it set up for all the services I use. Any help would be greatly appreciated. 

 

*As a side note, I'm running this on a headless Ubuntu server, version 16.04 via a VM*

 

*Update* -  I got it all working. Out of desperation, I decided to run Ubuntu desktop and follow this guide from start to finish. That didn't work. In the end, it was a network setting in the VM I was running. I had the network adapter set to NAT when it needed to be set as bridged. This made all the IPs I set up visible to the network and everything started working. So for those of you trying to run this on a VM, there you go. 

Link to post
Share on other sites

I have mine running as a VM on a Synology NAS, Ubuntu desktop.

 

And well, some things are caching...others are just passing thru the server and not saving anything.  (Riot and Nintendo so far that I’ve seen)

 

Anyone else seen this and have any suggestions?

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×