- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- application causes CPU to spend a lot of time in t...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-02-2002 04:34 AM
тАО12-02-2002 04:34 AM
i have an application which gives the following output from top.
Load averages: 1.25, 0.87, 0.41
285 processes: 164 sleeping, 57 running, 64 zombies
Cpu states:
CPU LOAD USER NICE SYS IDLE BLOCK SWAIT INTR SSYS
0 1.21 0.8% 54.7% 5.3% 39.2% 0.0% 0.0% 0.0% 0.0%
1 1.15 0.4% 55.6% 8.1% 35.9% 0.0% 0.0% 0.0% 0.0%
2 1.01 1.2% 54.7% 6.5% 37.6% 0.0% 0.0% 0.0% 0.0%
3 1.19 0.4% 60.3% 5.8% 33.5% 0.0% 0.0% 0.0% 0.0%
4 1.27 0.0% 60.5% 8.3% 31.2% 0.0% 0.0% 0.0% 0.0%
5 1.08 0.0% 56.8% 8.7% 34.5% 0.0% 0.0% 0.0% 0.0%
6 1.46 0.2% 59.2% 7.3% 33.3% 0.0% 0.0% 0.0% 0.0%
7 1.61 0.0% 59.2% 8.1% 32.7% 0.0% 0.0% 0.0% 0.0%
--- ---- ----- ----- ----- ----- ----- ----- ----- -----
avg 1.25 0.4% 57.7% 7.1% 34.7% 0.0% 0.0% 0.0% 0.0%
Memory: 1178288K (1112376K) real, 2946960K (2859364K) virtual, 14685596K free Page# 1/13
CPU TTY PID USERNAME PRI NI SIZE RES STATE TIME %WCPU %CPU COMMAND
7 pty/ttyr0 1172 test 152 36 87096K 17092K run 49:59 58.17 58.07 myApplication
3 pty/ttyr1 1174 test 152 36 86420K 16816K run 49:49 57.46 57.36 myApplication
0 pty/ttyq8 1144 test 152 36 307M 62716K run 49:15 55.96 55.87 myApplication
4 pty/ttyq6 1140 test 152 36 305M 60616K run 48:39 55.08 54.98 myApplication
3 pty/ttyq9 1146 test 152 36 305M 61132K run 48:36 55.07 54.97 myApplication
5 pty/ttyqa 1148 test 152 36 305M 61464K run 48:20 54.86 54.77 myApplication
7 pty/ttyq7 1142 test 152 36 302M 58972K run 48:38 54.80 54.71 myApplication
...etc
This shows that there are multiple instances of myApplication running, each using approx 55% CPU. However under "Cpu states" it shows that the CPUs are actually spending most of their time in the "NICE" state. What does the NICE state indicate? I have not 'niced' any of the applications. They are all running at the default nice value. The application is a multithreaded c++ application which also loads a JVM.
Thanks for any help,
Jim.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-02-2002 04:43 AM
тАО12-02-2002 04:43 AM
Re: application causes CPU to spend a lot of time in the NICE state.
live free or die
harry
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-02-2002 04:54 AM
тАО12-02-2002 04:54 AM
Re: application causes CPU to spend a lot of time in the NICE state.
Thanks,
Jim.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-02-2002 05:14 AM
тАО12-02-2002 05:14 AM
Re: application causes CPU to spend a lot of time in the NICE state.
Now modern Unix systems are quite sophisticated and even a 100% CPU-intensive application won't suspend all other programs--that's what time slicing and context switching is all about. Every 100ms (default) the kernel checks to see if there are other processes ready to run. So all the processes running at a nice level are running as fast as they can. The nice state is a convenient way to report on processes that were started with a 'nicer' priority.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-02-2002 05:23 AM
тАО12-02-2002 05:23 AM
Re: application causes CPU to spend a lot of time in the NICE state.
From man top
NI Nice value ranging from -20 to +20.
From man nice
All processes have an associated system nice value which is used to
compute the instantaneous-priority of the process when it is scheduled
to run. Normally, all processes inherit the system nice value of
their parent process when they are spawned. The shell (sh, csh, ksh,
etc.) can create a child process with a different priority from the
current shell process by spawning the child process via the nice
command. If the priority_change value is unsigned (positive), the
child process is nicer (lower in priority) relative to the parent. If
the priority_change value is negative, the child process runs at a
higher priority with a greater share of available system resources.
To spawn a higher priority child process, the parent process must be
owned by a user who has the appropriate privileges.
At boot-up, the system starts the init process at a system nice value
of 20 (system default). On most systems, all processes (down to the
login shells) inherit this priority. Starting from their individual
login shell processes, users can alter the system nice value of
descendent processes to as much as 39, or, with appropriate
privileges, as little as 0. A system nice value of 0 establishes an
extremely high priority, whereas a value of 39 indicates a very low
priority.
Your nice value is 36
This is set by the system load balancing to allow the machine to function when a heavy process is busy.
The processor NICE is the percentage of time the processor runs processes with a nice changed value
There have been p[roblems with top so check you have the latets patch
Regards
Steve Steel
Quote of the moment
-------------------
"We are drowning in information but starved for knowledge."
-- John Naisbitt
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-02-2002 06:07 AM
тАО12-02-2002 06:07 AM
Re: application causes CPU to spend a lot of time in the NICE state.
If there is sufficient cpu capacity to get them done, great, otherwise they will take longer to process.
Since you still have idle time left on the machine, then they are processing as fast as they can. When you get higher priority processes, which would be almost any at your nice level, the niced will run slower.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-02-2002 07:13 AM
тАО12-02-2002 07:13 AM
SolutionYou have a nice set of handy answers here, but mayby it's not exactly what you wanted to know. So, I won't write again what 'nice' is and what it does, as it's written above (besides I have an impression that you knew it before). Let's concentrate on top results:
NICE is the time spent by CPU for the process that's been niced.
USER is the time spent by CPU for process that's not been niced.
The meaning is actually the same, but it's comfortable to have it separate sometimes. And remember that the every process can renice itself without operator's help. Even more - as your myApplication seems to be CPU consumimg it's very good choice that it's been niced.
As you have quite big IDLE there is nothing for you to worry about, untill you run another CPU consuming process that won't be niced.
Everything else that would be interested for you has already been told before.