From 666a1f4f4f2e5246c78d4ec01194bf8e6da2775c Mon Sep 17 00:00:00 2001 From: SpeedyAPM Date: Wed, 11 May 2022 17:48:04 +0000 Subject: [PATCH 1/5] dodaje plik xd.txt --- xd.txt | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 xd.txt diff --git a/xd.txt b/xd.txt new file mode 100644 index 0000000..e69de29 From 4e9cd621a29790787962e58136c4b3d7c4f0a16b Mon Sep 17 00:00:00 2001 From: SpeedyAPM Date: Wed, 11 May 2022 18:14:15 +0000 Subject: [PATCH 2/5] erase xd --- xd.txt | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 xd.txt diff --git a/xd.txt b/xd.txt deleted file mode 100644 index e69de29..0000000 From cdf18ff1999384f274d040ff4716d09b16e505e2 Mon Sep 17 00:00:00 2001 From: SpeedyAPM Date: Sun, 19 Jun 2022 23:04:20 +0000 Subject: [PATCH 3/5] dodaje research o top --- notatki/top-kill-monitoring/README.md | 35 ++++++++++++++++++++++ notatki/top-kill-monitoring/cgroups.txt | 4 +++ notatki/top-kill-monitoring/glances.txt | 7 +++++ notatki/top-kill-monitoring/top.txt | 39 +++++++++++++++++++++++++ 4 files changed, 85 insertions(+) create mode 100644 notatki/top-kill-monitoring/README.md create mode 100644 notatki/top-kill-monitoring/cgroups.txt create mode 100644 notatki/top-kill-monitoring/glances.txt create mode 100644 notatki/top-kill-monitoring/top.txt diff --git a/notatki/top-kill-monitoring/README.md b/notatki/top-kill-monitoring/README.md new file mode 100644 index 0000000..dd8dcf4 --- /dev/null +++ b/notatki/top-kill-monitoring/README.md @@ -0,0 +1,35 @@ +### RESEARCH +cgroups.txt - WYNIK researchu, ograniczanie zasobów (CPU,pamięć) dla grup procesów już zawczasu + +top.txt - przedmiot researchu + +glances.txt - alternatywa top napisana w pythonie, być może bardziej nadaje się do analizy w ramach zajęć + +kill important tip (https://docs.oracle.com/cd/E19120-01/open.solaris/819-2380/eoizf/index.html): +"When using the kill command to stop a process, first try using the command by itself, without including a signal option. Wait a few minutes to see if the process terminates before using the kill command with the -9 signal." + +### kto ? co ?po co ? dlaczego? +Top jest jednym z programów zawartych w zestawie w procps ( https://www.systutorials.com/where-is-the-source-code-for-the-free-command-on-linux/ ) + +The following programs are found in procps: + +free - Report the amount of free and used memory in the system +kill - Send a signal to a process based on PID +pgrep - List processes based on name or other attributes +pkill - Send a signal to a process based on name or other attributes +pmap - Report memory map of a process +ps - Report information of processes +pwdx - Report current directory of a process +skill - Obsolete version of pgrep/pkill +slabtop - Display kernel slab cache information in real time +snice - Renice a process +sysctl - Read or Write kernel parameters at run-time +tload - Graphical representation of system load average +top - Dynamic real-time view of running processes +uptime - Display how long the system has been running +vmstat - Report virtual memory statistics +w - Report logged in users and what they are doing +watch - Execute a program periodically, showing output fullscreen + + + diff --git a/notatki/top-kill-monitoring/cgroups.txt b/notatki/top-kill-monitoring/cgroups.txt new file mode 100644 index 0000000..3cb0940 --- /dev/null +++ b/notatki/top-kill-monitoring/cgroups.txt @@ -0,0 +1,4 @@ +### cgroups research cgroups.txt + + +https://scoutapm.com/blog/restricting-process-cpu-usage-using-nice-cpulimit-and-cgroups \ No newline at end of file diff --git a/notatki/top-kill-monitoring/glances.txt b/notatki/top-kill-monitoring/glances.txt new file mode 100644 index 0000000..b563432 --- /dev/null +++ b/notatki/top-kill-monitoring/glances.txt @@ -0,0 +1,7 @@ +### glances reserch glances.txt + +Opis co i jak +https://www.tecmint.com/glances-an-advanced-real-time-system-monitoring-tool-for-linux/ + +kod źródłowy +https://github.com/nicolargo/glances \ No newline at end of file diff --git a/notatki/top-kill-monitoring/top.txt b/notatki/top-kill-monitoring/top.txt new file mode 100644 index 0000000..41c3931 --- /dev/null +++ b/notatki/top-kill-monitoring/top.txt @@ -0,0 +1,39 @@ +# TOP reserch top.txt +# alternatywnie glances.txt - alternatywa top napisana w pythonie + +### UZYCIE +przykłady +https://www.geeksforgeeks.org/top-command-in-linux-with-examples/ + +strace - podgląd jakie pliki otwiera dany proces czyli np interesujący nas top +https://stackoverflow.com/questions/3371131/need-the-source-code-for-top-and-find-the-connection-between-top-and-proc-dire + +procps - np podejrzenie w top konkretnego procesu +https://opensource.com/article/21/8/linux-procps-ng +https://www.mankier.com/1/top +ciekawa komenda +top -p $(pgrep -d ',' process_name) +użycie naprzykład: +top -p $(pgrep -d ',' nginx) + +Nie wiem czy jest sens brnąć w dalszy research w tym kierunku ale +przykładowe komendy które można kolejno puścić w terminalu poniżej, z programów wychodzimy naciskając q: +sudo su +top -d 1 +top -d 5 +top -d 5 >> toptxt.txt +ll +nano toptxt.txt +strace -e open top +strace -e open top >> starce.txt +ll +nano strace.txt +strace top | grep open + +### CIEKAWOSTKI + +źródła kodu top - napisane w C raczej jako ciekawostka +z repo trovaldsa +https://github.com/torvalds/linux/blob/master/tools/perf/builtin-top.c +interaktywne +https://elixir.bootlin.com/linux/latest/source/tools/perf/builtin-top.c \ No newline at end of file From aa9ac07a11605d7cab5b46697075f9502f6a90e0 Mon Sep 17 00:00:00 2001 From: SpeedyAPM <97914085+SpeedyAPM@users.noreply.github.com> Date: Wed, 22 Jun 2022 00:05:37 +0200 Subject: [PATCH 4/5] Update glances.txt --- notatki/top-kill-monitoring/glances.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/notatki/top-kill-monitoring/glances.txt b/notatki/top-kill-monitoring/glances.txt index b563432..d2c61d7 100644 --- a/notatki/top-kill-monitoring/glances.txt +++ b/notatki/top-kill-monitoring/glances.txt @@ -4,4 +4,6 @@ Opis co i jak https://www.tecmint.com/glances-an-advanced-real-time-system-monitoring-tool-for-linux/ kod źródłowy -https://github.com/nicolargo/glances \ No newline at end of file +https://github.com/nicolargo/glances +analizę możnaby zacząc od np pierwszej wersji +https://github.com/nicolargo/glances/tree/v1.0 From 065e0d307ce2189b958975192b564671ba2100e5 Mon Sep 17 00:00:00 2001 From: SpeedyAPM <97914085+SpeedyAPM@users.noreply.github.com> Date: Wed, 22 Jun 2022 00:11:36 +0200 Subject: [PATCH 5/5] Update glances.txt --- notatki/top-kill-monitoring/glances.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/notatki/top-kill-monitoring/glances.txt b/notatki/top-kill-monitoring/glances.txt index d2c61d7..781f242 100644 --- a/notatki/top-kill-monitoring/glances.txt +++ b/notatki/top-kill-monitoring/glances.txt @@ -5,5 +5,5 @@ https://www.tecmint.com/glances-an-advanced-real-time-system-monitoring-tool-for kod źródłowy https://github.com/nicolargo/glances -analizę możnaby zacząc od np pierwszej wersji +analizę możnaby zacząc najlepiej od np pierwszej wersji https://github.com/nicolargo/glances/tree/v1.0