Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Linux Monitoring processes a. Type top. Notice that the display stays in the win

ID: 3732450 • Letter: L

Question

Linux

Monitoring processes

a. Type top. Notice that the display stays in the window but changes every few seconds. What is the %CPU usage of top? Leave top running, and in a second terminal window launch the command find / -empty (ignore any messages that you receive while it is running). While find executes, look for find in top’s display. It moves around. Why is it moving? As it moves, what happens to its %CPU and %MEM values? After perhaps 30 seconds or a minute, find will end. Examine top. What happens to the find entry?

b. Another process listed in top is init with a PID of 1. Why does init have a PID of 1?

c. Start the GUI System Monitor program by selecting Applications -> System Tools ->System Monitor. Click on the Processes tab. Compare this to what you see in top. Compare the fields available in the System Monitor to those available in top. What fields differ (if any)? Close this preferences window. Click on the Resources tab. Compare the information about CPU usage, memory and swap history as shown in the GUI to what top tells you. You can close the system monitor now (leave top running).

d. You interact with top by entering letters which are commands. Type u to change users and when prompted, enter Student. What are the top processes listed for Student?[Attach a screenshot] What is the smallest PID and the largest PID that you see in the top window? Type u and to reset top to showing all users. Type d to change the refresh duration from the default (3 seconds) and type 0.5 . Notice how quickly top changes. You should see the top process change quickly. Type d 3 to reset it. Type q to exit top.

Explanation / Answer

Hi,

Please find the answer for your questions regarding Linux Monitoring processes. Please let me know if you need anything.

a. Type top. Notice that the display stays in the window but changes every few seconds. What is the %CPU usage of top? Leave top running, and in a second terminal window launch the command find / -empty (ignore any messages that you receive while it is running). While find executes, look for find in top’s display. It moves around. Why is it moving? As it moves, what happens to its %CPU and %MEM values? After perhaps 30 seconds or a minute, find will end. Examine top. What happens to the find entry?

==> The % of CPU can be identified using below line where it will show the average CPU in all perspective.

Ex:
Cpu(s): 3.6%us, 12.4%sy, 79.9%ni, 0.9%id, 2.7%wa, 0.2%hi, 0.4%si, 0.0%st

3.6%us -> This shows that around 4% of processor occupying running user space process.
12.4%sy -> This will show the % of kernel running process.
79.9%ni -> Time spent of running user sapce porcess
0.9%id -> This shows idle of processor
2.7%wa -> This is wiat average of running process. High % will slow down the performance
0.2%hi -> This shows the spending time of processor which serving interrupts
0.0%st -> This is the wait time related to hypervisor

When you run find / -empty in new window in list of process from top command we can it's moving up and down, it's becasue find command CPU/Memory usage will vary till the command finished, so it's based what kind of files or folders it search. Also you can see this command will stay for sometime and will disappear because till that time find command was running based no.of files/dir available in that directory, once search finish then process will come to end and it will moved out from TOP command.

b. Another process listed in top is init with a PID of 1. Why does init have a PID of 1?

==> The process which has PI of 1 is started by kernel and it's the first process.

c. Start the GUI System Monitor program by selecting Applications -> System Tools ->System Monitor. Click on the Processes tab. Compare this to what you see in top. Compare the fields available in the System Monitor to those available in top. What fields differ (if any)? Close this preferences window. Click on the Resources tab. Compare the information about CPU usage, memory and swap history as shown in the GUI to what top tells you. You can close the system monitor now (leave top running).

==> Normally there is slight difference between System Monitoring and top comand becasue system monitor will not consider buffering part. You can use htop which will give details CPU/Mmeory usage.

d. You interact with top by entering letters which are commands. Type u to change users and when prompted, enter Student. What are the top processes listed for Student?[Attach a screenshot] What is the smallest PID and the largest PID that you see in the top window? Type u and to reset top to showing all users. Type d to change the refresh duration from the default (3 seconds) and type 0.5 . Notice how quickly top changes. You should see the top process change quickly. Type d 3 to reset it. Type q to exit top.

==> After type respectiive user name then if you type a it will sort by PID so you can get MAX/MIN PID easily.

Ex:
top - 06:25:41 up 70 days, 22:48, 2 users, load average: 6.56, 8.06, 6.07
Tasks: 470 total, 2 running, 467 sleeping, 0 stopped, 1 zombie
Cpu(s): 4.2%us, 12.8%sy, 3.6%ni, 36.6%id, 42.5%wa, 0.0%hi, 0.3%si, 0.0%st
Mem: 65974536k total, 64963076k used, 1011460k free, 1924744k buffers
Swap: 16777208k total, 6477768k used, 10299440k free, 12604192k cached

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
13150 zabbix 20 0 151m 1496 1416 S 0.0 0.0 0:00.01 zabbix_server
15302 zabbix 20 0 151m 1436 1148 S 0.0 0.0 4:29.59 zabbix_server
15303 zabbix 20 0 151m 704 536 S 0.0 0.0 1:32.63 zabbix_server
15304 zabbix 20 0 247m 8052 7644 S 0.0 0.0 12:04.10 zabbix_server
15305 zabbix 20 0 247m 7996 7576 S 0.0 0.0 12:02.08 zabbix_server
15306 zabbix 20 0 247m 8076 7660 S 0.0 0.0 11:57.66 zabbix_server
15307 zabbix 20 0 247m 8320 7892 S 0.0 0.0 12:02.21 zabbix_server
15308 zabbix 20 0 247m 8076 7652 S 0.0 0.0 11:58.61 zabbix_server
15309 zabbix 20 0 247m 1948 1708 S 0.0 0.0 2:49.67 zabbix_server
15310 zabbix 20 0 151m 1328 1092 S 0.0 0.0 0:05.45 zabbix_server
15311 zabbix 20 0 151m 1196 968 S 0.0 0.0 0:05.41 zabbix_server
15312 zabbix 20 0 151m 1044 832 S 0.0 0.0 0:05.48 zabbix_server
15315 zabbix 20 0 151m 1248 1012 S 0.0 0.0 0:05.53 zabbix_server
15318 zabbix 20 0 151m 1176 944 S 0.0 0.0 0:05.54 zabbix_server
15319 zabbix 20 0 151m 520 388 S 0.0 0.0 1:41.13 zabbix_server
15321 zabbix 20 0 151m 764 592 S 0.0 0.0 1:28.20 zabbix_server
15323 zabbix 20 0 151m 968 580 S 0.0 0.0 1:25.66 zabbix_server
15325 zabbix 20 0 151m 1876 1564 S 0.0 0.0 2:48.36 zabbix_server
15326 zabbix 20 0 151m 644 484 S 0.0 0.0 3:00.69 zabbix_server
15328 zabbix 20 0 246m 804 628 S 0.0 0.0 1:20.53 zabbix_server
15330 zabbix 20 0 151m 8544 8184 S 0.0 0.0 3:48.36 zabbix_server
15332 zabbix 20 0 151m 8540 8180 S 0.0 0.0 3:46.49 zabbix_server
15334 zabbix 20 0 151m 8536 8172 S 0.0 0.0 3:46.36 zabbix_server
15336 zabbix 20 0 151m 8540 8180 S 0.0 0.0 3:46.51 zabbix_server
15338 zabbix 20 0 151m 1712 1452 S 0.0 0.0 4:31.55 zabbix_server
15340 zabbix 20 0 151m 608 480 S 0.0 0.0 1:39.91 zabbix_server
15342 zabbix 20 0 151m 488 360 S 0.0 0.0 3:18.85 zabbix_server
16855 zabbix 20 0 76596 428 408 S 0.0 0.0 0:00.00 zabbix_agentd
16857 zabbix 20 0 76596 688 612 S 0.0 0.0 21:10.28 zabbix_agentd
16858 zabbix 20 0 76604 796 660 S 0.0 0.0 12:07.67 zabbix_agentd
16859 zabbix 20 0 76604 796 660 S 0.0 0.0 12:09.66 zabbix_agentd
16860 zabbix 20 0 76604 796 660 S 0.0 0.0 12:01.56 zabbix_agentd

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote