How to find Linux CPU usage?

Ask questions about dedicated servers here and we and other users will do our best to answer them. Please also refer to the self-help section for tutorials and answers to the most commonly asked questions.
Post Reply
rustydusty1717
This is my homepage
This is my homepage
Posts: 645
https://www.youtube.com/channel/UC40BgXanDqOYoVCYFDSTfHA
Joined: Sun Sep 20, 2009 6:15 pm

How to find Linux CPU usage?

Post by rustydusty1717 »

Anyway to figure out CPU usage through shell? I'd just like to see what the CPU usage is like on my single core, just to see if it could handle more slots, etc.
Image
User avatar
Edge100x
Founder
Founder
Posts: 13126
Joined: Thu Apr 18, 2002 11:04 pm
Location: Seattle
Contact:

Re: Single Core VPS

Post by Edge100x »

To do this, I recommend using the "top" command. This will provide you with a frequently-updating display with a bunch of very useful system status information, including CPU usage. To find out your available CPU, look for "xx.x%id" in the "CPU(s)" line.
rustydusty1717
This is my homepage
This is my homepage
Posts: 645
Joined: Sun Sep 20, 2009 6:15 pm

Re: How to find Linux CPU usage?

Post by rustydusty1717 »

99.7%id

That can't be correct. All servers are empty and it's using 99%?
Image
User avatar
Edge100x
Founder
Founder
Posts: 13126
Joined: Thu Apr 18, 2002 11:04 pm
Location: Seattle
Contact:

Re: Single Core VPS

Post by Edge100x »

rustydusty1717 wrote:
Edge100x wrote:To find out your available CPU, look for "xx.x%id" in the "CPU(s)" line.
99.7%id

That can't be correct. All servers are empty and it's using 99%?
If you have 99.7% available, you are only using 0.3% CPU. You have a significant amount of spare CPU power with your servers empty, which makes sense.
rustydusty1717
This is my homepage
This is my homepage
Posts: 645
Joined: Sun Sep 20, 2009 6:15 pm

Re: How to find Linux CPU usage?

Post by rustydusty1717 »

I had it backwards, my bad. I'm gonna blame it on the buckley's, even though it's only cough syrup.
Image
rustydusty1717
This is my homepage
This is my homepage
Posts: 645
Joined: Sun Sep 20, 2009 6:15 pm

Re: How to find Linux CPU usage?

Post by rustydusty1717 »

Here's a pic of the 'top' command with my private server with 10 people in it scrimming. Server is at 1000 fps, along with the public server. If I do my math correctly, I should be able to run roughly 32 slots with this CPU. Correct me if I'm wrong.
Image
rustydusty1717
This is my homepage
This is my homepage
Posts: 645
Joined: Sun Sep 20, 2009 6:15 pm

Re: How to find Linux CPU usage?

Post by rustydusty1717 »

Image
User avatar
Edge100x
Founder
Founder
Posts: 13126
Joined: Thu Apr 18, 2002 11:04 pm
Location: Seattle
Contact:

Re: How to find Linux CPU usage?

Post by Edge100x »

Scrim/match servers tend to be very intensive (moreso than public servers), and it looks like you still have quite a bit of CPU free. You could likely run more slots than you think :). (Especially if you drop the FPS a bit.)

If you do run a lot of slots, keep an eye on the bandwidth usage, though.
rustydusty1717
This is my homepage
This is my homepage
Posts: 645
Joined: Sun Sep 20, 2009 6:15 pm

Re: How to find Linux CPU usage?

Post by rustydusty1717 »

I like the FPS at 1000 on all my servers. They seem to run perfect at that setting. Bandwidth is not my limit so far. Halfway through my first month and only 14 GB used. Mostly just play in the private server and scrimming. I'd be interesting to see how many slots you can run on 500 GB of bandwidth. Also, what type of port speeds are on each VPS? I wanna setup apache just for fast download, but I don't want it to lag the servers when many clients are downloading files from it.
Image
User avatar
Edge100x
Founder
Founder
Posts: 13126
Joined: Thu Apr 18, 2002 11:04 pm
Location: Seattle
Contact:

Re: How to find Linux CPU usage?

Post by Edge100x »

rustydusty1717 wrote:Also, what type of port speeds are on each VPS? I wanna setup apache just for fast download, but I don't want it to lag the servers when many clients are downloading files from it.
Virtual servers can use up to 1gbps -- that's the speed of the virtual adapter. On a CentOS install, you'll have PV drivers that should allow close to wire-speed performance.
rustydusty1717
This is my homepage
This is my homepage
Posts: 645
Joined: Sun Sep 20, 2009 6:15 pm

Re: How to find Linux CPU usage?

Post by rustydusty1717 »

Perfect, thanks again!
Image
BLUEPEPSi
New to forums
New to forums
Posts: 1
Joined: Tue Dec 08, 2009 8:33 pm

Re: How to find Linux CPU usage?

Post by BLUEPEPSi »

This is just a question off topic, why are you running your servers on root?
rustydusty1717
This is my homepage
This is my homepage
Posts: 645
Joined: Sun Sep 20, 2009 6:15 pm

Re: How to find Linux CPU usage?

Post by rustydusty1717 »

I could create a new user, but root already has a very well encryped password, so I figured why not. I've always used root, and never had a problem. It's all about the password, and sometimes even the port. I usually change my SSH port to something not familiar on port scanners. :wink:
Image
User avatar
Edge100x
Founder
Founder
Posts: 13126
Joined: Thu Apr 18, 2002 11:04 pm
Location: Seattle
Contact:

Re: How to find Linux CPU usage?

Post by Edge100x »

BLUEPEPSi is right that it is better not to run servers as root. The reason doesn't have anything to do with SSH -- rather, it is because you don't want an intruder to have full access to the virtual machine if your game server is compromised (such as through a bug in the game or one of the plugins running on the server). For maximum security, I would recommend that you switch your servers to run as a different user as soon as you are finished setting them up.

It's also best not to run game servers as "Administrator" or "Local service" on Windows systems, for the same reason.
rustydusty1717
This is my homepage
This is my homepage
Posts: 645
Joined: Sun Sep 20, 2009 6:15 pm

Re: How to find Linux CPU usage?

Post by rustydusty1717 »

I completely understand, but I have a full backup of my CS 1.6 servers on my server at my house, plus I've never had a problem before. I'm old fashioned and go by the saying 'If it ain't broke, don't fix it'

Not always the smartest, but it's hard to teach an old dog new tricks. :lol:
Image
Post Reply