{"id":75250,"date":"2019-11-30T10:01:17","date_gmt":"2019-11-30T01:01:17","guid":{"rendered":"https:\/\/www.softantenna.com\/wp\/?p=75250"},"modified":"2019-11-30T10:01:17","modified_gmt":"2019-11-30T01:01:17","slug":"sar","status":"publish","type":"post","link":"https:\/\/softantenna.com\/blog\/sar\/","title":{"rendered":"sar - Linux\u30b5\u30fc\u30d0\u30fc\u306e\u30e2\u30cb\u30bf\u30ea\u30f3\u30b0\u30c4\u30fc\u30eb"},"content":{"rendered":"<p><img decoding=\"async\" style=\"display:block; margin-left:auto; margin-right:auto;\" src=\"https:\/\/softantenna.com\/blog\/wp-content\/uploads\/2019\/11\/s_20191129_194511.jpg\" alt=\"S 20191129 194511\" title=\"s_20191129_194511.jpg\" border=\"0\" width=\"880\" height=\"615\" \/><\/p>\n<p>\u8fd1\u5e74\u30a4\u30f3\u30bf\u30fc\u30cd\u30c3\u30c8\u4e0a\u306e\u30b5\u30fc\u30d0\u30fc\u3092\u500b\u4eba\u304c\u904b\u55b6\u3059\u308b\u3053\u3068\u306f\u305d\u308c\u307b\u3069\u96e3\u3057\u3044\u3053\u3068\u3067\u306f\u306a\u304f\u306a\u308a\u307e\u3057\u305f\u3002<\/p>\n<p>\u3057\u304b\u3057\u30b5\u30fc\u30d0\u30fc\u30ea\u30bd\u30fc\u30b9\u306f\u6709\u9650\u3067\u3001\u7121\u5236\u9650\u306bCPU\u3084\u30c7\u30a3\u30b9\u30af\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u306f\u3067\u304d\u307e\u305b\u3093\u3002\u30b5\u30fc\u30d0\u30fc\u306e\u904b\u55b6\u4f1a\u793e\u304b\u3089\u8b66\u544a\u3092\u4e0e\u3048\u3089\u308c\u305f\u308a\u3001\u81a8\u5927\u306a\u5229\u7528\u6599\u91d1\u3092\u8acb\u6c42\u3055\u308c\u308b\u3053\u3068\u304c\u306a\u3044\u3088\u3046\u306b\u3059\u308b\u305f\u3081\u306b\u306f\u3001\u30b5\u30fc\u30d0\u30fc\u306b\u3069\u306e\u3088\u3046\u306a\u8ca0\u8377\u304c\u304b\u304b\u3063\u3066\u3044\u308b\u304b\u3092\u5e38\u306b\u628a\u63e1\u3057\u3066\u3044\u308b\u3053\u3068\u304c\u91cd\u8981\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u672c\u65e5\u7d39\u4ecb\u3059\u308b\u300csar\u300d\u30b3\u30de\u30f3\u30c9\u306f\u3001\u305d\u306e\u3088\u3046\u306a\u30b5\u30fc\u30d0\u30fc\u76e3\u8996\u306b\u5f79\u7acb\u3066\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u30e2\u30cb\u30bf\u30ea\u30f3\u30b0\u30c4\u30fc\u30eb\u306e\u4e00\u3064\u3067\u3059\u3002\u5c0e\u5165\u304c\u5bb9\u6613\u3067\u3001\u904e\u53bb\u306e\u60c5\u5831\u3092\u9061\u3063\u3066\u8abf\u3079\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u306e\u3067\u3001\u30b5\u30fc\u30d0\u30fc\u304c\u91cd\u304b\u3063\u305f\u3068\u304d\u306e\u72b6\u614b\u3092\u5f8c\u304b\u3089\u8abf\u67fb\u3059\u308b\u3053\u3068\u3082\u53ef\u80fd\u3067\u3059\u3002<\/p>\n<p>\u4ee5\u4e0b\u4f7f\u7528\u65b9\u6cd5\u3092\u8aac\u660e\u3057\u307e\u3059\u3002<\/p>\n<h2>sar\u30b3\u30de\u30f3\u30c9\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h2>\n<p>sar\u30b3\u30de\u30f3\u30c9\u306f\u300csysstat\u300d\u30d1\u30c3\u30b1\u30fc\u30b8\u306b\u542b\u307e\u308c\u3066\u3044\u3066(sar\u30d1\u30c3\u30b1\u30fc\u30b8\u3067\u306f\u3042\u308a\u307e\u305b\u3093)\u3001Linux\u3067\u306f\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3067\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre>\n# apt-get install sysstat\n# yum install sysstat\n<\/pre>\n<p>sysstat\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u3068\u3001cron\u7d4c\u7531\u3067\u60c5\u5831\u304c\u81ea\u52d5\u7684\u306b\u4fdd\u5b58\u3055\u308c\u3066\u3044\u304d\u307e\u3059\u304c\u3001sar\u30b3\u30de\u30f3\u30c9\u3092\u5229\u7528\u3057\u3066\u30ea\u30a2\u30eb\u30bf\u30a4\u30e0\u306e\u60c5\u5831\u3092\u78ba\u8a8d\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002\u4f8b\u3048\u3070\u300csar 1 10\u300d\u3068\u5165\u529b\u3059\u308b\u30681\u79d2\u9593\u9694\u306710\u56de\u60c5\u5831\u3092\u8868\u793a\u3057\u307e\u3059\u3002<\/p>\n<p><img decoding=\"async\" style=\"display:block; margin-left:auto; margin-right:auto;\" src=\"https:\/\/softantenna.com\/blog\/wp-content\/uploads\/2019\/11\/s_20191129_195637.jpg\" alt=\"S 20191129 195637\" title=\"s_20191129_195637.jpg\" border=\"0\" width=\"858\" height=\"610\" \/><\/p>\n<p>\u8868\u793a\u306e\u610f\u5473\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3067\u3059\u3002<\/p>\n<ul>\n<li>%user: \u30e6\u30fc\u30b6\u30fc\u30ec\u30d9\u30eb(\u30a2\u30d7\u30ea)\u306eCPU\u4f7f\u7528\u7387<\/li>\n<li>%nice: nice\u5024\u3092\u6307\u5b9a\u3057\u305f\u30e6\u30fc\u30b6\u30fc\u30ec\u30d9\u30eb\u306eCPU\u4f7f\u7528\u7387<\/li>\n<li>%system: \u30b7\u30b9\u30c6\u30e0\u30ec\u30d9\u30eb\u306eCPU\u4f7f\u7528\u7387<\/li>\n<li>%iowait: CPU\u304c\u30a2\u30a4\u30c9\u30eb\u6642\u306b\u672a\u51e6\u7406\u306e\u30c7\u30a3\u30b9\u30afI\/O\u8981\u6c42\u304c\u3042\u3063\u305f\u6642\u9593\u306e\u5272\u5408<\/li>\n<li>%steal: \u4eee\u60f3CPU\u304c\u4e0d\u672c\u610f\u306b\u5f85\u6a5f\u3057\u305f\u5272\u5408<\/li>\n<\/ul>\n<p>\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u6307\u5b9a\u3057\u3066\u3044\u306a\u3044\u3068\u304d\u306fCPU\u306e\u60c5\u5831\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u304c\u300csar -b\u300d\u3067\u30c7\u30a3\u30b9\u30afIO\u306e\u72b6\u614b\u304c\u300csar -n DEV\u300d\u3067\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u306e\u72b6\u614b\u304c\u78ba\u8a8d\u3067\u304d\u307e\u3059\u3002<\/p>\n<h2>cron\u306e\u8a2d\u5b9a<\/h2>\n<p>sysstat\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u3068\/etc\/cron.d\u306b\u300csysstat\u300d\u3068\u3044\u3046\u540d\u524d\u306ecron\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u304c\u4f5c\u3089\u308c\u307e\u3059\u3002\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u5185\u5bb9\u3067\u3059\u3002<\/p>\n<pre>\n*\/10 * * * * root \/usr\/lib64\/sa\/sa1 1 1\n# 0 * * * * root \/usr\/lib64\/sa\/sa1 600 6 &\n# Generate a daily summary of process accounting at 23:53\n53 23 * * * root \/usr\/lib64\/sa\/sa2 -A\n<\/pre>\n<p>10\u5206\u306b1\u56de\u300c\/usr\/lib64\/sa\/sa1\u300d\u30b3\u30de\u30f3\u30c9\u304c\u547c\u3073\u51fa\u3055\u308c\u3066\u60c5\u5831\u304c\u4fdd\u5b58\u3055\u308c\u30011\u65e5\u306b1\u56de23\u664253\u5206\u306b\u300c\/usr\/lib64\/sa\/sa2 -A\u300d\u304c\u547c\u3073\u51fa\u3055\u308c\u3066\u30b5\u30de\u30ea\u60c5\u5831\u304c\u4fdd\u5b58\u3055\u308c\u308b\u3053\u3068\u304c\u5206\u304b\u308a\u307e\u3059\u3002<\/p>\n<p>\u3053\u308c\u3089\u30b3\u30de\u30f3\u30c9\u306b\u3088\u3063\u3066\u4f5c\u3089\u308c\u308b\u30ed\u30b0\u30d5\u30a1\u30a4\u30eb\u306f\/var\/log\/sa\u4ee5\u4e0b\u306b\u4fdd\u5b58\u3055\u308c\u307e\u3059\u3002\u300csaXX\u300d(XX\u306f2\u6841\u306e\u65e5\u4ed8\u306b\u5bfe\u5fdc\u3057\u305f\u6570\u5b57)\u304csa1\u30b3\u30de\u30f3\u30c9\u3067\u4fdd\u5b58\u3055\u308c\u308b\u30d0\u30a4\u30ca\u30ea\u5f62\u5f0f\u306e\u30ed\u30b0\u30d5\u30a1\u30a4\u30eb\u3001\u300csarXX\u300d\u304csa2\u30b3\u30de\u30f3\u30c9\u3067\u4f5c\u3089\u308c\u308b\u30c6\u30ad\u30b9\u30c8\u5f62\u5f0f\u306e\u30d5\u30a1\u30a4\u30eb\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u904e\u53bb\u306e\u60c5\u5831\u3092\u53c2\u7167\u3057\u305f\u3044\u5834\u5408\u3001sar\u30b3\u30de\u30f3\u30c9\u3067\u3053\u306e\u30d0\u30a4\u30ca\u30ea\u30ed\u30b0\u30d5\u30a1\u30a4\u30eb\u3092\u53c2\u7167\u3057\u307e\u3059\u3002\u4f8b\u3048\u3070\u3001\u4eca\u6708\u306e25\u65e5\u306e\u60c5\u5831\u3092\u78ba\u8a8d\u3057\u305f\u3044\u5834\u5408\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u5b9f\u884c\u3057\u307e\u3059\u3002<\/p>\n<pre>\n# sar -f \/var\/log\/sa\/sa25\n<\/pre>\n<p>\u3053\u306e\u5834\u5408\u3082\u8868\u793a\u3059\u308b\u60c5\u5831\u3084\u3001\u6642\u9593\u306a\u3069\u3055\u307e\u3056\u307e\u306a\u30aa\u30d7\u30b7\u30e7\u30f3\u304c\u6307\u5b9a\u53ef\u80fd\u3067\u3059\u3002\u8a73\u3057\u304f\u306f\u300cman sar\u300d\u3067\u3054\u78ba\u8a8d\u304f\u3060\u3055\u3044\u3002<\/p>\n<h2>\u307e\u3068\u3081<\/h2>\n<p>sysstat\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u3068\u3001\u30b7\u30b9\u30c6\u30e0\u306e\u72b6\u614b\u3092\u904e\u53bb\u306b\u9061\u3063\u3066\u8abf\u67fb\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u8868\u793a\u3055\u308c\u308b\u60c5\u5831\u306f\u751f\u306e\u30c7\u30fc\u30bf\u3067\u76f4\u611f\u7684\u306b\u5206\u304b\u308a\u3065\u3089\u3044\u90e8\u5206\u3082\u3042\u308a\u307e\u3059\u304c\u3001Linux\u30b5\u30fc\u30d0\u30fc\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u304a\u3051\u3070\u30c8\u30e9\u30d6\u30eb\u767a\u751f\u6642\u3001\u554f\u984c\u89e3\u6c7a\u306b\u5f79\u7acb\u3066\u3066\u308b\u3053\u3068\u304c\u3067\u304d\u305d\u3046\u3067\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u8fd1\u5e74\u30a4\u30f3\u30bf\u30fc\u30cd\u30c3\u30c8\u4e0a\u306e\u30b5\u30fc\u30d0\u30fc\u3092\u500b\u4eba\u304c\u904b\u55b6\u3059\u308b\u3053\u3068\u306f\u305d\u308c\u307b\u3069\u96e3\u3057\u3044\u3053\u3068\u3067\u306f\u306a\u304f\u306a\u308a\u307e\u3057\u305f\u3002 \u3057\u304b\u3057\u30b5\u30fc\u30d0\u30fc\u30ea\u30bd\u30fc\u30b9\u306f\u6709\u9650\u3067\u3001\u7121\u5236\u9650\u306bCPU\u3084\u30c7\u30a3\u30b9\u30af\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u306f\u3067\u304d\u307e\u305b\u3093\u3002\u30b5\u30fc\u30d0\u30fc\u306e\u904b\u55b6\u4f1a\u793e\u304b\u3089\u8b66\u544a\u3092\u4e0e\u3048\u3089\u308c\u305f\u308a\u3001\u81a8 [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":75252,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"swell_btn_cv_data":"","footnotes":""},"categories":[3459],"tags":[37],"class_list":["post-75250","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-review","tag-linux"],"_links":{"self":[{"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/posts\/75250","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/comments?post=75250"}],"version-history":[{"count":0,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/posts\/75250\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/media\/75252"}],"wp:attachment":[{"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/media?parent=75250"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/categories?post=75250"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/tags?post=75250"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}