{"id":1813,"date":"2019-09-26T18:49:42","date_gmt":"2019-09-26T11:49:42","guid":{"rendered":"https:\/\/tino.vn\/?post_type=ht_kb&#038;p=1813"},"modified":"2020-02-28T17:10:12","modified_gmt":"2020-02-28T10:10:12","slug":"cac-thong-so-cua-lenh-top-tren-linux","status":"publish","type":"ht_kb","link":"https:\/\/tino.vn\/blog\/docs\/cac-thong-so-cua-lenh-top-tren-linux\/","title":{"rendered":"C\u00e1c th\u00f4ng s\u1ed1  c\u1ee7a l\u1ec7nh top tr\u00ean linux"},"content":{"rendered":"<p><iframe loading=\"lazy\" src=\"\/\/www.youtube.com\/embed\/Rqnw72pH7d8\" width=\"560\" height=\"315\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/p>\n<p>L\u1ec7nh\u00a0<strong>TOP<\/strong> l\u00e0 m\u1ed9t trong nh\u1eefng l\u1ec7nh c\u1ef1c k\u00ec quan trong cho admin qu\u1ea3n tr\u1ecb h\u1ec7 th\u1ed1ng linux. <strong>top<\/strong>\u00a0l\u00e0 m\u1ed9t c\u00f4ng c\u1ee5 trong Linux gi\u00fap b\u1ea1n c\u00f3 th\u1ec3 theo d\u00f5i t\u00ecnh tr\u1ea1ng h\u1ec7 th\u1ed1ng, c\u00e1c process \u0111ang ch\u1ea1y, CPU, Memory theo th\u1eddi gian th\u1ef1c.<\/p>\n<p>T\u01b0\u01a1ng t\u1ef1 Task manager tr\u00ean windows, L\u1ec7nh <strong>TOP\u00a0<\/strong> gi\u00fap cho admin c\u00f3 th\u1ec3 gi\u00e1m s\u00e1t h\u1ec7 th\u1ed1ng c\u1ee7a m\u00ecnh m\u1ed9t c\u00e1ch chuy\u00ean nghi\u1ec7p v\u00e0 n\u1eafm r\u00f5 t\u1eebng th\u00f4ng tin c\u1ee7a h\u1ec7 th\u1ed1ng.<\/p>\n<p>Khi kh\u1edfi \u0111\u1ed9ng v\u1edbi l\u1ec7nh\u00a0<strong>TOP\u00a0<\/strong>b\u1ea1n c\u00f3 th\u1ec3 th\u1ef1c hi\u1ec7n duy\u1ec7t c\u00e1c process \u0111ang ch\u1ea1y tr\u00ean h\u1ec7 th\u1ed1ng b\u1eb1ng ph\u00edm <strong>PAGE UP\u00a0<\/strong>v\u00e0\u00a0<strong>PAGE DOWN,<\/strong> \u0111\u1ec3 tho\u00e1t kh\u1ecfi giao di\u1ec7n ch\u01b0\u01a1ng tr\u00ecnh TOP b\u1ea1n \u0111\u01a1n gi\u1ea3n nh\u1ea5n <strong>q\u00a0<\/strong>ho\u1eb7c nh\u1ea5n t\u1ed5 h\u1ee3p ph\u00edm <strong>ctrl + c .<\/strong><\/p>\n<p><a href=\"https:\/\/www.screencast.com\/t\/oE8Rflr4O\" rel=\"nofollow noopener\" target=\"_blank\"><img decoding=\"async\" src=\"https:\/\/content.screencast.com\/users\/JohnGrayWorld\/folders\/Snagit\/media\/3529dc58-c850-454f-b2f3-1e96e7cc64aa\/08.26.2019-14.28.png?source=oembed\" alt=\"08.26.2019-14.28.44\" width=\"500\" height=\"150\" title=\"\"><\/a><\/p>\n<p>&nbsp;<\/p>\n<h2 id=\"C\u00e1c_khu_v\u1ef1c_c\u1ee7a_TOP_:_khu_v\u1ef1c_t\u1ed5ng_quan.\">C\u00e1c khu v\u1ef1c c\u1ee7a <strong>TOP : <\/strong>khu v\u1ef1c t\u1ed5ng quan.<\/h2>\n<p>Hang \u0111\u1ea7u ti\u00ean c\u1ee7a giao di\u1ec7n <strong>top<\/strong> \u0111\u01b0\u1ee3c chia th\u00e0nh 2 khu v\u1ef1c kh\u00e1c nhau.\u00a0 khu v\u1ef1c \u0111\u1ea7u ti\u00ean l\u00e0 khu v\u1ef1c t\u1ed5ng quan, gi\u1edbi thi\u1ec7u v\u1ec1 c\u00e1c th\u00e0nh ph\u1ea7n \u00edt thay \u0111\u1ed5i, s\u01a1 l\u01b0\u1ee3c h\u1ec7 th\u1ed1ng c\u0169ng nh\u01b0 t\u00f3m t\u1eaft v\u1ec1 h\u1ec7 th\u1ed1ng.<\/p>\n<h3 id=\"Th\u1eddi_gian_h\u1ec7_th\u1ed1ng(VPS_time),_th\u1eddi_gian_ho\u1ea1t_\u0111\u1ed9ng_v\u00e0_phi\u00ean_ng\u01b0\u1eddi_d\u00f9ng\">Th\u1eddi gian h\u1ec7 th\u1ed1ng(VPS time), th\u1eddi gian ho\u1ea1t \u0111\u1ed9ng v\u00e0 phi\u00ean ng\u01b0\u1eddi d\u00f9ng<\/h3>\n<p><a href=\"https:\/\/www.screencast.com\/t\/7JwBey5h\" rel=\"nofollow noopener\" target=\"_blank\"><img decoding=\"async\" src=\"https:\/\/content.screencast.com\/users\/JohnGrayWorld\/folders\/Snagit\/media\/cdbc81da-8312-4f0d-bbda-0204f39230a8\/08.26.2019-14.31.png?source=oembed\" alt=\"08.26.2019-14.31.09\" width=\"500\" height=\"39\" title=\"\"><\/a><\/p>\n<p>\u1ede ph\u00eda tr\u00ean c\u00f9ng b\u00ean tr\u00e1i c\u1ee7a m\u00e0n h\u00ecnh (nh\u01b0 \u0111\u01b0\u1ee3c \u0111\u00e1nh d\u1ea5u trong \u1ea3nh ch\u1ee5p m\u00e0n h\u00ecnh \u1edf tr\u00ean), tr\u00ean c\u00f9ng hi\u1ec3n th\u1ecb th\u1eddi gian hi\u1ec7n t\u1ea1i c\u1ee7a VPS. Ti\u1ebfp theo l\u00e0 th\u1eddi gian ho\u1ea1t \u0111\u1ed9ng c\u1ee7a h\u1ec7 th\u1ed1ng, cho ch\u00fang ta bi\u1ebft th\u1eddi gian m\u00e0 h\u1ec7 th\u1ed1ng \u0111\u00e3 ch\u1ea1y.<\/p>\n<p>Ch\u1eb3ng h\u1ea1n, nh\u01b0 v\u00ed d\u1ee5 tr\u00ean, th\u1eddi gian hi\u1ec7n t\u1ea1i l\u00e0\u00a0 14:28:19 v\u00e0 h\u1ec7 th\u1ed1ng \u0111\u00e3 ho\u1ea1t \u0111\u1ed9ng \u0111\u01b0\u1ee3c 43 ng\u00e0y, 22 gi\u1edd v\u00e0 53 ph\u00fat.<\/p>\n<p>Ti\u1ebfp \u0111\u1ebfn l\u00e0 s\u1ed1 phi\u00ean ng\u01b0\u1eddi d\u00f9ng ho\u1ea1t \u0111\u1ed9ng.<\/p>\n<p>\u1edf v\u00ed d\u1ee5 tr\u00ean l\u00e0 kh\u00f4ng c\u00f3 phi\u00ean n\u00e0o ho\u1ea1t \u0111\u1ed9ng. C\u00e1c phi\u00ean n\u00e0y c\u00f3 th\u1ec3 \u0111\u01b0\u1ee3c th\u1ef1c hi\u1ec7n tr\u00ean <a href=\"https:\/\/en.wikipedia.org\/wiki\/Computer_terminal#Text_terminals\" rel=\"nofollow noopener\" target=\"_blank\">TTY<\/a> ho\u1eb7c <a href=\"https:\/\/en.wikipedia.org\/wiki\/Pseudoterminal\" rel=\"nofollow noopener\" target=\"_blank\">PTY<\/a> .<\/p>\n<h3 id=\"S\u1eed_d\u1ee5ng_b\u1ed9_nh\u1edb_ram\">S\u1eed d\u1ee5ng b\u1ed9 nh\u1edb ram<\/h3>\n<p><a href=\"https:\/\/www.screencast.com\/t\/iSc6bAotNQiT\" rel=\"nofollow noopener\" target=\"_blank\"><img decoding=\"async\" src=\"https:\/\/content.screencast.com\/users\/JohnGrayWorld\/folders\/Snagit\/media\/3d065b98-a479-4f23-8291-924095ec587f\/08.26.2019-15.34.png?source=oembed\" alt=\"08.26.2019-15.34.15\" width=\"500\" height=\"55\" title=\"\"><\/a><\/p>\n<div class=\"SQZF4WyQ\">\n<div id=\"google_ads_iframe_\/1254144\/booleanworld_com-box-4_0__container__\"><\/div>\n<\/div>\n<p>Ph\u1ea7n n\u00e0y hi\u1ec3n th\u1ecb chi ti\u1ebft\u00a0 b\u1ed9 nh\u1edb ram, swap \u0111ang \u0111\u01b0\u1ee3c ph\u00e2n ph\u1ed1i v\u00e0 s\u1eed d\u1ee5ng bao g\u1ed3m: T\u1ed5ng dung l\u01b0\u1ee3ng ram\/swap hi\u1ec7n c\u00f3, s\u1ed1 l\u01b0\u1ee3ng \u0111\u00e3 s\u1eed d\u1ee5ng, tr\u1ed1ng , ho\u1eb7c \u0111ang ph\u00e2n ph\u1ed1i l\u00e0m buff\/cache.<\/p>\n<h3 id=\"Task.\">Task.<\/h3>\n<p><a href=\"https:\/\/www.screencast.com\/t\/gK4HarFkq\" rel=\"nofollow noopener\" target=\"_blank\"><img decoding=\"async\" src=\"https:\/\/content.screencast.com\/users\/JohnGrayWorld\/folders\/Snagit\/media\/b9fc894d-2bf2-4043-ba7e-341d494be287\/08.26.2019-15.35.png?source=oembed\" alt=\"08.26.2019-15.35.26\" width=\"500\" height=\"55\" title=\"\"><\/a><\/p>\n<p>Ph\u1ea7n Task hi\u1ec3n th\u1ecb s\u1ed1 li\u1ec7u th\u1ed1ng k\u00ea v\u1ec1 c\u00e1c ti\u1ebfn tr\u00ecnh \u0111ang ch\u1ea1y tr\u00ean h\u1ec7 th\u1ed1ng c\u1ee7a b\u1ea1n. V\u00ed d\u1ee5, trong \u1ea3nh ch\u1ee5p m\u00e0n h\u00ecnh \u1edf tr\u00ean, c\u00f3 27 ti\u1ebfn tr\u00ecnh \u0111ang ch\u1ea1y.<\/p>\n<p>C\u00e1c ti\u1ebfn tr\u00ecnh\u00a0 th\u1ef1c hi\u1ec7n k\u1ebft h\u1ee3p gi\u1eefa c\u00e1c t\u00e1c v\u1ee5 I\/O v\u00e0 CPU x\u1eed l\u00fd. CPU kh\u00f4ng ho\u1ea1t \u0111\u1ed9ng khi ti\u1ebfn tr\u00ecnh \u0111ang th\u1ef1c thi I\/O, v\u00ec v\u1eady trong kho\u1ea3ng th\u1eddi gian \u0111\u1ee3i I\/O th\u00ec CPU s\u1ebd th\u1ef1c thi c\u00e1c ti\u1ebfn tr\u00ecnh kh\u00e1c. Ngo\u00e0i ra th\u00ec H\u0110H v\u1eabn cho\u00a0 ph\u00e9p m\u1ed9t quy tr\u00ecnh nh\u1ea5t \u0111\u1ecbnh lu\u00f4n \u0111\u01b0\u1ee3c th\u1ef1c thi trong m\u1ed9t th\u1eddi gian r\u1ea5t nh\u1ecf v\u00e0 chuy\u1ec3n qua quy tr\u00ecnh kh\u00e1c, kh\u00f4ng ph\u1ea3i ti\u1ebfn tr\u00ecnh ph\u1ea3i th\u1ef1c hi\u1ec7n xong m\u1edbi qua ti\u1ebfn tr\u00ecnh kh\u00e1c, \u0111i\u1ec1u n\u00e0y \u0111\u01b0\u1ee3c hi\u1ec3u nh\u01b0 multitask, gi\u00fap t\u1ed1i \u01b0u ho\u00e1 hi\u1ec7u n\u0103ng s\u1eed d\u1ee5ng CPU c\u1ee7a b\u1ea1n. V\u1ec1 c\u01a1 b\u1ea3n th\u00ec c\u00f3 c\u00e1c tr\u1ea1ng th\u00e1i nh\u01b0:<\/p>\n<ul>\n<li>Running (R): M\u1ed9t ti\u1ebfn tr\u00ecnh \u1edf tr\u1ea1ng th\u00e1i running \u0111\u01b0\u1ee3c hi\u1ec3u l\u00e0 ti\u1ebfn tr\u00ecnh n\u00e0y \u0111ang th\u1ef1c thi ho\u1eb7c \u0111ang \u1edf tr\u1ea1ng th\u00e1i h\u00e0ng \u0111\u1ee3i v\u00e0 s\u1eb5n s\u00e0ng th\u1ef1c thi .<\/li>\n<li>Interruptible sleep\u00a0(S): C\u00e1c ti\u1ebfn tr\u00ecnh \u1edf tr\u1ea1ng th\u00e1i n\u00e0y \u0111ang ch\u1edd m\u1ed9t s\u1ef1 ki\u1ec7n ho\u00e0n t\u1ea5t.<\/li>\n<li>Uninterruptible sleep (D): Trong tr\u01b0\u1eddng h\u1ee3p n\u00e0y, m\u1ed9t qu\u00e1 tr\u00ecnh \u0111ang ch\u1edd m\u1ed9t thao t\u00e1c I \/ O ho\u00e0n t\u1ea5t.<\/li>\n<li>Stopped (T): C\u00e1c ti\u1ebfn tr\u00ecnh n\u00e0y \u0111\u00e3 b\u1ecb d\u1eebng b\u1edfi <a href=\"https:\/\/www.gnu.org\/software\/libc\/manual\/html_node\/Job-Control-Signals.html\" rel=\"nofollow noopener\" target=\"_blank\">job control signal<\/a>\u00a0(ch\u1eb3ng h\u1ea1n nh\u01b0 b\u1eb1ng c\u00e1ch nh\u1ea5n Ctrl + Z) ho\u1eb7c v\u00ec ch\u00fang \u0111ang \u0111\u01b0\u1ee3c theo d\u00f5i.<\/li>\n<li>Zombie (Z): Zombie th\u1ef1c ch\u1ea5t l\u00e0 m\u1ed9t ph\u1ea7n c\u00f2n s\u00f3t l\u1ea1i c\u1ee7a m\u1ed9t ti\u1ebfn tr\u00ecnh \u0111\u00e3 ng\u1eebng ho\u1ea1t \u0111\u1ed9ng nh\u01b0ng ch\u01b0a \u0111\u01b0\u1ee3c x\u1eed l\u00fd s\u1ea1ch. Nh\u1eefng ch\u01b0\u01a1ng tr\u00ecnh sau khi tho\u00e1t \u0111\u1ec3 l\u1ea1i ti\u1ebfn tr\u00ecnh Zombie th\u00ec \u0111i\u1ec1u \u0111\u00f3 \u0111\u1ed3ng ngh\u0129a v\u1edbi vi\u1ec7c ch\u01b0\u01a1ng tr\u00ecnh \u0111\u00f3 \u0111\u01b0\u1ee3c l\u1eadp tr\u00ecnh kh\u00f4ng t\u1ed1t..<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<h3 id=\"%CPUs\">%CPUs<\/h3>\n<p><a href=\"https:\/\/www.screencast.com\/t\/XzzdAEPsjLUR\" rel=\"nofollow noopener\" target=\"_blank\"><img decoding=\"async\" src=\"https:\/\/content.screencast.com\/users\/JohnGrayWorld\/folders\/Snagit\/media\/e471796c-c1c0-40c1-8341-5da45cf02da2\/08.26.2019-15.55.png?source=oembed\" alt=\"08.26.2019-15.55.18\" width=\"500\" height=\"55\" title=\"\"><\/a><\/p>\n<p>D\u00f2ng th\u1ee9 3 hi\u1ec3n th\u1ecb % s\u1eed d\u1ee5ng CPU, bao g\u1ed3m % CPU t\u1eeb user (us), system (sy), low-priority processes (nice time, ho\u1eb7c ni), idle time (id), wait for I\/O processes (wa), time handling hardware interruptions (hi), time handling softw<\/p>\n<h3 id=\"T\u1ea3i_trung_b\u00ecnh\">T\u1ea3i trung b\u00ecnh<\/h3>\n<p><a href=\"https:\/\/www.screencast.com\/t\/Ni34Davuo\" rel=\"nofollow noopener\" target=\"_blank\"><img decoding=\"async\" src=\"https:\/\/content.screencast.com\/users\/JohnGrayWorld\/folders\/Snagit\/media\/22f1d53f-b8e3-4e74-81c1-d7d1c5f1495e\/08.26.2019-15.55.png?source=oembed\" alt=\"08.26.2019-15.55.41\" width=\"500\" height=\"55\" title=\"\"><\/a><\/p>\n<p>Load average\u00a0\u0111\u01b0\u1ee3c t\u00ednh m\u1ed7i 1, 5 v\u00e0 15 ph\u00fat \u0111\u1ec3 cung c\u1ea5p c\u00e1i nh\u00ecn s\u01a1 b\u1ed9 to\u00e0n b\u1ed9 h\u1ec7 th\u1ed1ng.<\/p>\n<p><strong>L\u01b0u \u00fd<\/strong>:<\/p>\n<ul>\n<li>C\u00e1c con s\u1ed1 hi\u1ec3n th\u1ecb trong ph\u1ea7n load average ph\u1ee5 thu\u1ed9c v\u00e0o s\u1ed1 l\u01b0\u1ee3ng CPU core c\u1ee7a server. V\u00ed d\u1ee5 n\u1ebfu server c\u00f3 1 core th\u00ec maximum load l\u00e0 1.00, v\u1edbi 2 core l\u00e0 2.00 v\u00e0 c\u1ee9 th\u1ebf t\u0103ng d\u1ea7n.<\/li>\n<li>Th\u00f4ng th\u01b0\u1eddng n\u1ebfu load average &gt;= 0.7 ch\u1ee9ng t\u1ecf server b\u1eaft \u0111\u1ea7u c\u00f3 d\u1ea5u hi\u1ec7u qu\u00e1 t\u1ea3i. B\u1ea1n n\u00ean theo d\u00f5i v\u00e0 t\u00ecm hi\u1ec3u t\u1ed1i \u01b0u l\u1ea1i server ho\u1eb7c code, n\u00e2ng c\u1ea5p ph\u1ea7n c\u1ee9ng \u0111\u1ec3 \u0111\u1ea3m b\u1ea3o load lu\u00f4n d\u01b0\u1edbi ng\u01b0\u1ee1ng n\u00e0y.<\/li>\n<\/ul>\n<h2 id=\"C\u00e1c_khu_v\u1ef1c_c\u1ee7a_TOP_:_khu_v\u1ef1c_li\u1ec7t_k\u00ea_c\u00e1c_ti\u1ebfn_tr\u00ecnh.\">C\u00e1c khu v\u1ef1c c\u1ee7a <strong>TOP : <\/strong>khu v\u1ef1c li\u1ec7t k\u00ea c\u00e1c ti\u1ebfn tr\u00ecnh.<\/h2>\n<p>\u0110\u00e2y l\u00e0 v\u00f9ng t\u00f3m t\u1eaft t\u01b0\u01a1ng \u0111\u1ed1i \u0111\u01a1n gi\u1ea3n h\u01a1n v\u00e0 n\u00f3 ch\u1ee9a m\u1ed9t danh s\u00e1ch c\u00e1c quy tr\u00ecnh. Trong ph\u1ea7n n\u00e0y, ch\u00fang ta s\u1ebd t\u00ecm hi\u1ec3u v\u1ec1 c\u00e1c c\u1ed9t kh\u00e1c nhau \u0111\u01b0\u1ee3c hi\u1ec3n th\u1ecb trong \u0111\u1ea7u ra m\u1eb7c \u0111\u1ecbnh c\u1ee7a \u0111\u1ea7u trang.<\/p>\n<p><a href=\"https:\/\/www.screencast.com\/t\/jqHVBNi60\" rel=\"nofollow noopener\" target=\"_blank\"><img decoding=\"async\" src=\"https:\/\/content.screencast.com\/users\/JohnGrayWorld\/folders\/Snagit\/media\/87910e3d-bb58-44da-97e4-c025b7f0add0\/08.26.2019-16.42.png?source=oembed\" alt=\"08.26.2019-16.42.01\" width=\"500\" height=\"319\" title=\"\"><\/a><\/p>\n<ul>\n<li>PID: Process ID.<\/li>\n<li>USER: T\u00ean ng\u01b0\u1eddi d\u00f9ng th\u1ef1c thi task. root l\u00e0 t\u1eeb h\u1ec7 th\u1ed1ng<\/li>\n<li>S: T\u00ecnh tr\u1ea1ng process, c\u00f3 th\u1ec3 l\u00e0: running (R), sleeping and unable to be interrupted (D), sleeping and able to be interrupted (S), traced\/stopped (T), or zombie (Z).<\/li>\n<li>%CPU: % s\u1eed d\u1ee5ng CPU<\/li>\n<li>%MEM: % s\u1eed d\u1ee5ng Memory<\/li>\n<li>TIME+: T\u1ed5ng s\u1ed1 th\u1eddi gian process \u0111\u00e3 ch\u1ea1y (t\u00ednh c\u1ea3 child process n\u1ebfu c\u00f3).<\/li>\n<li>COMMAND: T\u00ean process.<\/li>\n<\/ul>\n<h2 id=\"C\u00e1c_thao_t\u00e1c_th\u01b0\u1eddng_s\u1eed_d\u1ee5ng_v\u1edbi_ch\u01b0\u01a1ng_tr\u00ecnh_top\">C\u00e1c thao t\u00e1c th\u01b0\u1eddng s\u1eed d\u1ee5ng v\u1edbi ch\u01b0\u01a1ng tr\u00ecnh top<\/h2>\n<p>Th\u1ef1c ra giao di\u1ec7n top b\u1ea1n c\u00f3 th\u1ec3 qu\u1ea3n l\u00fd c\u00e1c ti\u1ebfn tr\u00ecnh c\u0169ng nh\u01b0 b\u1ea1n c\u00f3 th\u1ec3 ki\u1ec3m so\u00e1t c\u00e1c kh\u00eda c\u1ea1nh kh\u00e1c nhau c\u1ee7a c\u00e1c ti\u1ebfn tr\u00ecnh hi\u1ec3n th\u1ecb. Trong ph\u1ea7n n\u00e0y, ch\u00fang ta s\u1ebd l\u1ea5y m\u1ed9t v\u00e0i v\u00ed d\u1ee5.<\/p>\n<p>Trong h\u1ea7u h\u1ebft c\u00e1c v\u00ed d\u1ee5 d\u01b0\u1edbi \u0111\u00e2y, b\u1ea1n ph\u1ea3i nh\u1ea5n m\u1ed9t ph\u00edm \u0111\u1ec3 l\u1ecdc c\u00e1c gi\u00e1 tr\u1ecb xu\u1ea5t ra theo mong mu\u1ed1n. H\u00e3y nh\u1edb r\u1eb1ng c\u00e1c ph\u00edm b\u1ea5m n\u00e0y c\u00f3 ph\u00e2n bi\u1ec7t ch\u1eef hoa ch\u1eef th\u01b0\u1eddng .<\/p>\n<h3 id=\"Kill_m\u1ed9t_ti\u1ebfn_tr\u00ecnh.\">Kill m\u1ed9t ti\u1ebfn tr\u00ecnh.<\/h3>\n<p>N\u1ebfu b\u1ea1n mu\u1ed1n kill m\u1ed9t ti\u1ebfn tr\u00ecnh, ch\u1ec9 c\u1ea7n nh\u1ea5n &#8216;k&#8217; khi\u00a0<strong>top<\/strong> \u0111ang ch\u1ea1y. \u0110i\u1ec1u n\u00e0y s\u1ebd \u0111\u01b0a ra m\u1ed9t l\u1eddi nh\u1eafc, s\u1ebd y\u00eau c\u1ea7u ID ti\u1ebfn tr\u00ecnh c\u1ee7a qu\u00e1 tr\u00ecnh v\u00e0 nh\u1ea5n enter \u0111\u1ec3 kill ti\u1ebfn tr\u00ecnh.<\/p>\n<h3 id=\"S\u1eafp_x\u1ebfp_danh_s\u00e1ch_quy_tr\u00ecnh\">S\u1eafp x\u1ebfp danh s\u00e1ch quy tr\u00ecnh<\/h3>\n<p>M\u1ed9t trong nh\u1eefng l\u00fd do th\u01b0\u1eddng xuy\u00ean nh\u1ea5t \u0111\u1ec3 s\u1eed d\u1ee5ng\u00a0<strong>top<\/strong> l\u00e0 t\u00ecm ra ti\u1ebfn tr\u00ecnh n\u00e0o \u0111ang ti\u00eau t\u1ed1n nhi\u1ec1u t\u00e0i nguy\u00ean nh\u1ea5t. B\u1ea1n c\u00f3 th\u1ec3 nh\u1ea5n c\u00e1c ph\u00edm sau \u0111\u1ec3 s\u1eafp x\u1ebfp danh s\u00e1ch:<\/p>\n<ul>\n<li>&#8216;M&#8217; \u0111\u1ec3 s\u1eafp x\u1ebfp theo m\u1ee9c s\u1eed d\u1ee5ng b\u1ed9 nh\u1edb<\/li>\n<li>&#8216;P&#8217; \u0111\u1ec3 s\u1eafp x\u1ebfp theo m\u1ee9c \u0111\u1ed9 s\u1eed d\u1ee5ng CPU<\/li>\n<li>&#8216;N&#8217; \u0111\u1ec3 s\u1eafp x\u1ebfp theo ID ti\u1ebfn tr\u00ecnh<\/li>\n<li>&#8216;T&#8217; \u0111\u1ec3 s\u1eafp x\u1ebfp theo th\u1eddi gian ch\u1ea1y<\/li>\n<\/ul>\n<p>Theo m\u1eb7c \u0111\u1ecbnh, \u0111\u1ea7u hi\u1ec3n th\u1ecb t\u1ea5t c\u1ea3 c\u00e1c k\u1ebft qu\u1ea3 theo th\u1ee9 t\u1ef1 gi\u1ea3m d\u1ea7n.\u00a0Tuy nhi\u00ean, b\u1ea1n c\u00f3 th\u1ec3 chuy\u1ec3n sang th\u1ee9 t\u1ef1 t\u0103ng d\u1ea7n b\u1eb1ng c\u00e1ch nh\u1ea5n &#8216;R&#8217;.<\/p>\n<p>B\u1ea1n c\u0169ng c\u00f3 th\u1ec3 s\u1eafp x\u1ebfp danh s\u00e1ch v\u1edbi c\u00f4ng\u00a0<code>-o<\/code>\u00a0t\u1eafc.\u00a0V\u00ed d\u1ee5: n\u1ebfu b\u1ea1n mu\u1ed1n s\u1eafp x\u1ebfp c\u00e1c quy tr\u00ecnh theo c\u00e1ch s\u1eed d\u1ee5ng CPU, b\u1ea1n c\u00f3 th\u1ec3 l\u00e0m nh\u01b0 v\u1eady v\u1edbi:<\/p>\n<pre>top -o %CPU<\/pre>\n<div id=\"google_ads_iframe_\/1254144\/booleanworld_com-leader-1_0__container__\"><\/div>\n<h3 id=\"Hi\u1ec3n_th\u1ecb_danh_s\u00e1ch_l\u00e0_c\u00e1c_thread_thay_v\u00ec_c\u00e1c_process.\">Hi\u1ec3n th\u1ecb danh s\u00e1ch l\u00e0 c\u00e1c thread thay v\u00ec c\u00e1c process.<\/h3>\n<p>Nh\u01b0 c\u00e1c b\u1ea1n \u0111\u00e3 bi\u1ebft m\u1ed9t process c\u00f3 th\u1ec3 ch\u1ee9a nhi\u1ec1u thread d\u00f9ng chung t\u00e0i nguy\u00ean v\u1edbi nhau, V\u00e0 n\u1ebfu b\u1ea1n mu\u1ed1n qu\u1ea3n l\u00fd theo d\u1ea1ng c\u00e1c thread b\u1ea1n c\u00f3 th\u1ec3 t\u1ea1i giao di\u1ec7n c\u1ee7a\u00a0<strong>TOP\u00a0<\/strong>b\u1ea1n b\u1ea5m (<strong>H<\/strong>). Ho\u1eb7c b\u1ea1n s\u1eed d\u1ee5ng l\u1ec7nh:<\/p>\n<p><strong>top -H<\/strong><\/p>\n<h3 id=\"\"><\/h3>\n<h3 id=\"Hi\u1ec3n_th\u1ecb_\u0111\u01b0\u1eddng_d\u1eabn_\u0111\u1ea7y_\u0111\u1ee7\">Hi\u1ec3n th\u1ecb \u0111\u01b0\u1eddng d\u1eabn \u0111\u1ea7y \u0111\u1ee7<\/h3>\n<p>Theo m\u1eb7c \u0111\u1ecbnh, top kh\u00f4ng hi\u1ec3n th\u1ecb \u0111\u01b0\u1eddng d\u1eabn \u0111\u1ea7y \u0111\u1ee7 \u0111\u1ebfn ch\u01b0\u01a1ng tr\u00ecnh ho\u1eb7c ph\u00e2n bi\u1ec7t gi\u1eefa c\u00e1c <strong>kernelspace processes<\/strong> v\u00e0 <strong>userspace processes<\/strong>. N\u1ebfu b\u1ea1n c\u1ea7n th\u00f4ng tin n\u00e0y, b\u1ea5m &#8216;c&#8217; trong khi \u0111\u1ea7u \u0111ang ch\u1ea1y giao di\u1ec7n <strong>top<\/strong>. Nh\u1ea5n &#8216;c&#8217; l\u1ea7n n\u1eefa \u0111\u1ec3 tr\u1edf v\u1ec1 m\u1eb7c \u0111\u1ecbnh. Ho\u1eb7c b\u1ea1n c\u00f3 th\u1ec3 s\u1eed d\u1ee5ng l\u1ec7nh sau:<\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-1108\" src=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2019\/08\/top-full.png\" sizes=\"(max-width: 1074px) 100vw, 1074px\" srcset=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2019\/08\/top-full.png 1074w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2019\/08\/1_top-full-300x145.png 300w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2019\/08\/1_top-full-1024x496.png 1024w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2019\/08\/top-full-300x145@2x.png 600w\" alt=\"\" width=\"1074\" height=\"520\" title=\"\"><\/p>\n<pre>top -c<\/pre>\n<h3 id=\"Ti\u1ebfn_tr\u00ecnh_cha\/_con\">Ti\u1ebfn tr\u00ecnh cha\/ con<\/h3>\n<p>\u0110\u00f4i khi b\u1ea1n mu\u1ed1n c\u00f3 c\u00e1i nh\u00ecn t\u1ed5ng quan v\u1ec1 ti\u1ebfn tr\u00ecnh cha con, t\u1ea1i giao di\u1ec7n <strong>top\u00a0\u00a0<\/strong>b\u1ea1n c\u00f3 th\u1ec3 b\u1ea5n n\u00fat (<strong>V)<\/strong> \u0111\u1ec3 hi\u1ec3n th\u1ecb m\u1ed1i quan h\u1ec7 cha con.<\/p>\n<p><a href=\"https:\/\/www.screencast.com\/t\/ZcNOgms3NT4\" rel=\"nofollow noopener\" target=\"_blank\"><img decoding=\"async\" src=\"https:\/\/content.screencast.com\/users\/JohnGrayWorld\/folders\/Snagit\/media\/4754007d-25c5-409b-87aa-70c35ea627d4\/08.26.2019-18.28.png?source=oembed\" alt=\"08.26.2019-18.28.36\" width=\"500\" height=\"300\" title=\"\"><\/a><\/p>\n<p>Ch\u1eb3ng h\u1ea1n nh\u01b0 b\u1ea1n c\u00f3 th\u1ec3 th\u1ea5y ti\u1ebfn tr\u00ecnh <strong>top<\/strong> l\u00e0 con c\u1ee7a ti\u1ebfn tr\u00ecnh <strong>sshd<\/strong> .<\/p>\n<h3 id=\"Li\u1ec7t_k\u00ea_c\u00e1c_ti\u1ebfn_tr\u00ecnh_t\u1eeb_ng\u01b0\u1eddi_d\u00f9ng.\">Li\u1ec7t k\u00ea c\u00e1c ti\u1ebfn tr\u00ecnh t\u1eeb ng\u01b0\u1eddi d\u00f9ng.<\/h3>\n<p>\u0110\u1ec3 li\u1ec7t k\u00ea c\u00e1c ti\u1ebfn tr\u00ecnh t\u1eeb m\u1ed9t ng\u01b0\u1eddi d\u00f9ng b\u1ea1n c\u00f3 th\u1ec3 nh\u1eadp v\u1edbi c\u00fa ph\u00e1p<\/p>\n<pre>top -u t\u00ean_ng\u01b0\u1eddi_d\u00f9ng<\/pre>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-1105\" src=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2019\/08\/top-userselect.png\" sizes=\"(max-width: 774px) 100vw, 774px\" srcset=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2019\/08\/top-userselect.png 774w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2019\/08\/1_top-userselect-300x148.png 300w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2019\/08\/top-userselect-300x148@2x.png 600w\" alt=\"\" width=\"774\" height=\"383\" title=\"\"><\/p>\n<p>Ho\u1eb7c trong giao di\u1ec7n <strong>top\u00a0<\/strong> b\u1ea1n b\u1ea5m (<strong>u)\u00a0<\/strong>sau \u0111\u00f3 b\u1ea1n nh\u1eadp t\u00ean user ng\u01b0\u1eddi d\u00f9ng.<\/p>\n<p>Nh\u01b0 v\u00ed d\u1ee5 d\u01b0\u1edbi l\u00e0 c\u00e1c ti\u1ebfn tr\u00ecnh t\u1edbi t\u1eeb user nginx:<\/p>\n<p><a href=\"https:\/\/www.screencast.com\/t\/1WaPvaltAnM\" rel=\"nofollow noopener\" target=\"_blank\"><img decoding=\"async\" src=\"https:\/\/content.screencast.com\/users\/JohnGrayWorld\/folders\/Snagit\/media\/7057d358-2f14-4a82-b70b-080e14955e94\/08.26.2019-18.32.png?source=oembed\" alt=\"08.26.2019-18.32.51\" width=\"500\" height=\"152\" title=\"\"><\/a><\/p>\n<h3 id=\"L\u1ecdc_c\u00e1c_ti\u1ebfn_tr\u00ecnh.\">L\u1ecdc c\u00e1c ti\u1ebfn tr\u00ecnh.<\/h3>\n<p>&nbsp;<\/p>\n<p>N\u1ebfu b\u1ea1n c\u00f3 qu\u00e1 nhi\u1ec1u ti\u1ebfn tr\u00ecnh \u0111ang l\u00e0m vi\u1ec7c,\u00a0 s\u1ebd kh\u00f3 \u0111\u1ec3 b\u1ea1n l\u1ecdc \u0111\u01b0\u1ee3c k\u1ebft qu\u1ea3 nh\u01b0 mong mu\u1ed1n. Trong t\u00ecnh hu\u1ed1ng nh\u01b0 v\u1eady, b\u1ea1n c\u00f3 th\u1ec3 s\u1eed d\u1ee5ng b\u1ed9 l\u1ecdc b\u1eb1ng c\u00e1ch b\u1ea5m (<strong>o<\/strong>) ho\u1eb7c (<strong>O<\/strong>)<\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-1112\" src=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2019\/08\/top-filter.png\" sizes=\"(max-width: 1077px) 100vw, 1077px\" srcset=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2019\/08\/top-filter.png 1077w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2019\/08\/1_top-filter-300x145.png 300w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2019\/08\/1_top-filter-1024x495.png 1024w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2019\/08\/top-filter-300x145@2x.png 600w\" alt=\"\" width=\"1077\" height=\"521\" title=\"\"><\/p>\n<p>Bi\u1ec3u th\u1ee9c l\u1ecdc l\u00e0 m\u1ed9t c\u00e2u l\u1ec7nh ch\u1ec9 \u0111\u1ecbnh m\u1ed1i quan h\u1ec7 gi\u1eefa m\u1ed9t thu\u1ed9c t\u00ednh v\u00e0 gi\u00e1 tr\u1ecb.\u00a0M\u1ed9t s\u1ed1 v\u00ed d\u1ee5 v\u1ec1 b\u1ed9 l\u1ecdc l\u00e0:<\/p>\n<ul>\n<li><code>COMMAND=nginx<\/code>: l\u1ecdc c\u00e1c ti\u1ebfn tr\u00ecnh m\u00e0<strong> c\u00f3<\/strong> nginx trong command<\/li>\n<li><code>!COMMAND=nginx<\/code>: l\u1ecdc c\u00e1c ti\u1ebfn tr\u00ecnh m\u00e0 <strong>kh\u00f4ng c\u00f3<\/strong> nginx trong command<\/li>\n<li><code>%CPU&gt;3.0<\/code>: l\u1ecdc ti\u1ebfn tr\u00ecnh s\u1eed d\u1ee5ng CPU h\u01a1n 3%.<\/li>\n<\/ul>\n<h3 id=\"Thay_\u0111\u1ed5i_giao_di\u1ec7n_m\u1eb7c_\u0111\u1ecbnh_c\u1ee7a_CPU_v\u00e0_th\u1ed1ng_k\u00ea_b\u1ed9_nh\u1edb_ram.\">Thay \u0111\u1ed5i giao di\u1ec7n m\u1eb7c \u0111\u1ecbnh c\u1ee7a CPU v\u00e0 th\u1ed1ng k\u00ea b\u1ed9 nh\u1edb ram.<\/h3>\n<p>Ta c\u00f3 th\u1ec3 thay \u0111\u1ed5i giao di\u1ec7n hi\u1ec3n th\u1ecb ram v\u00e0 cpu b\u1eb1ng c\u00e1ch b\u1ea5m (<strong>m<\/strong>) ho\u1eb7c (<strong>t<\/strong>) , b\u1ea1n s\u1ebd xem giao di\u1ec7n hi\u1ec3n th\u1ecb c\u1ee7a b\u1ed9 nh\u1edb ram v\u00e0 cpu theo c\u00e1ch tr\u1ef1c quan h\u01a1n.<\/p>\n<p>Ch\u00fac m\u1ecdi ng\u01b0\u1eddi th\u00e0nh c\u00f4ng. !<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>L\u1ec7nh\u00a0TOP l\u00e0 m\u1ed9t trong nh\u1eefng l\u1ec7nh c\u1ef1c k\u00ec quan trong cho admin qu\u1ea3n tr\u1ecb h\u1ec7 th\u1ed1ng linux. top\u00a0l\u00e0 m\u1ed9t c\u00f4ng c\u1ee5 trong Linux gi\u00fap b\u1ea1n c\u00f3 th\u1ec3 theo d\u00f5i t\u00ecnh tr\u1ea1ng h\u1ec7 th\u1ed1ng, c\u00e1c process \u0111ang ch\u1ea1y, CPU, Memory theo th\u1eddi gian th\u1ef1c. T\u01b0\u01a1ng t\u1ef1 Task manager tr\u00ean windows, L\u1ec7nh TOP\u00a0 gi\u00fap cho admin c\u00f3 [&hellip;]<\/p>\n","protected":false},"author":7,"featured_media":2437,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","format":"standard","meta":{"footnotes":""},"tags":[],"ht_kb_category":[17],"class_list":["post-1813","ht_kb","type-ht_kb","status-publish","format-standard","has-post-thumbnail","hentry","ht_kb_category-huong-dan-ve-cloud-vps"],"_links":{"self":[{"href":"https:\/\/tino.vn\/blog\/wp-json\/wp\/v2\/ht_kb\/1813","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tino.vn\/blog\/wp-json\/wp\/v2\/ht_kb"}],"about":[{"href":"https:\/\/tino.vn\/blog\/wp-json\/wp\/v2\/types\/ht_kb"}],"author":[{"embeddable":true,"href":"https:\/\/tino.vn\/blog\/wp-json\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"https:\/\/tino.vn\/blog\/wp-json\/wp\/v2\/comments?post=1813"}],"version-history":[{"count":0,"href":"https:\/\/tino.vn\/blog\/wp-json\/wp\/v2\/ht_kb\/1813\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/tino.vn\/blog\/wp-json\/wp\/v2\/media\/2437"}],"wp:attachment":[{"href":"https:\/\/tino.vn\/blog\/wp-json\/wp\/v2\/media?parent=1813"}],"wp:term":[{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tino.vn\/blog\/wp-json\/wp\/v2\/tags?post=1813"},{"taxonomy":"ht_kb_category","embeddable":true,"href":"https:\/\/tino.vn\/blog\/wp-json\/wp\/v2\/ht_kb_category?post=1813"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}