关于cpu的分析--us,sys百分比代表什么
2011-10-22 14:59
856 查看
top
us 用户空间占用CPU百分比 sy 内核空间占用CPU百分比 ni 用户进程空间内改变过优先级的进程占用CPU百分比 id 空闲CPU百分比 wa 等待输入输出的CPU时间百分比 hi 硬件中断 si 软件中断
wa 数值高的话,一般是由io阻塞引起的。考虑数据库或文件读写有问题
在top下按1,显示逻辑cpu信息
Summary: The user counters show time spent in user mode; the system counters
show time
spent in system mode.
Ayaz
########################
I am not real clear on the difference myself, but basically I believe the
user counters increase when CPU is executing code in user space, and the
system counters increase when CPU is executing system calls. I am not sure
if all system calls increase system counters or only when the CPU is running
in kernel mode.
But basically when your C code opens a file, it will make system calls, part
of which runs kernel modules, and will cause an increase in system
utilization (and the rest of the code increases user util).
Tom Payerle
########################
The user counters show time spent in user mode; the system counters show
time
spent in system mode.
Most C functions actually call system functions to do some of the work.
E.g.,
printf()/scanf() call the write()/read() system functions.
Solaris is actually in system mode for the system functions.
Hence the system counters increment to show the time in the system
functions,
even in a non-root user program.
Michael Schulte
########################
This is one of the core concepts of UNIX.
When operating on user data, a process (or thread) has limited access to
other processes, memory, devices, etc. CPU used by such a thread is counted
as "user time". If it needs to interact with the system, it makes a kernel
or system call (like read()). When the call starts, it has to have extra
privileges, so it operates in kernel or system context. Time accumulated by
the thread is counted as system time.
http://www.uwsg.iu.edu/UAU/process/manage.html
A process that did nothing but make system call in a tight loop might
accumulate significant system time, but it would be an unusual process that
did that. A process that interacted with the system rarely (perhaps doing
extensive mathematical calculations), might accumulate less than 1% system
time.
Darren Dunham
########################
System can be thought of as "things done by the OS directly", for example,
time spent in device drivers, running the network stack, paging, running the
kernel. User is "time spent running user applications (including those of
the root user)".
Thomas Carter
########################
System can be thought of as "things done by the OS directly", for example,
time spent in device drivers, running the network stack, paging, running the
kernel. User is "time spent running user applications (including those of
the root user)".
Thomas Carter
########################
Go to the link below. Great explanation for vmstat.
http://www.adminschoice.com/docs/iostat_vmstat_netstat.htm#Virtual%20Memory%
20Statistics%20(%20vmstat%20)
########################
no matter what you run for an application, the sys counters will increase,
as the application will need system resources to run. sys represents the
activity by all the daemons that the system runs to keep it working i.e.
memory management, IO etc..
where as the usr counters are the processes stictly by the user application.
regards, Don
########################
User = time spent in the context of your process.
System = time spent in the system context on the behalf of your process.
Example:
If you have the classic numerical application that reads in a few numbers,
performs large amounts of math on those numbers, and then prints a single
number as the result, you'll see large user times, and very little system
time (system time is need to do the read/write as well as some process
startup).
If you have an application that creates (or removes) several thousand files,
it will have minimal user time, but very large system time, since most of
the time spent is in the kernel processing the creat() or unlink() calls.
Of course, most processes fall somewhere in between those extremes.
Hope this is of some help,
Ric Anderson (ric at opus1.com)
########################
user: time spend in user processes (not in the kernel)
system: time spend in the kernel
Casper
########################
Standard unix/posix behavior. See just about any textbook.
man rusage can be educational (man sar, etc.). For advanced and indepth
coverage, see the new pair of tomes on Performance/System internals by Mauro
and McDougal.
ru_utime the total amount of time spent executing in user mode.
ru_stime the total amount of time spent in the system
executing on
behalf of the process(es).
Let's consider an illustrative (but not entirely correct) example.
Say you have an application which performs something like:
1) read data into a buffer
2) do a lot of computations on the buffer
3) write the results
During the read activity, a lot of time is spent "in the kernel"
doing "system things" on your behalf. That is accounted as "system"
time. The time spent doing computational things in the buffer is nearly all
user time (unless you have a lot of floating point exceptions or pointer
errors ;>), followed by the write, which again invokes a variety of system
services for causing I/O to actually occur.
相关文章推荐
- [转自Oracle官方中文博客]关于sys CPU usage 100%问题的分析
- intel 酷睿系列 笔记本cpu型号代表的是什么意思?
- 关于判断cpu大端存储还是小端存储的讨论与分析
- 关于“结构体变量名代表什么”的理解
- CPU状态信息us,sy,ni,id,wa,hi,si,st含义及分析
- MySQL数据库SYS CPU高的可能性分析
- 关于 x$ksmsp 视图中KSMCHDUR 字段代表什么意思
- MySQL数据库SYS CPU高的可能性分析
- 关于android 进程CPU占用率高的原因分析
- MySQL数据库SYS CPU高的可能性分析
- MySQL数据库SYS CPU高的可能性分析
- 关于注册表的5大分支所代表的是什么
- 关于多CPU IC系统串电问题分析
- IIS日志代码分析,常见的200,404,301,302分别代表什么意思
- 关于HTTP返回参数代表什么
- 关于cookies中的utmc,utmb,utma,utmz,utmv各代表什么,麻烦高手帮忙解答
- 关于什么是数据分析
- nginx源代码分析 - 启动(六) 关于worker进程绑定CPU的细节
- 性能分析之路-------各指标代表意思以及分析
- 关于CSAPP 6.18的习题分析