Some processes use 99% CPU but overall CPU usage is 20-30%?
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Some processes use 99% CPU but overall CPU usage is 20-30%?
Hi,
I'm troubled with this question for a long time now. I don't know how to solve that. I'm hosting few HLDS game servers on my server.
I've noticed that top command shows that some users are using 90-100% of CPU usage, but the overall CPU usage is 20-30%. Those HLDS servers are lagging and have low FPS rate, so PINGS for all players are way too high 100ms+ and they should be around 5-30ms.
It looks like this is a single processor application meaning that it can only use one processor at a time. Your limiting factor here is how fast the single core speed is. If there is a multicore version or setting this may help spread out the process. What you see in top for the cpu% for the process is how much of the cpu you are using. For example if I had a multicore application that is using 100% of 2 of the 4 cores in a system it would show 200% (core 1 100% + core 2 100% + core 3 0% + core 4 0% = 200%)
In your case I don't think it would help to much because all core being the same it would be like pouring all the water out of one solo cup into a different (but same size) solo cup because the first one was too full
So you think there is no way of balancing the load somehow? System has 4 CPUs with 2 threads per CPU?
I've tried the taskset but it didn't help much. On the other side I haven't tried to put for example all game servers on one CPU and only one HLDS game server on the other.
My other question is can kernel be the problem for poor performance?
From the output of your mpstat command, the load is already balanced...almost exactly 23% on each processor. How do you expect to balance the load any more than this?
If all threads are doing the same thing though, you may get a performance improvement by disabling hyperthreading. Most of my setups involve doing one task (or multiple similar tasks) simultaneously, and in that kind of setup I typically see a 10-30% improvement in processing speed by disabling hyperthreading and dropping back to 1 thread per physical cpu. In one specific application the system is WAY too slow to keep up with real time with hyperthreading enabled, it hits 150+% CPU (on a single core machine) and starts dropping data almost immediately, yet with hyperthreading disabled it hovers around 85% CPU usage and has no problem keeping up with the demands for days on end.
I've made it a habit to disable hyperthreading on every system I build, because I have yet to run across a use-case in my own environment in which HT does anything but make the system slower.
Last edited by suicidaleggroll; 07-15-2013 at 08:54 PM.
Thanks for posting, but the main problem with this is that I want to increase the CPU utilization, so processes that I run can get more CPU power. My CPU is at 23% load but I want it to go higher and increase performance of the game servers, is there a way to that? I don't currently have access to the server, so disabling HT is only possible I guess by compiling a new kernel without HT enabled, am I correct?
Performance of a system for some use has little to do with cpu load.
If you want to utilize the server more then you need to use more tasks.
One might be able to use other vm's or other non-related tasks to help offset the purchase price. It would however result in higher energy costs and most likely reduced length of service and permit failure of parts sooner calender time.
From appearances, that 53% idle time is due to some waiting within the program.
It could be communication handshaking, or VSYNC, or just frame syncing. Deal with that to increase your utilization. This involves tweaking your program settings.
If desperate then instrument the program or use a profiling tool to find where it is waiting.
As the output of systat looks alright to me. Specialy the (io)wait i would check for some network bound hog ups. Check out traffic shaping with token buckets or some to have the hlds server to get enough bandwith. tldp.org has some nice things about this.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.