SRCDS Steam group


[Linux/Multi-server] Set up shared memory content for multi-server systems
#1
zane Wrote:Well I plan to host around 300-350 slots(varying games, fps, tickrate) maximum with the likelihood that no more than 150 or so would be full simultaneously. Does anyone agree that 8 gigs might be overkill for that many slots considering CPU's get overloaded before ram does?

Usually everybody runs out of CPU power much earlier than memory. I've never heard anyone complaining that the servers would not work because they're short of memory.

Idea: Create a shared "content directory" (eg. maps, textures, sounds, ...) from the srcds stuff to a memory partition. Imagine how fast maps would load. That way you'll find some good use for the excess memory you've got.

In linux you can use "tmpfs":
Code:
mkdir -p /usr/local/srcds-shared/
mount -t tmpfs -o size=2G,mode=755 tmpfs /usr/local/srcds-shared/

Then copy all srcds content to that directory:
Code:
cp -R srcds/* /usr/local/srcds-shared/

Then prepare a "customer" instance:
Code:
rm -f /home/customer/srcds/cstrike/maps/*
ln -s /usr/local/srcds-shared/cstrike/maps/* /home/customer/srcds-shared/cstrike/maps/

Now all maps content is linked to the memory partition. Map changes should be extremely fast because the server's got them in memory all the time. Customers can still install their own maps, because they have write access to their own maps directory. Nobody can mess the memory table, because it's mounted with mode 755 (root = rwx, rest = rx). Safe and fast.

Note that on every reboot the memory partition is emptied (because RAM loses all information), and it should be initialized in some startup script.

I haven't tested this on my server because I don't have that much spare RAM. I hope you've got technical skills to try this out. It should be possible to have all srcds content linked like this to a memory partition, but still have the log files and auto-recorded demos written on a HDD (which happens pretty much automatically).

Let me know if you're going forward with this. Others who also have kick-ass RAM servers can also PM me. I can then fill in the details if there are problems.

PS. I'll also try this myself, although I can probably spare only about 200MB RAM partition. Big Grin
Reply
#2
css Wrote:PS. I'll also try this myself, although I can probably spare only about 200MB RAM partition. Big Grin
I've completed my setup.

I've got 200 MB tmpfs partition mounted in directory "srcds/csds/maps.tmpfs/". I copied some popular maps there. In total I've got 10 maps taking 150 MB in size.

Then I backed up the whole maps directory by copying it to "srcds/csds/maps.bak/". Then I changed to the active maps directory used by the game server, which is "srcds/csds/maps/". The game server was running all the time. Then I linked the maps from the memory partition to the game server's map directory. I used "ln -sf ../maps.tmpfs/* .". Now I have some maps on the HDD disk, and some files linked from the memory partition at "maps.tmpfs/".

Tip: After copying the files to the memory partition, do "cat maps.tmpfs/* >/dev/null". That forces Linux to read all the files, which moves them to memory.

I still haven't had chance to test whether maps load any faster or if it's any good at all. At least it shouldn't do any harm, because everything looks like normal HDD partition, but in fact the files are in super fast RAM.
Reply
#3
css Wrote:I still haven't had chance to test whether maps load any faster or if it's any good at all. At least it shouldn't do any harm, because everything looks like normal HDD partition, but in fact the files are in super fast RAM.

I didn't notice any boost with maps in RAM partition. I didn't test it thoroughly, though. Nevertheless, the idea worked and the server worked flawlessly for a week. It would be fun to test running the whole server on a RAM partition, but I don't have resources for it. Quite likely the server and the linux kernel do similar "caching" by default, so the benefit of fast read access from RAM partition is quite small.

Anyways, I'd recommend this kind of system for GPSs. They benefit:
1. Faster reads from shared content directory.
2. Reduces memory usage. Same files are cached only once instead of caching every instance of the same file.
3. Reduces HDD I/O
4. Reduces disk space usage

PS. Forum mods, can you shadow copy my posts from this thread to a new thread of them own. I've described how to set up shared memory content for multi-server setups - the thread is just so wrong. The posts are:
http://forums.srcds.com/viewpost/39575#pid39575
http://forums.srcds.com/viewpost/39577#pid39577
-and this post-
Reply
#4
css, if you can edit the tutorial into one post, I will sticky it and remove this note by me.
Join the Source Dedicated Server Support Group on Steam Community!
Source Dedicated Server (SRCDS)
Free to join, Live support! (When available)

http://forums.srcds.com/viewtopic/5114
Reply
#5
i would try this out myself if i knew all of the exact commands to put in and whats needed exactly. As i dont fully understand it (make the post have the full commands needed to type in order and make it easier to follow)
Reply
#6
drazah Wrote:i would try this out myself if i knew all of the exact commands to put in and whats needed exactly. As i dont fully understand it (make the post have the full commands needed to type in order and make it easier to follow)

I can fill in the details if there's someone who has basic knowledge of Linux and has server where this could be useful. The basic concept I've written there is on a general level, and anyone with solid experience on Linux can implement it. It's just normal copy / move / link operations. The only special part is how to mount the srcds directory so it stores everything in RAM.

Obviously it should be easier to use for this to work on wider scale, but I don't want to waste time creating a script for this because I can't use it myself. If there's some server admin who sees it usable and knows the benefits, PM me or post a reply here. I can create the script, but I need to know that there's some use for the script.

@drazah
I'll update the post if I get more experienced server admin(s) to team up. Then this might become useful also for business level server admins who don't know what they're doing Wink
Reply
#7
I played with this many years ago. I ran cs 1.5 servers and quake servers from the memory and it was noticable faster for both games during map changes. Even more if the clients can keep up ;-)

In a few days im hoping to get my first OCZ SSD disk to play with. Ill surly test out if this benefits the gameservers aswell.
To be (an admin), or not to be (an admin), that is the Question.
http://japje.nl/steam/install steam linux install guide for cs 1.6
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)