Raspberry Pi_Kor_19.3.3 “/proc/PID/”의 개별 process 정보 확인

19.3.3 “/proc//”의 개별 process 정보 확인

먼저 프로그램에 대한 process를 조회해 보면 아래와 같이 PID “9223” process가 있다. 해당 process에 대한 CMD 항목을 보면 “/usr/bin/motion”라는 내용이 표시되어 있다.

Raspberry Pi_Kor_19.3.2 “/proc” 폴더의 시스템 정보 확인

19.3.2 “/proc” 폴더의 시스템 정보 확인

“/proc” 폴더 밑에는 시스템의 전반에 대한 상태 정보를 포함하고 있다.

19.3.2.1 CPU와 Memory 정보

“/proc” 폴더에서는 시스템의 전체에 대한 CPU와 memory 관련 정보를 확인해 볼 수 있다.

다음은 “/proc/meminfo”의 내용을 확인한 것이다. 이것은 memory의 전반적인 상태를 보여주고 있다. 잠시 후에 해당 파일의 내용을 다시 확인해 보면 내용이 변경된 것을 알 수 있다. 즉 시스템의 상태가 변경됨에 따라 memory 사용 상태가 변경되었으므로 이 파일의 내용도 자동으로 변경된 것을 의미한다.

Raspberry Pi_Kor_19.3.1 “/proc” 폴더의 정보 종류

19.3 “/proc” 폴더와 process 정보

Linux에서 “/proc” directory는 운영체제의 기본 directory의 일부로 시스템이 관리하는 process에 대한 전반적인 정보를 제공해 준다. 여기에는 시스템 전반에 대한 요약정보뿐만 아니라 개별 process id에 대한 상세한 정보까지 함께 제공해 주고 있다. 여기서는 “/proc” directory에 있는 정보의 내용에 대해서 간략히 살펴본다.

19.3.1 “/proc” 폴더의 정보 종류

다음은 /proc directory에 있는 내용을 조회한 화면이다.

Raspberry Pi_Kor_19.2.1 저장공간 확인

19.2 저장장치 모니터링

19.2.1 저장공간 확인

19.2.1.1 “df” 명령 – file system 디스크 공간 확인

시스템의 전반적인 디스크 저장장치 사용 상태를 확인하고자 할 때 df 명령을 사용할 수 있다.

Raspberry Pi_Kor_19.1.2 process 죽이기

19.1.2 process 죽이기

현재 실행되고 있는 process의 처리가 더 이상 필요 없거나, process의 진행상태에 문제가 있는 경우 해당 process를 지정하여 처리를 중단할 수 있다.

19.1.2.1 “kill” 명령 – PID를 이용한 process 종료

시스템에 실행되고 있는 process를 종료하도록 시스템에 지시하는 것이 “kill” 명령이다.

Raspberry Pi_Kor_19.1.1 시스템 상태 확인

19.1 CPU, Memory 및 Task

CPU와 memory는 시스템이 가지고 있는 resource이고, 이들 resource를 사용하여 사용자가 지시한 작업을 하는 것이 task 또는 process 이다. 따라서 현재의 작업 처리상태에 문제가 없는지 확인하기 위해서는 시스템에서 가용한 resource와 현재 resource를 사용되고 있는 process에 대해서 모니터링하는 것이 필요하다.

Raspberry Pi_Kor_19.0 Chapter 19 시스템 모니터링

Chapter 19 시스템 모니터링

Chapter 주요 내용

시스템이 정상적으로 운영되기 위해서는 시스템이 사용하는 기본적인 resource가 충분히 확보되어야 하는데, 시스템을 운영하는 담당자는 항상 시스템이 정상적으로 작동하고 있는지 확인하고, 정상적으로 작동하지 않으면 어떤 문제가 있는지 확인하여 조치하는 것이 필요하다. 여기서는 Raspberry Pi 시스템의 여러 resource의 현재 상태를 확인해 보는 방법을 살펴 볼 것이다.

다음과 같은 항목에 대한 내용을 포함하고 있다.
■ CPU, memory 및 task 모니터링

■ 저장창치 모니터링

■ /porc 폴더와 process 정보 모니터링

Raspberry Pi_Eng_19.0 Chapter 19 System Monitoring

Chapter’s Main Topics

In order for the system to operate properly, the basic resources used by the system must be sufficiently secured. The person in charge of operating the system should always check whether the system is operating normally, and if not, check to see what the problem is and take action. Here we will look at how to check the current state of the various resources in the Raspberry Pi system.
 
It includes descriptions on the following topics:
■    CPU, memory and task monitoring
■    Monitoring storage device
■    Monitoring “/porc” folder and process information

Raspberry Pi_Eng_19.3.3 Checking Each Process Information in “/proc/PID/”

Original Book Contents
19.3.3 Checking Each Process Information in “/proc//”

First, if you look up the process for program, there is PID “9223” process as below. The CMD entry for the process shows “/usr/bin/motion”.

Raspberry Pi_Eng_19.3.2 Checking System Information in “/proc” Folder

19.3.2 Checking System Information in “/proc” Folder

The status information about the system as a whole is included below the “/proc” folder.

19.3.2.1 Information about CPU and Memory

In the “/proc” folder, you can see the CPU and memory related information for the entire system.