nixCraft Linux Forum

nixCraft

Linux / UNIX Tech Support Forum

how to control process at RHEL

This is a discussion on how to control process at RHEL within the CentOS / RHEL / Fedora forums, part of the Linux Distribution category; Hi, I had a strange problem with my RHEL 5. RHEL installed at Blade 460C with Quad Core. with kernel-PAE-2.6.18-92.1.18.el5.i686.rpm ...

Register free or login to your existing account and remove all advertisements.


Go Back   nixCraft Linux Forum > Linux Distribution > CentOS / RHEL / Fedora

Linux answers from nixCraft.


CentOS / RHEL / Fedora Discussion about Redhat Enterprise Linux or CentOS or Fedora Linux related problems.

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-20-2009, 03:35 PM
Junior Member
User
 
Join Date: Mar 2009
OS: RHEL
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
b4ndit is on a distinguished road
Question how to control process at RHEL

Hi,

I had a strange problem with my RHEL 5.
RHEL installed at Blade 460C with Quad Core.
with kernel-PAE-2.6.18-92.1.18.el5.i686.rpm installed.

This server attached with a SAN storage (MSA1000) with 2 fiber cable.
SAN storage divided into 2 partition (part A and part B)

Then, I try to simulate workload process.
I copied some files (around 10 files, each has 150 MB size). I run this process with 5 console instantly ( 5 consoles with copying process)

capture from top

--------------------------------------------------------------------
Tasks: 458 total, 1 running, 457 sleeping, 0 stopped, 0 zombie
Cpu0 : 1.3%us, 26.9%sy, 0.0%ni, 0.0%id, 71.4%wa, 0.0%hi, 0.3%si, 0.0%st
Cpu1 : 0.0%us, 0.0%sy, 0.0%ni,100.0%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Cpu2 : 0.3%us, 0.3%sy, 0.0%ni, 99.3%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Cpu3 : 0.0%us, 0.0%sy, 0.0%ni,100.0%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Cpu4 : 0.0%us, 0.0%sy, 0.0%ni,100.0%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Cpu5 : 0.0%us, 0.0%sy, 0.0%ni,100.0%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Cpu6 : 0.0%us, 0.0%sy, 0.0%ni,100.0%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Cpu7 : 1.3%us, 4.0%sy, 0.0%ni, 94.7%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Mem: 8309944k total, 8130192k used, 179752k free, 274168k buffers
Swap: 16777208k total, 100k used, 16777108k free, 7362092k cached
--------------------------------------------------------------------

CPU0 has 0% idle, then this condition jumps to CPU6 then CPU 2, and so on..

My questions,
How to bind workload to all processor (distributed workload across the 8 CPUs), so idle 0% at one of the CPU is not happening again.

Thanks for you idea/comment...

BR,
b4ndit
Reply With Quote
  #2 (permalink)  
Old 03-20-2009, 08:12 PM
nixcraft's Avatar
Never say die
User
 
Join Date: Jan 2005
Location: BIOS
OS: RHEL
Posts: 2,662
Thanks: 11
Thanked 237 Times in 177 Posts
Rep Power: 10
nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute
Default

Linux kernel will pickup CPU randomly or ideal CPU. You can override the kernel's process scheduling and bind a certain process to a specific CPU or all cpu using a command called taskset. See:
__________________
Vivek Gite
Linux Evangelist
Be proud RHEL user, and let the world know about your enterprise choices! Join RedHat user group.
Always use CODE tags for posting system output and commands!
Do you run a Linux? Let's face it, you need help
Reply With Quote
  #3 (permalink)  
Old 03-20-2009, 08:52 PM
Junior Member
User
 
Join Date: Mar 2009
OS: RHEL
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
b4ndit is on a distinguished road
Default

Thanks, great info.
Since this machine will mostly used its resource to accessing the SAN storage, could I dedicate
some CPU or CPUss) for this task?

Another question comes to my mind, Can we set a lower threshold for %idle at each processor?
My aim is to transfer processes at every CPU if its reach a certain %idle value.
Example: if CPU0 reach %idle value of 20, then (CPU1) or (CPU1 and CPU2) will help CPU0.

Many thanks...

Last edited by b4ndit; 03-20-2009 at 08:59 PM.
Reply With Quote
  #4 (permalink)  
Old 03-20-2009, 09:34 PM
nixcraft's Avatar
Never say die
User
 
Join Date: Jan 2005
Location: BIOS
OS: RHEL
Posts: 2,662
Thanks: 11
Thanked 237 Times in 177 Posts
Rep Power: 10
nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute
Default

Usually, CPU only dedicated to server such as XEN, VMWARE, Oracle database and so on. In case SAN, disk I/O handled by SAN and not by your Linux server. So I do not see any specific issue here..


Quote:
Example: if CPU0 reach %idle value of 20, then (CPU1) or (CPU1 and CPU2) will help CPU0.
No. Kernel does that for you. You do not have to adjust these values by hand. Either assign a specific CPU or let the kernel do the job for you.
__________________
Vivek Gite
Linux Evangelist
Be proud RHEL user, and let the world know about your enterprise choices! Join RedHat user group.
Always use CODE tags for posting system output and commands!
Do you run a Linux? Let's face it, you need help
Reply With Quote
  #5 (permalink)  
Old 03-20-2009, 10:11 PM
Junior Member
User
 
Join Date: Mar 2009
OS: RHEL
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
b4ndit is on a distinguished road
Default

Many thanks, I hope this will solve the issue
Reply With Quote
  #6 (permalink)  
Old 03-24-2009, 02:52 PM
Junior Member
User
 
Join Date: Mar 2009
OS: RHEL
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
b4ndit is on a distinguished road
Default

They (my supervisors) don't really satisfied with this one...

What They expect is the workload of every processor are nearly similar.
In linux affinity, we can set some process to some CPU.
They want to bind processes to all CPUs (8 CPUs we had acting as one group of a processor).
So, all of CPU %user,%system and other value nearly the same. (if we compare it to M$ Task Manager, the green lines of every cpu shows the same workload)

comments are very apprecited...

Thanks.
Reply With Quote
  #7 (permalink)  
Old 03-28-2009, 12:56 PM
Junior Member
User
 
Join Date: Mar 2009
OS: Ubuntu 8.04 LTS
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
plachance is on a distinguished road
Smile

Hi,

The Kernel (Linux or others) on SMP architecture will automatically distribute the load across processors if there is a load to distribute...
- if multiple process are running and runnable (not waiting for I/O) then they will be dispatched across all available processor queues (if processor sets are not implemented)
- if a single process is running and runnable, it will be dispatched to single processor queue unless the process is multi-threaded.
- if the process is multi-threaded, it will be able to use entire cpu power (dispatched on all cpu queues) only if there are more runnable threads than cpu queues

Lastly, you do want process/cpu affinity: it avoid transferring cpu registers data from one processing queue to the other and improve performance...

Thus what your supervisor is asking for does not make sense !

Good day!
Reply With Quote
  #8 (permalink)  
Old 03-31-2009, 07:06 PM
Junior Member
User
 
Join Date: Mar 2009
OS: RHEL
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
b4ndit is on a distinguished road
Default

I see, that's why processes always jumped to another CPU..

I wonder, are there any possibilities that we could make those 8 CPU acting as one unity? so they could share same load ?
Like this one, I've read this...but I don't really understand to use it..
links:
Scheduling domains [LWN.net]

Again, comments are very...very...appreciated..

Thanks.
Reply With Quote
  #9 (permalink)  
Old 03-31-2009, 09:45 PM
nixcraft's Avatar
Never say die
User
 
Join Date: Jan 2005
Location: BIOS
OS: RHEL
Posts: 2,662
Thanks: 11
Thanked 237 Times in 177 Posts
Rep Power: 10
nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute
Default

For Scheduling domains you need a kernel patch. Currently, only SGI (and may few other HPS provider got such patch). However, RHEL 6 and Suse 11 will support Scheduling domains. You need to wait some time or get patches from SGI or kernel.org.

HTH
__________________
Vivek Gite
Linux Evangelist
Be proud RHEL user, and let the world know about your enterprise choices! Join RedHat user group.
Always use CODE tags for posting system output and commands!
Do you run a Linux? Let's face it, you need help
Reply With Quote
  #10 (permalink)  
Old 03-31-2009, 09:54 PM
nixcraft's Avatar
Never say die
User
 
Join Date: Jan 2005
Location: BIOS
OS: RHEL
Posts: 2,662
Thanks: 11
Thanked 237 Times in 177 Posts
Rep Power: 10
nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute
Default

I just did a little more research. The default is to run a process on all CPUs, giving a mask of
Code:
    0xf for all 4 CPUs
    0xff for all 8 CPUs
So command should be
Code:
schedtool -a 0xff <PID>
schedtool -a 0xff -e /path/to/app arg1 arg2 argN
Also, it depends upon your architectures like NUMA or SMP or uniprocessor and so on.

HTH
__________________
Vivek Gite
Linux Evangelist
Be proud RHEL user, and let the world know about your enterprise choices! Join RedHat user group.
Always use CODE tags for posting system output and commands!
Do you run a Linux? Let's face it, you need help
Reply With Quote
Reply

Tags
linux cpu scheduling , rhel , rhel taskset , schedtool , taskset


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads

Thread Thread Starter Forum Replies Last Post
How to control bandwidth in Fedora? nishithv Networking, Firewalls and Security 0 11-24-2008 04:21 PM
Killing of a process and send a mail if the process doesnot come up within 2 minutes Prince89 Shell scripting 1 02-11-2008 01:39 PM
Bandwidth Control software zafar466 Linux software 1 06-21-2007 01:42 PM
script who will control user processess darknet Shell scripting 2 01-02-2007 11:40 PM
Control Panel In Linux vin6384 Linux software 2 02-10-2006 04:22 AM


All times are GMT +5.5. The time now is 06:04 AM.


Powered by vBulletin® Version 3.8.4 - Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2
©2005-2009 nixCraft. All rights reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38