# linux
sudo yum update -y
sudo yum install git -y
# ubuntu
sudo apt-get update
sudo apt-get upgrade
git version
git clone <https://github.com/TeamSparta-Inc/etl.git>
vi .env
python3 --version
sudo apt install python3-pip
pip3 --version
pip3 install -r "requirements.txt"
- sudo apt-get install libpq-dev (for psycopg2)
pip3 list
nohup python3 etl/main.py > output.log
ps aux | grep main # kill {pid}
tail -f output.log
// 현재 시간 (Timezone 확인)
sudo date
// localtime 삭제
sudo rm /etc/localtime
// timezone Aisa/Seoul 로 변경
sudo ln -s /usr/share/zoneinfo/Asia/Seoul /etc/localtime
// 변경된 시간 (Timezone) 확인 후 마무리
sudo date
sudo cat /var/log/syslog
ubuntu@ip-172-31-20-29:~$ top
top - 17:00:55 up 12 days, 2:38, 2 users, load average: 0.01, 0.01, 0.10
Tasks: 101 total, 1 running, 100 sleeping, 0 stopped, 0 zombie
%Cpu(s): 0.0 us, 0.3 sy, 0.0 ni, 99.7 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
MiB Mem : 949.7 total, 370.2 free, 215.4 used, 364.2 buff/cache
MiB Swap: 0.0 total, 0.0 free, 0.0 used. 579.2 avail Mem
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
32648 root 20 0 1337284 35684 19328 S 0.3 3.7 4:46.17 amazon-cloudwat
1 root 20 0 167440 11008 6400 S 0.0 1.1 0:20.19 systemd
2 root 20 0 0 0 0 S 0.0 0.0 0:00.02 kthreadd
3 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 rcu_gp
4 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 rcu_par_gp
5 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 slub_flushwq
6 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 netns
8 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 kworker/0:0H-events_highpri
10 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 mm_percpu_wq
11 root 20 0 0 0 0 I 0.0 0.0 0:00.00 rcu_tasks_rude_kthread
12 root 20 0 0 0 0 I 0.0 0.0 0:00.00 rcu_tasks_trace_kthread
13 root 20 0 0 0 0 S 0.0 0.0 0:04.55 ksoftirqd/0
14 root 20 0 0 0 0 I 0.0 0.0 0:07.21 rcu_sched
15 root rt 0 0 0 0 S 0.0 0.0 0:06.61 migration/0
16 root -51 0 0 0 0 S 0.0 0.0 0:00.00 idle_inject/0
18 root 20 0 0 0 0 S 0.0 0.0 0:00.00 cpuhp/0
19 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kdevtmpfs
20 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 inet_frag_wq
21 root 20 0 0 0 0 S 0.0 0.0 0:00.01 kauditd
22 root 20 0 0 0 0 S 0.0 0.0 0:00.24 khungtaskd
The output from the top command provides real-time information about the system's resource usage. Let's break down what each part of the line %Cpu(s): 41.1 us, 1.7 sy, 0.0 ni, 48.8 id, 0.2 wa, 0.0 hi, 1.3 si, 6.9 st means:
%Cpu(s): This shows the CPU usage breakdown.
41.1 us: User space percentage - The percentage of CPU utilization that occurred while executing at the user level (application).1.7 sy: System space percentage - The percentage of CPU utilization that occurred while executing at the system level (kernel).0.0 ni: Nice value percentage - The percentage of CPU utilization that occurred while executing processes with a manually set 'nice' value (a way to prioritize processes).48.8 id: Idle percentage - The percentage of time the CPU was idle and not running any tasks.0.2 wa: IO wait percentage - The percentage of time the CPU was waiting for I/O operations to complete.0.0 hi: Hardware IRQ (Interrupt Request) percentage - The percentage of time the CPU was servicing hardware interrupts.1.3 si: Software Interrupts percentage - The percentage of time the CPU was servicing software interrupts.6.9 st: Steal Time percentage - The percentage of time a virtual CPU waited for a real CPU while the hypervisor was servicing another virtual processor (applicable in virtualized environments).The second line 14264 ubuntu 20 0 1346272 462364 13568 R 73.3 23.5 8:01.69 python3 provides details on a specific process:
14264: Process ID (PID) of the task.ubuntu: User that owns the task.20: The nice value of the task. A lower nice value means higher priority.0: The task's scheduling priority. In Linux, this is typically 0 for normal user processes.1346272: Virtual Memory Size (https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CWL_GettingStarted.html