LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 11-29-2004, 04:13 PM   #1
russelh
LQ Newbie
 
Registered: Nov 2004
Location: Seattle, WA
Distribution: Gentoo 2.4.24
Posts: 4

Rep: Reputation: 0
Writing a CPU Consume Program to Test a Distributed System


Hi all -

I am working on a project testing out openMosix. For those that don't know what that is, it is a distributed OS patch that allows you to add nodes to your cluster and it will handle distributing processes. I want to write a program that will consume a certain portion of the cpu, or will perform a random bunch of i/o requests so that I can test out openMosix on my system.

I have tried doing the typical things like compiling the kernel to see how openMosix works, but for the project I am tweaking with some of the distributed OS algorithms and seeing if I can improve them. Therefore, I need a program to throw a consistent load at the nodes to duplicate results and compare. Ideally, I want to have a config file that says I want to consume X% of the cpu, or something like that.

My problem is that I don't know how to do this! I am not asking for anyone to write code, just to throw some ideas out there for how to go about starting something like this.

Thanks in advance for all of your help!
 
Old 11-30-2004, 12:37 AM   #2
shishir
Member
 
Registered: Jul 2003
Location: bangalore . india
Distribution: openSUSE 10.3
Posts: 251

Rep: Reputation: 33
you could have some code that uses a way that limits the cpu usage to a certain limit in one instance of the process , using setrlimit and not setting any limit in another instance of the same code...

then if you have an SMP system, you might want to try the cpu-binding of processes...

HTH

Last edited by shishir; 11-30-2004 at 12:39 AM.
 
Old 11-30-2004, 06:35 AM   #3
Marius2
Member
 
Registered: Jan 2004
Location: Munich
Distribution: SuSE 9.2, 10.2, 10.3, knoppix
Posts: 274

Rep: Reputation: 30
Hm I may be completely wrong here, but I believe this is not how the Linux scheduler
works (may be different with Mosix and/or SMP kernel). You can't control how much CPU
time a certain process will consume, all you can do is assign a certain priority (in relation to
other processes' priority) to it. How much CPU time your process will effectively consume
depends onits priority, total number of processes and their priority in relation to your process.
 
Old 11-30-2004, 07:17 AM   #4
shishir
Member
 
Registered: Jul 2003
Location: bangalore . india
Distribution: openSUSE 10.3
Posts: 251

Rep: Reputation: 33
i havent ever tried this stuff..but yes the man page for setrlimit does tend to suggest that you can tune these values to take a specified by the rlimit structure...if the process suns longer than the time specified as the limit, it receives the signal,SIGXCPU, tho the catch is : this time is in seconds...which I dont think should be that big an issue as the application desired should be doing something that takes a long time...if i got the question..
 
Old 11-30-2004, 02:27 PM   #5
russelh
LQ Newbie
 
Registered: Nov 2004
Location: Seattle, WA
Distribution: Gentoo 2.4.24
Posts: 4

Original Poster
Rep: Reputation: 0
Thanks for the tips... I will look into the setrlimit stuff. Funny that testing the cpu loads would be the hard part, not the actual tweaking of the load algorithms. Hmmm...

Much appreciated!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
is Linux Virtual Server a kind of distributed system? 286 Linux - Networking 3 05-21-2005 05:22 PM
Does your *nix system participate in a distributed computing project? sether Linux - General 9 12-11-2004 07:01 AM
Linux for distributed system AdamTheFirst Linux - Hardware 4 11-05-2004 01:24 AM
Linux for distributed system AdamTheFirst Linux - Distributions 1 11-04-2004 03:38 PM
Distributed file system in Linux? longblock454 Linux - Networking 4 11-02-2004 05:37 PM


All times are GMT -5. The time now is 11:55 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration