LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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


Reply
  Search this Thread
Old 10-24-2009, 11:55 PM   #1
chamila1986
Member
 
Registered: Oct 2009
Posts: 31

Rep: Reputation: 15
Unhappy Optimum number of processes for process


Optimum number of processes for procesor

In Linux based os are there a optimum number of process for a processor that gives 'maximum performance' for system(or process range depend on cpu speed,cache etc...)??????
By 'maximum performance' I mean better performance? Please can someone clarify me this out.

Last edited by chamila1986; 10-25-2009 at 12:22 AM. Reason: Not "Optimum number of processes for process" but "Optimum number of processes for processor"
 
Old 10-24-2009, 11:58 PM   #2
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
Yes. The ideal number of processes is "46".
 
Old 10-25-2009, 12:10 AM   #3
chamila1986
Member
 
Registered: Oct 2009
Posts: 31

Original Poster
Rep: Reputation: 15
Sir paulsm4,
Isn't it not changed according to the no of cores in cpu(like duel core,multi core etc) and the cash and memory sizes....?????????????????????

Last edited by chamila1986; 10-25-2009 at 12:11 AM.
 
Old 10-25-2009, 12:37 AM   #4
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
Hi -

There is no such thing as "an optimimum number of processes". There is no such thing as an "optimum number of processes per CPU" (in a multi-core or multiprocessor system). In fact, there is considerable debate about what "optimum" even means.

For example, "optimum" could be any of:
Quote:
1. Utilization: how much is the CPU actually being used, and how much is idle?

2. Throughput: how fast is work being processed?

3. Responsiveness: how fast does the system *appear* to be working (e.g. to a user)?
These articles gives you a good overview how you might go about evaluating "performance":

http://www.tomshardware.com/reviews/...-cpu,2280.html

http://www.cmdln.org/2009/01/28/cpu-...ysis-in-linux/

'Hope that helps .. PSM

Last edited by paulsm4; 10-25-2009 at 12:44 AM.
 
Old 10-25-2009, 01:03 AM   #5
chamila1986
Member
 
Registered: Oct 2009
Posts: 31

Original Poster
Rep: Reputation: 15
Sir,
Lets take an example.Suppose i have a calculation, that takes much time. So i allocate that task to set of processes and do the calculation. I need to do the calculation in minimum time.

I want to determine what is the best no of processes that need to do my calculation as soon as possible. To this scenario i need to keep cpu as much as busy and determine the best no of processes(Since context switching for processes may be increase the execution time).

so in multi core environment what is the best no of processes suit to do this(can u give me a rough value(are there any standard value))

/****I do not need to use user level thread approach...***/

Last edited by chamila1986; 10-25-2009 at 01:07 AM.
 
Old 10-25-2009, 03:26 AM   #6
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
Hi -

1. If you have one CPU, and the CPU spends 100% of it's time working on your calculation, then you have "100% utilization". In this case, that's a Good Thing - that's the ideal, best you can do.

2. If you have two CPU's, but your calculation doesn't lend itself to "parallelization" ... then one CPU is 100% utilized (like the above case) ... but the other CPU is 100% idle (because there's nothing for the second processor to do - this particular task can't be split into two, concurrent pieces). Your overall system utilization is only 50% - not so good.

3. Remember - you can't do any more work than you have processors.

If you have one work item ... but it can't be split into two pieces ... then a second CPU gains you nothing.

If you have two CPUs - and your work item CAN be split into two pieces - then both CPUs can be fully utilized (2 CPU x 100% utilization), and the job gets done in half the time. Yay!

If you have two CPUs - and your work can be split into FOUR pieces - you've gained nothing. Because you've still only got two CPU's, and they're both doing everything they can, as fast as they can (that's what "utilization" means - whether or not a system *is* doing as much work as it has *capacity* to do).

You CANNOT do more work than you have CPUs.

4. Finally, anything that either CPU does that's *NOT* part of your calculation ... means that it's going to take LONGER to perform your calculation.

So if you have more processes - then the CPUs are going to spend time servicing the processes (instead of doing your calculation).

All time spent on "system overhead" ... is time spent NOT doing your work ... which means your work is going to take longer.

More processes ... means more overhead ... which means less work.

So the ideal for two CPUs is work that can run in parallel on two processes (or two threads - in Linux, they're the same thing). The ideal for four CPUs is to be able to "parallelize" to four tasks. And so on.

'Hope that helps .. PSM
 
  


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
number of processes, how to get notified on a change linuxdoniv Programming 17 09-07-2008 08:08 AM
maximum number of processes per user kshkid Programming 10 07-06-2006 03:41 PM
Number of Mysql processes ugob Linux - Software 0 12-05-2003 02:33 PM
how to change number of running processes rsc Linux - Newbie 2 03-14-2002 06:23 PM
how to change number of default processes rsc Linux - Networking 2 03-13-2002 02:22 PM


All times are GMT -5. The time now is 01:18 AM.

Main Menu
Advertisement
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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration