CPU consumption


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users CPU consumption
# 1  
Old 02-07-2006
CPU consumption

Hello experts,

I am writing an application in Solaris, which is supposed to work on PrimePower 650 and SunFire 440 machines. The application listens to the events raised by the Hardware and OS in /dev/log. The application listens to the messages logged into /dev/log and do some processing on them. Now, when there is a load condition occuring at /dev/log(i.e. number of messages per second ocurring at /dev/log is high), CPU consumption by my application shoots up to 50%, while my application is expected to consume not more than 1% CPU.
Now, I want to bring down the CPU consumption to 1%. Since the CPU consumtion can vary according to various CPU configurations, i have to ensure that the CPU consumption remains below 1% for low end CPUs.

Thanks in advance.

Currently to solve this problem, i am using the following technique:
1.Process is only reading 5 messages per second from /dev/log and process them. The process sleeps for rest of the time per second.
2. Every 100 messages, the process sleeps for 5 seconds.

This solution brings down the CPU consumption. On some CPU configurations, it is less than 1% CPU consumption. But on others still varies from 3-13%.

Please tell me if the processing delay technique used has some fundamental faults, or what is the correct technique of introducing processing delay for controlling CPU consumption.

Please also tell your suggestions for controlling CPU consumption. I would also appreciate , if you can redirect me to some links where i can find CPU consumption control techniques and fundamentals.

Thanks and regards.
# 2  
Old 02-16-2006
This sounds like a silly requirement. Lower the priority of your process so that it is the most disfavored process on the system. And then consume all the cpu you want.
# 3  
Old 02-17-2006
I agree with what Perderabo said. But if for some reason you really do need to keep it under 1%, check into the resource management features of Solaris 10. I'm not sure if you can limit cpu usage per process or not, but you should be able to find a way to make it work. If necessary you could even create a new user who owns and runs that process and limit the resources that user has access to.
# 4  
Old 02-17-2006
Is this on a realtime system?
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Red Hat

Understanding cpu consumption with TOP

Hi please see attached picture of the TOP command. the "java" process seem to consume 700% of cpu is that mean that he uses 100% of every 7 cpu cores? thanks (2 Replies)
Discussion started by: guy3145
2 Replies

2. UNIX Desktop Questions & Answers

Regarding Memory Consumption

Hi All I am new to UNIX ,can any one please help in finding MEMORY CONSUMPTION of VLC when i use it as Streaming Server. I need to log the memory consumption for atleast 10 hours. Can any one help me in finding this Please (1 Reply)
Discussion started by: ravikanth17
1 Replies

3. UNIX for Advanced & Expert Users

Help! CPU consumption - %usr and %sys ??

On Linux, top shows how much % of CPU is consumed by "user" as well as "sys" like below. Tasks: 272 total, 3 running, 268 sleeping, 0 stopped, 1 zombie Cpu(s): 65.9%us, 33.8%sy, 0.0%ni, 0.2%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st Mem: 16300960k total, 16212488k used, 88472k free, ... (0 Replies)
Discussion started by: gomes1333
0 Replies

4. Solaris

Multi CPU Solaris system shows 100% CPU usage.

Hello Friends, On one of my Solaris 10 box, CPU usage shows 100% using "sar", "vmstat". However, it has 4 CPUs and prstat and glance are not showing enough processes to justify high CPU utilization. ========================================================================= $ prstat -a ... (4 Replies)
Discussion started by: mahive
4 Replies

5. Shell Programming and Scripting

Shell script to display top 5 process (per cpu consumption)

Hello, I have to create shell script being myself real novice in scripting... I was looking on the Internet for some script examples, but I don't have the basic understanding of the shell. I was trying to do something with “ps” command without success. For exemple total number of... (2 Replies)
Discussion started by: mr_awd
2 Replies

6. AIX

consumption memory

Hi, I have a problem with memory on AIX 5.3. On this server, we have JDE Edwards (ERP) and Oracle Database (9.2.0.7.0). We have 4 Gb for physical memory and 3 Gb for paging space. When I stop all services (JDE, Oracle and all other services), the physical memory is not free (4 Gb) svmon... (9 Replies)
Discussion started by: tagger
9 Replies

7. 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 ..to use these values in shell script to kill processes exceeding cpu utilization.ps (pcpu) command does not give exact values..top does not give persistant values..psstat,vmstat..does njot... (3 Replies)
Discussion started by: pankajd
3 Replies

8. Shell Programming and Scripting

CPU Consumption comparision.

hi, i hav a script which processes 1000 files one by one in every run jus for searching their corresponding output files at a given path, due to this my script runs for long time and taking more CPU, can we have any way in which we can have this check at least 100 files in a single shot... (5 Replies)
Discussion started by: Prateek007
5 Replies

9. SCO

Ghost Process + CPU consumption

Hi everyone, I have a problem on sco unixware 7.1.4 a Ghost process is consuming cpu usage. rtpm cpu 0 ======--------- cpu 1 ===--------------------- cpu 2 ============================================================----------- cpu 3 ... (1 Reply)
Discussion started by: neal.opperman
1 Replies

10. AIX

Memory consumption of threads

Hi, how can I find out how many memory (physical and virtual) a thread uses at the moment? I know how to find out the Thread-ID, but not how to monitor it... We use AIX 4.3.3 at th emoment. Please help, I am stuck :confused: !! (0 Replies)
Discussion started by: Fong
0 Replies
Login or Register to Ask a Question