Closed Deanosim closed 5 years ago
What's your run command?
How did you "change environment variables"?
Well I was using portainer to do this but something keeps breaking it for some reason, I use the run command from the readme file to start it the first time and then after that I used portainer to edit it, but the command would have been
sudo docker run -d --name cache-steam -e UPSTREAM_DNS="192.168.1.201 1.1.1.1" -e CACHE_DISK_SIZE=2000g -e LOGFILE_RETENTION=90 -v /mnt/steamcache/cache:/data/cache -v /mnt/steamcache/logs:/data/logs -v steamcache_nginx:/etc/nginx -p 80:80 steamcache/monolithic:latest
After removing the container and making a new one using the above command it now works. I'm not sure if I actually need the nginx volume, but I feel like it would loose the information about what it had cached and where and break all the files I had already cached, Am I wrong?
You are indeed wrong, so long as you have the -v /mnt/steamcache/cache:/data/cache
retained monolithic will be able to reload all of your cached files. It looks like whatever you did with portainer you broke the init command. Generally for docker if you want to edit the env vars/run command, docker rm
then docker run
.
Okay one more question, would it be possible to run two instances of the steamcache/monolithic and have a load balancer in front of them?
Yes technically.
The full answer is slightly more complicated. If you have sufficient disk space and bandwidth to manage EVERYTHING in duplicate (2 cache stores and twice the download) then yes, you can have two caches running on two different hosts and an haproxy (or similar) load balancer.
HOWEVER, there are a few caveats with this: 1) They CANNOT share the same cache filestore (nginx is very particular about this) 2) You effectively double your bandwidth requirements (if person a requests file from ha, via cache 1 it downloads once, when another person requests the same file from ha, via cache 2, the second cache will then redownload the same file.
There are a few work arounds to the above depending on what you are trying to achieve:
If you are trying to increase your cache performance/throughput you can split the dns such that one "half" of the cache domains (steam) is served from one cache and the other "half" (everything else, inc origin, battle.net) is served from the other cache. This reduces bandwidth duplication and increases overall performance throughput to "the cache"
If you are genuinely trying to have a HA system, then having two full caches is the correct answer, if you still need to reduce your input bandwidth there is an additional (albeit hardware expensive) option: Add a third cache (not on the ha lb) which both primary caches use as an upstream cache. This means that the upstream cache only downloads a file once, and then serves it to the downstream client facing caches. This obviously uses more diskspace (you now need Cx3) but reduces input bandwidth back to I (rather than Ix2). The upstream cache doesn't need to be particularly "fast" so long as it can serve data at least 1:1 with your internet connection you won't see any change in performance over that.
Hope this makes sense, questions on a postcard ;)
@lepidopterist might like to check the above statement and see if he has any additional thoughts or inputs from our last HA discussions i've forgotten
Describe the issue you are having
Tried to change environment variables and now it won't start
Output of container(s)