Find the answer to your Linux question:
Results 1 to 2 of 2
Hello, I have a mutlti-threading program. It can receive/respond packets on the network. When I do a stress test on it, it can process 60 request/response packets per seconds, in ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jun 2008
    Posts
    1

    Question My program cannot get fair CPU time under CFS


    Hello,
    I have a mutlti-threading program. It can receive/respond packets on the network. When I do a stress test on it, it can process 60 request/response packets per seconds, in kernel 2.6.17, which uses the O(1) scheduler. But when I do the same test in 2.6.23, with CFS scheduler, its performance will drop down to less than 10 request/response packets per seconds. During the test most of the other processes are sleeping in the system. That means no one is competing the CPU with it. But if you use "top", you will see those threads of my program are taking nearly 0% of CPU. And if you use "ps", you will always see them in S state. I don't understand why CFS does not give CPU resource to my program. Then I ran some other tests and got some more interesting results. That is with the "/proc/sys/kernel/sched_compat_yield" turned on, it will become a lot faster when system is idle. But as soon as there is a CPU bound process (like a infinite loop program) comes in, it will take out 90% of CPU and my program will become very, very slow. This actually violates the game rule of CFS since CFS' goal is about completely fair. No process can take out most of the CPU time if there are other processes in need of CPU at the same time. But then if "/proc/sys/kernel/sched_compat_yield" is turned off (this is the default), no matter how many CPU bound processes you put in, they will share the CPU time fairly, so my program will not become unreasonable slow. But the problem will then become, if system is idle, my program will be slow, slower than that when system is loaded with other processes. I really don't understand why it behaves like this under CFS. Does anyone have any clue to help me out? Thanks !! orz...

  2. #2
    Just Joined!
    Join Date
    Jan 2009
    Posts
    1

    My program cannot get fair CPU time under CFS

    Was there any response or resolution to the interesting question on this thread?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •