aws 콘솔에 모니터링 페이지가 있지만 cpu 최적화할 때 측정용으로는 애매한 것 같다.
top -b
다양한 cpu 모니터링 툴이 있지만 top 이 무난하고 좋은 것 같다. top 은 화면으로 출력되는 콘솔 모니터링 프로그램인데 파일로 저장하려면 배치 모드(-b)를 이용해야 한다. 간격은 -d 옵션을 이용하면 된다.
-b : Batch mode operation
Starts top in 'Batch mode', which could be useful for sending output from top to other programs or to a file. In this mode, top will not accept input and runs until the iterations limit you've set with the '-n' command-line option or until killed.
-d : Delay time interval as: -d ss.tt (seconds.tenths)
Specifies the delay between screen updates, and overrides the corresponding value in one's personal configuration file or the startup default. Later this can be changed with the 'd' or 's' interactive commands.
Fractional seconds are honored, but a negative number is not allowed. In all cases, however, such changes are prohibited if top is running in 'Secure mode', except for root (unless the 's' command-line option was used). For additional information on 'Secure mode' see topic 5a. SYSTEM Configuration File.
ex) top -b -d 30
: 30초 간격으로 출력
참고 :
https://linux.die.net/man/1/top
https://www.tecmint.com/save-top-command-output-to-a-file/