12.07.2015 Views

download

download

download

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 4The above example will increase the nice-level of PID 335 by 5.# renice –n 5 –u 101The above example will increase the nice-level of all programs owned byUID(extracted from /etc/passwd file )101.To decrease the nice value of a process, you can use renice with a negative value:# renice –n -3 335Any user can increase the nice value of his own processes, but only theroot user can decrease the nice-level of any process, even if he was theone who had increased the nice value.Resource Management and ControlFreeBSD offers various utilities to monitor the current status of the resources andhow they are used. You saw a few of these utilities earlier in this chapter that weremostly process related. There are also other utilities that monitor the other behaviorsof the system—disk I/O, network, virtual memory, buffers, and so on.System Resource Monitoring Tools—vmstat, iostat,pstat, and systatThe vmstat(8) is a utility used to report various system statistics. It shows statisticsabout process, virtual memory, disk, and CPU activity. This utility is very useful ingathering live statistics on a running server. The following example shows the livestatistics on a FreeBSD server, every five seconds:# vmstat -w 5procs memory page disk faults cpur b w avm fre flt re pi po fr sr ad0 in sy cs us sy id1 1 0 166740 217276 7 0 0 0 7 0 0 4 49 266 0 0 1001 0 0 166740 217204 4852 0 0 0 4521 0 79 81 10755 798 69 8 231 0 0 166740 237948 3653 0 0 0 6092 0 240 243 8197 1484 38 19 421 0 0 167120 236952 4801 0 0 0 4359 0 77 79 10741 789 58 15 271 0 0 166740 236184 4743 0 0 0 4338 0 82 84 10732 814 69 15 151 0 0 169368 235184 4649 0 0 0 4225 0 77 79 10485 784 62 19 19By default, vmstat shows the detailed information about the processes (procscolumn), system memory (memory column), page faults and paging activity (pagecolumn), disk operations (disk column), trap and interrupt rates (faults column), andthe processor activity (cpu column).[ 69 ]

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!