How to incrase the %CPU of the kernel on a Linux?

Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users How to incrase the %CPU of the kernel on a Linux?
# 1  
Old 09-29-2013
How to incrase the %CPU of the kernel on a Linux?

Hi Unix Gurus,

We're trying to verify few alerts to be generated by our application when the threshold values are crossed. As part of this we need to generate an alert when the %CPU utilization of the Kernel goes beyond a certain value. We monitor the %CPU of kernel using the mpstat command (the field is highlighted in bold and red color below).

06:19:36 AM  CPU   %user   %nice    %sys %iowait    %irq   %soft  %steal   %idle    intr/s
06:19:36 AM  all    0.39    0.00    0.34    0.66    0.00    0.03    0.00   98.58   1211.49

And right now i'm finding it difficult to increase this kernel %CPU. It takes a lot of time to increment the value of the %CPU of Kernel. I'm using the following command to do this :

fulload() { dd if=/dev/zero of=/dev/null | dd if=/dev/zero of=/dev/null | 
           dd if=/dev/zero of=/dev/null | dd if=/dev/zero of=/dev/null & }; 
           fulload; read; killall dd

But the cpu utlilisation increments very slowly with the above command.

I'm working on RHEL 5.6
Pls. advise if you guys have any ideas.


Last edited by jim mcnamara; 09-29-2013 at 07:19 AM..
# 2  
Old 09-29-2013
None of this makes a lot of sense.

Is there a reason you cannot simply abuse the your application to make it use more kernel?

If you simply have to increase kernel time another way then put together something that creates lots of threads with short duration. Or lots of processes. Where lots==100+.

Somewhat like the idea of a fork bomb. DON'T use a fork bomb. Not a good idea. All it does is create endless processes. Limit the total number of processes.

while true
   while [ $cnt -le 100 ]
         ls /tmp > /dev/null &
         cnt=$(( $cnt + 1 ))

None of this is a great idea. There is code out there - google for 'stress test unix'
# 3  
Old 09-29-2013
Try setting dd's block size to 1. Most of the time will be spent in useless system calls.
Login or Register to Ask a Question

Previous Thread | Next Thread

7 More Discussions You Might Find Interesting

1. AIX

Excessive Kernel CPU Usage

Good Morning All, I've been a long time lurker but this if my first time posting. About 6 months ago I started a new job with an AIX box. I had administered many Debian and Red Hat variant systems before, but this was my first AIX. It is an old box (Power4) that runs our ERP. It had been... (2 Replies)
Discussion started by: Jacoby0419
2 Replies

2. Programming

HELP!!: CPU resource allocation between kernel modules and user mode process

Hi,all: I run my program which consists of one kernel module and one user mode process on a dual core server. The problem here is the kernel module consumes 100% of one core while the user mode process only consumes 10% of the other core, is there any solution that I can assign some computing... (1 Reply)
Discussion started by: neyshule
1 Replies

3. UNIX for Advanced & Expert Users

Extremely high kernel CPU Usage (Solaris 10 SPARC)

I've got a domain running on a few boards of a 25k. I'm seeing very high kernel cpu usage in top and cant' quite explain it. System runs a large number of smallish Oracle 10g2 databases (30), used mainly for development. load average: 36.63, 36.68, 37.42 2489 processes: 2452 sleeping, 21... (0 Replies)
Discussion started by: utopiajoe
0 Replies

4. Solaris

Solaris 10 - script creating huge spike in Kernel CPU

I'm running on Solaris 10, and I have a script that's running on several machines. Basically, what it's doing is: * tail -f | grep one or more log files into a temp file * Every minute or so, copy that temp file to a second temp and zero the first * Sed through the 2nd temp to pull out a user... (2 Replies)
Discussion started by: Rorgg
2 Replies

5. UNIX for Dummies Questions & Answers

how to get persistant cpu utilization values per process per cpu in linux (! top,ps)

hi, i want to know cpu utilizatiion per process per cpu..for single processor also if multicore in linux use these values in shell script to kill processes exceeding cpu (pcpu) command does not give exact does not give persistant values..psstat,vmstat..does njot... (3 Replies)
Discussion started by: pankajd
3 Replies

6. Linux

Kernel panic - not syncing: cannot execute a PAE-enabled kernel on PAE-less CPU

ok so I just installed fedora core 6 on my dell inspiron 700m and I go to boot into linux and I get this error. Has anyone seen this before? I also had XP Pro and Vista installed on this pc prior to putting fedora core 6 on the machine. I'm trying to setup a triple boot system. Please Help... (2 Replies)
Discussion started by: dave043
2 Replies

7. AIX

cpu kernel - please urgent

hello On my P570, i have with sar: cpu of user : 40 % cpu of kernel : 60 % !! I don't know how find the process of kernel, ps -ef give to me the process of user, but for kernel ? what can i kill to liberate some cpu of kernel ? it is a production server, i can't reboot it thank you (2 Replies)
Discussion started by: pascalbout
2 Replies
Login or Register to Ask a Question