Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Sat Jan 05, 2008 11:23 pm 
Offline
Senior Member

Joined: Wed Apr 11, 2007 8:23 pm
Posts: 76
Ok, So ive gotten a Counter-Strike: Source server setup (SRCDS). For those familiar with CS:S I have two game types: ZombieMod and GunGame...

ZombieMod: 3-4 players against 20-30 Bots (CPU Players)
GunGame: 3-4 Players against 3-4 other players (No Bots)

Now when playing I seem to get a lot of lag. With ZombieMod it can go 5-10 seconds before I get "lagged" back about 2 seconds, sometimes it can get shot back 5-6 seconds, this happens for everyone on the server. When playing GunGame I get similair and lesser lag.

This to some extent infers that the problem is CPU usage. When running ZombieMod by CPU usage goes to around 60-70%, but when running GunGame I still get 30-40%.
I have had to replace my /proc/cpuinfo with one that the server can understand (See http://www.linode.com/forums/viewtopic.php?t=2491). Prehaps my /proc/cpuinfo is leading SRCDS to believe that the machine is better then It actually is, and that is causing problems. I am using the following /proc/cpuinfo:
Code:
processor       : 0
vendor_id       : GenuineIntel
cpu family      : 15
model           : 2
model name      : Intel(R) Xeon(TM) CPU 2.40GHz
stepping        : 7
cpu MHz         : 2393.024
cache size      : 512 KB
physical id     : 0
siblings        : 2
core id         : 0
cpu cores       : 1
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 2
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe cid
bogomips        : 4789.92


Ok, now that i've typed a wall of text, does anyone have an suggestions as to how to fix this problem? It half-seems like my servers connection gets cut off for a second every few seconds, but I know this is not the case.

Thanks,
Smark


Top
   
 Post subject:
PostPosted: Sun Jan 06, 2008 8:34 am 
Offline
Linode Staff
User avatar

Joined: Sat Jun 21, 2003 2:21 pm
Posts: 160
Location: Absecon, NJ
I've never set up a Counter Strike server, but in the time I've had my Linode, I've seen similar issues where things work fine for a while, then suddenly become slow or unresponsive. This has happened with several applications, and usually turns out to be one of two things:

    IO Limiter: If Counter Strike is IO bound or causes your Linode to start swapping, the IO limiter will kill you. Running 30-40 bots may be the culprit, but that doesn't explain the issue when it's just humans playing.

    /dev/random: If Counter Strike is pulling random data from /dev/random--and I can think of several reasons it would--entropy can run out in a hurry. Linux usually generates entropy (in part) from keyboard & mouse interrupts. Being a headless system, Linodes run out quickly.

I'm not sure if this helps, but it's something to investigate.

--James


Top
   
 Post subject:
PostPosted: Sun Jan 06, 2008 5:37 pm 
Offline
Senior Member

Joined: Wed Apr 11, 2007 8:23 pm
Posts: 76
Thanks for the response.

Is there any monitoring tools that I should look into that could help me to isolate the issue? IE, what the server is drawing on. Maybe find what the server needs the "most of" and try to figure out a way to make that more efficient.

Thanks,
Smark


Top
   
 Post subject:
PostPosted: Mon Jan 07, 2008 4:19 am 
Offline
Linode Staff
User avatar

Joined: Sat Jun 21, 2003 2:21 pm
Posts: 160
Location: Absecon, NJ
For the IO limiter, you can look at /proc/io_status--io_tokens is the important number. For /dev/random you can look at /proc/sys/kernel/random/entropy_avail. If you want to monitor them, start the following in an ssh session, then start playing the game and see if one of them goes down rapidly.
Code:
while true; do cat /proc/sys/kernel/random/entropy_avail /proc/io_status; sleep 1; done
You can stop that with ctrl-c. If you don't want to watch it in a terminal, it should be fairly easy to set up job to graph the numbers with rrdtool.

If you don't see the numbers changing, then you might need to look somewhere else.

If you can't figure it out, try asking in the IRC channel. That's usually a good place to get help.

--James


Top
   
 Post subject:
PostPosted: Mon Jan 07, 2008 11:08 am 
Offline
Senior Member

Joined: Mon May 14, 2007 8:20 am
Posts: 81
That's interesting. My io_tokens=-28 is negative all the time and once in a while goes up to maybe 300/400. Does that point to a serious problem? Thanks


Top
   
 Post subject:
PostPosted: Mon Jan 07, 2008 12:30 pm 
Offline
Senior Member

Joined: Wed Apr 11, 2007 8:23 pm
Posts: 76
Ok so I tried what irgeek suggested, played for about 10 minutes, here are the graphs (I'll make some better ones tonight when Im at home)...

/proc/sys/kernel/random/entropy_avail
Image

/proc/io_status - io_rate
Image

/proc/io_status - io_tokens
Image


The Y-axis shows io_rate, io_tokens, and entropy_avail
The X-axis shows time (each number represents about half a second)

The spike in the io_status graph is going to be the loading of the map, which was roughly 40-50mb

Basically is what I did, was I had each output to a different file, here was the sequence of events:

1. Start Logging
2. 30 seconds later start the server
3. 1 min after that I connected which triggered the bots to join the server
4. Play for about 3-4 minutes
5. I then reduced the bot count to 10 from 32
6. Played for another 3-4 minutes.
7. Reduced the bot count to 5
8. Played for another 3-4 minutes
9. Disconnected from the server
10. 10-30 seconds later I shut down the server

Im not sure how to interpret the iotokens graph, but the entropy graph seems to drop, then go higher every time i reduce the CPU player count...

Thanks for all the help so far,
Smark

PS. The actual data can be found here:
http://spectralcoding.com/files/io_tokens.txt
http://spectralcoding.com/files/entropy.txt


Top
   
 Post subject:
PostPosted: Mon Jan 07, 2008 12:47 pm 
Offline
Senior Member
User avatar

Joined: Sun Feb 08, 2004 7:18 pm
Posts: 562
Location: Austin
jcr,

Yes, that's a problem. That means your I/O is running at a drastically reduced rate. Most likely, this is a result of not having enough physical RAM. Once a Linode starts swap thrashing, the I/O tokens will disappear fast.

You'll want to reduce your memory footprint (or upgrade your Linode).


Top
   
 Post subject:
PostPosted: Mon Jan 07, 2008 1:07 pm 
Offline
Senior Member

Joined: Mon May 14, 2007 8:20 am
Posts: 81
Smark, my apologies if it looks like i'm hijacking your thread with my own configuration but since we are both dealing with io_status, I believe, it's ok.
Xan, thanks. I am going to look into updating my linode or maybe having two separate linodes.
Right after my post, I disabled a couple of routines that were doing a lot of IO (mainly updating fields in an sqlite database every minute) and now, it looks like this:
io_count=1877652 io_rate=0 io_tokens=2000000 token_refill=512 token_max=2000000. that's a dramatic change.
What would be a good source of information to understand io_count, io_rates, why they would decrease or the stock of io_tokens would replenish?


Top
   
 Post subject:
PostPosted: Mon Jan 07, 2008 1:48 pm 
Offline
Senior Member

Joined: Mon May 14, 2007 8:20 am
Posts: 81
to answer my own question: http://www.theshore.net/~caker/uml/patc ... ter.README


Top
   
 Post subject:
PostPosted: Wed Jan 09, 2008 10:16 am 
Offline
Senior Member
User avatar

Joined: Wed Mar 17, 2004 12:35 am
Posts: 118
Website: http://www.necrobones.com/
Location: Sterling, VA
Smark, I'm not quite sure how to interpret the entropy values since I've never really had to track/investigate it myself. My server, which is doing nothing but serving webpages and passing mail, for the most part, shows 182 entropy_avail right now. So I'm guessing what you have is reasonably healthy.

The IO looks pretty good in my opinion. It looks like when you first start the mission, there's a heavy IO load and the tokens drop rapidly. From then on, the amount of tokens gradually climbs, so you're using less than you're regaining. At least with just the one player and some bots, anyway. Sharp spikes down towards zero would be a sign of trouble here, IMHO.

I'm wondering if the other nodes on the host machine are simply having activity spikes that are interfering with the "real time" nature of the service you're running.

_________________
----
Ed/Bones.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group