<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>CPU使用率 &#8211; スグブログ</title>
	<atom:link href="https://sugublog.org/tag/cpu%E4%BD%BF%E7%94%A8%E7%8E%87/feed/" rel="self" type="application/rss+xml" />
	<link>https://sugublog.org</link>
	<description>ブログ運営について発信中</description>
	<lastBuildDate>Sun, 02 Jun 2024 06:44:39 +0000</lastBuildDate>
	<language>ja</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://sugublog.org/wp-content/uploads/2021/07/icon_20210703-min-150x150.png</url>
	<title>CPU使用率 &#8211; スグブログ</title>
	<link>https://sugublog.org</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>【Linux】CPUの使用率を確認する方法</title>
		<link>https://sugublog.org/linux-cpu-usage-check/</link>
					<comments>https://sugublog.org/linux-cpu-usage-check/?noamp=mobile#respond</comments>
		
		<dc:creator><![CDATA[suguru]]></dc:creator>
		<pubDate>Tue, 30 Apr 2024 15:00:00 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[サーバ]]></category>
		<category><![CDATA[CPU使用率]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[確認]]></category>
		<guid isPermaLink="false">https://sugublog.org/?p=6659</guid>

					<description><![CDATA[<p><img src="https://sugublog.org/wp-content/uploads/2021/07/web-design-007-6-1024x614.jpg" class="webfeedsFeaturedVisual" /></p>LinuxでCPUの使用率を確認したい時はないでしょうか？ 確認するコマンドはいくつか知っていますが、どれを使えば良いのかわからない時はないでしょうか？ そういった時の為にLinuxでCPUの使用率の確認方法を現役エンジ [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><img src="https://sugublog.org/wp-content/uploads/2021/07/web-design-007-6-1024x614.jpg" class="webfeedsFeaturedVisual" /></p>
<p>Linuxで<strong><span class="swl-inline-color has-swl-deep-01-color">CPUの使用率</span></strong>を確認したい時はないでしょうか？</p>



<p>確認するコマンドはいくつか知っていますが、どれを使えば良いのかわからない時はないでしょうか？</p>



<p>そういった時の為に<strong><span class="swl-inline-color has-swl-deep-01-color">LinuxでCPUの使用率の確認方法</span></strong>を現役エンジニアの筆者がまとめます。</p>


<div class="p-blogParts post_content" data-partsID="5908">
<p>筆者はWindowsサーバーやLinuxサーバーの運用構築を11年間以上おこなってきました。その経験を元に知識を公開していきます！</p>
</div>


<p>この記事を読めばLinuxでCPU使用率を確認したい時、どのコマンドを使用すればよいのか。それぞれのコマンドの使用用途がわかります。</p>



<script async="" src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<ins class="adsbygoogle ads" style="display:block; text-align:center;" data-ad-layout="in-article" data-ad-format="fluid" data-ad-client="ca-pub-9330904718533231" data-ad-slot="6086594686"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>



<h2 class="wp-block-heading">LinuxでCPUの使用率を確認する方法</h2>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img decoding="async" width="1024" height="576" src="https://sugublog.org/wp-content/uploads/2021/09/randam_0915-4-1024x576.jpg" alt="CPU使用率" class="wp-image-4169" srcset="https://sugublog.org/wp-content/uploads/2021/09/randam_0915-4-1024x576.jpg 1024w, https://sugublog.org/wp-content/uploads/2021/09/randam_0915-4-300x169.jpg 300w, https://sugublog.org/wp-content/uploads/2021/09/randam_0915-4-768x432.jpg 768w, https://sugublog.org/wp-content/uploads/2021/09/randam_0915-4.jpg 1200w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>
</div>


<p>Linuxで<strong><span class="swl-inline-color has-swl-deep-01-color">CPUの使用率を確認するコマンド</span></strong>は以下の通りです。</p>



<div class="swell-block-capbox cap_box is-style-onborder_ttl"><div class="cap_box_ttl"><span>LinuxでCPUの使用率を確認するコマンド2選</span></div><div class="cap_box_content">
<ul class="wp-block-list">
<li>vmstatコマンド</li>



<li>topコマンド</li>
</ul>
</div></div>



<p>それぞれの特徴と確認のやり方を見ていきます。</p>



<h2 class="wp-block-heading">CPUの使用率を確認するvmstatコマンド</h2>



<h3 class="wp-block-heading">CPU使用率を確認するvmstatコマンドの基礎知識</h3>



<p>まずは<strong><span class="swl-inline-color has-swl-deep-01-color">vmstatコマンド</span></strong>です。</p>



<div class="hcb_wrap"><pre class="prism line-numbers lang-bash" data-lang="Bash"><code>vmstat 取得する間隔（秒数） 取得する回数</code></pre></div>



<p>間隔と回数は省略できます。省略した場合は1が選択されて現在の情報が一回だけ表示されます。</p>



<div class="hcb_wrap"><pre class="prism line-numbers lang-bash" data-file="vmstatのコマンド実行例" data-lang="Bash"><code>[root@localhost ~]# vmstat
procs -----------memory---------- ---swap-- -----io---- -system-- ------cpu-----
 r  b   swpd   free   buff  cache   si   so    bi    bo   in   cs us sy id wa st
 2  0      0 746040   3176 131132    0    0    94     8   42   78  0  0 99  0  0
[root@localhost ~]#</code></pre></div>



<p class="is-style-big_icon_point">CPUの他にもメモリやネットワークなどの情報も表示されます。</p>



<p>CPU関連の表示の意味をまとめます。</p>



<figure class="wp-block-table"><table class="has-fixed-layout"><thead><tr><th>表示される文字</th><th>意味</th></tr></thead><tbody><tr><td>us</td><td>ユーザーが使用した時間</td></tr><tr><td>sy</td><td>システムのカーネルが使用した時間</td></tr><tr><td>id</td><td>アイドルタイム</td></tr><tr><td>wa</td><td>I/Oの待ち時間</td></tr><tr><td>st</td><td>仮想マシンが使用した時間</td></tr></tbody></table><figcaption class="wp-element-caption">LinuxでvmstatコマンドのCPU欄の意味一覧</figcaption></figure>



<p class="is-style-icon_announce">アイドルタイムとは稼働せずに待機している状態の事。ITでは処理するタスクがなく遊休している状態の事。</p>



<p><span class="swl-marker mark_orange"><strong><span class="swl-inline-color has-swl-deep-01-color">CPU使用率</span></strong>は(100-アイドルタイム)で計算できます。</span></p>


<div class="swell-block-balloon"><div class="c-balloon -bln-right" data-col="blue"><div class="c-balloon__icon -square"><img decoding="async" src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" data-src="https://sugublog.org/wp-content/uploads/2021/02/mine_white_001.png" alt="" class="lazyload c-balloon__iconImg" width="80px" height="80px"><noscript><img decoding="async" src="https://sugublog.org/wp-content/uploads/2021/02/mine_white_001.png" alt="" class="c-balloon__iconImg" width="80px" height="80px"></noscript><span class="c-balloon__iconName">管理人</span></div><div class="c-balloon__body -speaking -border-on"><div class="c-balloon__text">
<p>ここではアイドルタイムが99（遊休しているCPUが99％）なのでCPU使用率は1%です。</p>
<span class="c-balloon__shapes"><span class="c-balloon__before"></span><span class="c-balloon__after"></span></span></div></div></div></div>


<h3 class="wp-block-heading">CPU使用率を間隔と回数を指定して実行してみる</h3>



<p>例として2秒間隔で10回取得してみます。</p>



<div class="hcb_wrap"><pre class="prism line-numbers lang-plain"><code>[root@localhost ~]# vmstat 2 10
procs -----------memory---------- ---swap-- -----io---- -system-- ------cpu-----
 r  b   swpd   free   buff  cache   si   so    bi    bo   in   cs us sy id wa st
 2  0      0 744968   3176 131132    0    0    55     4   28   51  0  0 99  0  0
 0  0      0 744944   3176 131132    0    0     0     0   17   23  0  0 100  0  0
 0  0      0 744944   3176 131132    0    0     0     0    8    9  0  0 100  0  0
 0  0      0 744944   3176 131132    0    0     0     0   12   17  0  0 100  0  0
 0  0      0 744944   3176 131132    0    0     0     0   12   15  0  0 100  0  0
 0  0      0 744944   3176 131132    0    0     0     0    9   12  0  0 100  0  0
 0  0      0 744944   3176 131132    0    0     0     0   13   16  0  0 100  0  0
 0  0      0 744944   3176 131132    0    0     0     0    8   13  0  0 100  0  0
 0  0      0 744944   3176 131132    0    0     0     0   12   14  0  0 100  0  0
 0  0      0 744944   3176 131132    0    0     0     0   13   20  0  0 99  0  0
[root@localhost ~]#</code></pre></div>



<p>2秒間隔で10回CPU使用率を確認できました。</p>


<div class="swell-block-balloon"><div class="c-balloon -bln-left" data-col="blue"><div class="c-balloon__icon -square"><img decoding="async" src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" data-src="https://sugublog.org/wp-content/uploads/2021/02/cropped-dog003-150x150.png" alt="" class="lazyload c-balloon__iconImg" width="80px" height="80px"><noscript><img decoding="async" src="https://sugublog.org/wp-content/uploads/2021/02/cropped-dog003-150x150.png" alt="" class="c-balloon__iconImg" width="80px" height="80px"></noscript><span class="c-balloon__iconName">LinuxでCPU使用率を確認したいエンジニア</span></div><div class="c-balloon__body -thinking -border-on"><div class="c-balloon__text">
<p>ここではCPUはほぼ休んでますね。。</p>
<span class="c-balloon__shapes"><span class="c-balloon__before"></span><span class="c-balloon__after"></span></span></div></div></div></div>


<h3 class="wp-block-heading">LinuxでCPUに負荷をかけ検証してみる</h3>



<p>LinuxでCPUに負荷をかけるには、bcコマンドで計算をさせていきます。かかった時間はtimeコマンドで確認しましょう！</p>



<div class="hcb_wrap"><pre class="prism line-numbers lang-plain"><code>[root@localhost ~]# time echo &quot;99999^10^5&quot; | bc &gt; /dev/null

real    0m26.544s
user    0m26.512s
sys     0m0.010s</code></pre></div>



<p>計算は表示させないので、リダイレクトでnullへ向けましょう！</p>



<p>別のteratermでログインして先程と同じ様にvmstatでCPUを確認します。</p>



<div class="hcb_wrap"><pre class="prism line-numbers lang-plain"><code>[root@localhost ~]# vmstat 3
procs -----------memory---------- ---swap-- -----io---- -system-- ------cpu-----
 r  b   swpd   free   buff  cache   si   so    bi    bo   in   cs us sy id wa st
 3  0  64256 903136      0  34316    1  152   127   221   72   63  3  0 97  0  0
 1  0  64256 902764      0  34316    0    0     0     0 1023   17 100  0  0  0  0
 1  0  64256 902516      0  34316    0    0     0     0 1036   16 100  0  0  0  0
 1  0  64256 902640      0  34316    0    0     0     0 1040   18 100  0  0  0  0
 1  0  64256 902268      0  34316    0    0     0     0 1041   16 100  0  0  0  0
 1  0  64256 901896      0  34316    0    0     0     0 1033   15 100  0  0  0  0
 1  0  64256 901896      0  34316    0    0     0     0 1039   17 100  0  0  0  0
 1  0  64256 901772      0  34316    0    0     0     0 1056   17 100  0  0  0  0
 0  0  64256 903904      0  34316    0    0     0     0  203   22 18  0 82  0  0
 0  0  64256 903904      0  34316    0    0     0     0    8   11  0  0 100  0  0
 0  0  64256 903904      0  34316    0    0     0     0   13   18  0  0 100  0  0</code></pre></div>



<p>ユーザーのCPU使用率が100となっており、処理が終わったらCPU使用率が0となりアイドルタイムが100となっています。</p>



<h2 class="wp-block-heading">CPUの使用率を確認するtopコマンド</h2>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img decoding="async" width="1024" height="617" src="https://sugublog.org/wp-content/uploads/2021/07/PC007-4-1024x617.jpg" alt="PC" class="wp-image-3713" srcset="https://sugublog.org/wp-content/uploads/2021/07/PC007-4-1024x617.jpg 1024w, https://sugublog.org/wp-content/uploads/2021/07/PC007-4-300x181.jpg 300w, https://sugublog.org/wp-content/uploads/2021/07/PC007-4-768x463.jpg 768w, https://sugublog.org/wp-content/uploads/2021/07/PC007-4.jpg 1200w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>
</div>


<h3 class="wp-block-heading">CPUの使用率を確認するtopコマンドの基礎知識</h3>



<p>次に<strong><span class="swl-inline-color has-swl-deep-01-color">topコマンド</span></strong>です。</p>



<div class="hcb_wrap"><pre class="prism line-numbers lang-plain"><code>top</code></pre></div>



<p>Windowのタスクマネージャーのように、<span class="swl-marker mark_orange"><strong><span class="swl-inline-color has-swl-deep-01-color">CPU使用率が高い順</span></strong>に表示してくれます。</span></p>



<div class="hcb_wrap"><pre class="prism line-numbers lang-plain"><code>top - 22:31:45 up 51 min,  1 user,  load average: 0.00, 0.01, 0.03
Tasks: 106 total,   2 running,  99 sleeping,   5 stopped,   0 zombie
%Cpu(s):  0.7 us,  0.3 sy,  0.0 ni, 99.0 id,  0.0 wa,  0.0 hi,  0.0 si,  0.0 st
KiB Mem :  1014540 total,   744448 free,   135784 used,   134308 buff/cache
KiB Swap:   839676 total,   839676 free,        0 used.   736708 avail Mem

  PID USER      PR  NI    VIRT    RES    SHR S %CPU %MEM     TIME+ COMMAND
 1277 root      20   0  162116   2260   1560 R  0.7  0.2   0:00.59 top
    1 root      20   0  125364   3892   2584 S  0.0  0.4   0:01.34 systemd
    2 root      20   0       0      0      0 S  0.0  0.0   0:00.00 kthreadd
    4 root       0 -20       0      0      0 S  0.0  0.0   0:00.00 kworker/0:0H
    5 root      20   0       0      0      0 S  0.0  0.0   0:00.01 kworker/u2:0
    6 root      20   0       0      0      0 S  0.0  0.0   0:00.08 ksoftirqd/0</code></pre></div>



<p>情報を集約して表示してくれる上の領域と、CPU使用率順にプロセスを並び替えてる下の領域に分かれています。</p>



<p>3行目のCPUの欄です。</p>



<figure class="wp-block-table"><table class="has-fixed-layout"><thead><tr><th>表示される文字</th><th>意味</th></tr></thead><tbody><tr><td>us</td><td>ユーザーが使用した時間</td></tr><tr><td>sy</td><td>システムのカーネルが使用した時間</td></tr><tr><td>id</td><td>アイドルタイム</td></tr><tr><td>wa</td><td>I/Oの待ち時間</td></tr><tr><td>st</td><td>仮想マシンが使用した時間</td></tr></tbody></table><figcaption class="wp-element-caption">LinuxでtopコマンドのCPU欄の意味一覧</figcaption></figure>


<div class="swell-block-balloon"><div class="c-balloon -bln-right" data-col="blue"><div class="c-balloon__icon -square"><img decoding="async" src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" data-src="https://sugublog.org/wp-content/uploads/2021/02/mine_white_001.png" alt="" class="lazyload c-balloon__iconImg" width="80px" height="80px"><noscript><img decoding="async" src="https://sugublog.org/wp-content/uploads/2021/02/mine_white_001.png" alt="" class="c-balloon__iconImg" width="80px" height="80px"></noscript><span class="c-balloon__iconName">管理人</span></div><div class="c-balloon__body -speaking -border-on"><div class="c-balloon__text">
<p>ユーザーが0.7%システムが0.3%使用しており、使われていない（アイドルタイム）のが99%になっていますね。</p>
<span class="c-balloon__shapes"><span class="c-balloon__before"></span><span class="c-balloon__after"></span></span></div></div></div></div>


<h3 class="wp-block-heading">CPU使用率を間隔を指定して更新してみる</h3>



<p><span class="swl-bg-color has-swl-deep-02-background-color">更新の間隔を指定</span>する事も可能です。</p>



<div class="hcb_wrap"><pre class="prism line-numbers lang-bash" data-lang="Bash"><code>top -d 更新間隔（秒数）</code></pre></div>



<p>これで更新間隔が3秒になります。</p>



<h3 class="wp-block-heading">CPU使用率が高いプロセスを終了させる</h3>



<p>サーバーが不安定になり<strong><span class="swl-inline-color has-swl-deep-02-color">CPU使用率が高いプロセスを終了する</span></strong>こともあるでしょう！</p>



<p>そんな時はtopコマンドが楽です。</p>



<div class="hcb_wrap"><pre class="prism line-numbers lang-bash" data-lang="Bash"><code>top - 22:31:45 up 51 min,  1 user,  load average: 0.00, 0.01, 0.03
Tasks: 106 total,   2 running,  99 sleeping,   5 stopped,   0 zombie
%Cpu(s):  99 us,  0.3 sy,  0.0 ni, 0.7 id,  0.0 wa,  0.0 hi,  0.0 si,  0.0 st
KiB Mem :  1014540 total,   744448 free,   135784 used,   134308 buff/cache
KiB Swap:   839676 total,   839676 free,        0 used.   736708 avail Mem

  PID USER      PR  NI    VIRT    RES    SHR S %CPU %MEM     TIME+ COMMAND
 1277 root      20   0  162116   2260   1560 R  99  0.2   0:00.59 top
    1 root      20   0  125364   3892   2584 S  0.0  0.4   0:01.34 systemd
    2 root      20   0       0      0      0 S  0.0  0.0   0:00.00 kthreadd</code></pre></div>



<p>CPU使用率が高い順に表示されます。不要なプロセスを終了させればOKです。</p>



<p>プロセスを強制終了させるコマンドは以下です。</p>



<div class="hcb_wrap"><pre class="prism line-numbers lang-plain"><code>kill -9 プロセスID</code></pre></div>



<p class="is-style-icon_book">プロセスを終了させるkillコマンドについては以下の記事で詳しく説明しています。</p>


<div class="swell-block-postLink">			<div class="p-blogCard -internal" data-type="type1" data-onclick="clickLink">
				<div class="p-blogCard__inner">
					<span class="p-blogCard__caption">あわせて読みたい</span>
					<div class="p-blogCard__thumb c-postThumb"><figure class="c-postThumb__figure"><img decoding="async" src="https://sugublog.org/wp-content/uploads/2021/06/business1-3-min-300x232.jpg" alt="" class="c-postThumb__img u-obf-cover" width="320" height="180"></figure></div>					<div class="p-blogCard__body">
						<a class="p-blogCard__title" href="https://sugublog.org/linux-process-stop/">【Linux】CentOSでプロセス停止コマンドkillについてご教示</a>
						<span class="p-blogCard__excerpt">Linuxサーバーでプロセス停止のkillコマンドについてです。 Linuxサーバーでプロセスが邪魔をして停止したいといった事はないでしょうか？ またプロセスを終了させてす&#8230;</span>					</div>
				</div>
			</div>
		</div>


<h3 class="wp-block-heading">CPUに負荷をかけてtopコマンドで確認してみる</h3>



<p>先程と同じ様に高負荷の計算をtimeとbcコマンドで行って、topコマンドでも確認してみます。</p>



<div class="hcb_wrap"><pre class="prism line-numbers lang-plain"><code>time echo &quot;99999^10^5&quot; | bc &gt; /dev/null</code></pre></div>



<p>もうひとつのteratermでリモートしてtopコマンドを使用します。</p>



<div class="hcb_wrap"><pre class="prism line-numbers lang-plain"><code>top - 18:24:54 up  1:01,  2 users,  load average: 0.22, 0.06, 0.06
Tasks: 104 total,   2 running, 102 sleeping,   0 stopped,   0 zombie
%Cpu(s): 99.7 us,  0.3 sy,  0.0 ni,  0.0 id,  0.0 wa,  0.0 hi,  0.0 si,  0.0 st
KiB Mem :  1014540 total,   901276 free,    78240 used,    35024 buff/cache
KiB Swap:   839676 total,   775676 free,    64000 used.   846876 avail Mem

  PID USER      PR  NI    VIRT    RES    SHR S %CPU %MEM     TIME+ COMMAND
 1398 root      20   0   14832   2380    644 R 99.7  0.2   0:14.33 bc
    1 root      20   0  125364   2332   1532 S  0.0  0.2   0:01.40 systemd
    2 root      20   0       0      0      0 S  0.0  0.0   0:00.00 kthreadd</code></pre></div>



<p>CPUが高負荷となっており、bcのプロセスがCPU使用率99.7%で表示されている事が確認できます。</p>



<h2 class="wp-block-heading">LinuxでCPU以外でリソースを確認するコマンドについて</h2>



<p>Linuxのメモリ使用率確認コマンドについて</p>


<div class="swell-block-postLink">			<div class="p-blogCard -internal" data-type="type1" data-onclick="clickLink">
				<div class="p-blogCard__inner">
					<span class="p-blogCard__caption">あわせて読みたい</span>
					<div class="p-blogCard__thumb c-postThumb"><figure class="c-postThumb__figure"><img decoding="async" src="https://sugublog.org/wp-content/uploads/2021/11/DB_1103-2-300x169.jpg" alt="" class="c-postThumb__img u-obf-cover" width="320" height="180"></figure></div>					<div class="p-blogCard__body">
						<a class="p-blogCard__title" href="https://sugublog.org/linux-memory-usage-check/">【Linux】メモリの使用率や使用量を確認する方法をご説明</a>
						<span class="p-blogCard__excerpt">Linuxでメモリの使用率や使用量などを確認したい場合どうすれば良いのでしょうか？ 複数確認のやり方はありますが、どのように使い分ければ良いかわからないといった事&#8230;</span>					</div>
				</div>
			</div>
		</div>


<p>Linuxの物理ディスク確認コマンドについて</p>


<div class="swell-block-postLink">			<div class="p-blogCard -internal" data-type="type1" data-onclick="clickLink">
				<div class="p-blogCard__inner">
					<span class="p-blogCard__caption">あわせて読みたい</span>
					<div class="p-blogCard__thumb c-postThumb"><figure class="c-postThumb__figure"><img decoding="async" src="https://sugublog.org/wp-content/uploads/2021/11/HDD_1107-1-1-300x169.jpg" alt="" class="c-postThumb__img u-obf-cover" width="320" height="180"></figure></div>					<div class="p-blogCard__body">
						<a class="p-blogCard__title" href="https://sugublog.org/linux-physical-disk-capacity-check/">【Linux】物理ディスクの容量確認する方法！容量拡張のリンクあり</a>
						<span class="p-blogCard__excerpt">Linuxで物理ディスクの容量確認したいです。 そういった疑問に現役エンジニアの筆者が答えます。 Linuxの物理ディスクの概念も少しややこしいですが、この記事を読めば&#8230;</span>					</div>
				</div>
			</div>
		</div>


<p>Linuxのファイルシステムの容量確認コマンドについて</p>


<div class="swell-block-postLink">			<div class="p-blogCard -internal" data-type="type1" data-onclick="clickLink">
				<div class="p-blogCard__inner">
					<span class="p-blogCard__caption">あわせて読みたい</span>
					<div class="p-blogCard__thumb c-postThumb"><figure class="c-postThumb__figure"><img decoding="async" src="https://sugublog.org/wp-content/uploads/2021/12/PC教室20211216-1-300x277.jpg" alt="" class="c-postThumb__img u-obf-cover" width="320" height="180"></figure></div>					<div class="p-blogCard__body">
						<a class="p-blogCard__title" href="https://sugublog.org/linux-du-command/">【Linux基礎】dfコマンドの使い方！ファイルシステム別の容量確認コマンド</a>
						<span class="p-blogCard__excerpt">Linuxサーバーでディスクの容量を確認する、dfコマンドについて学んで行きます。 サーバーエンジニアはディスクの容量を気にしなければいけません。そんな時に役立つdf&#8230;</span>					</div>
				</div>
			</div>
		</div>


<p>Linuxのファイルやディレクトリの容量確認コマンドについて</p>


<div class="swell-block-postLink">			<div class="p-blogCard -internal" data-type="type1" data-onclick="clickLink">
				<div class="p-blogCard__inner">
					<span class="p-blogCard__caption">あわせて読みたい</span>
					<div class="p-blogCard__thumb c-postThumb"><figure class="c-postThumb__figure"><img decoding="async" src="https://sugublog.org/wp-content/uploads/2021/07/analytics-1-300x200.jpg" alt="" class="c-postThumb__img u-obf-cover" width="320" height="180"></figure></div>					<div class="p-blogCard__body">
						<a class="p-blogCard__title" href="https://sugublog.org/linux-du-command-2/">【Linux基礎】duコマンドでファイルの容量を確認する方法</a>
						<span class="p-blogCard__excerpt">Linuxサーバーでファイルやディレクトリの容量を確認するコマンドにduコマンドがあります。 そのduコマンドの使い方やオプションについてまとめます。 Linuxでduコマン&#8230;</span>					</div>
				</div>
			</div>
		</div>


<h2 class="wp-block-heading">まとめ：LinuxでCPUの使用率を確認する方法</h2>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img decoding="async" width="1024" height="576" src="https://sugublog.org/wp-content/uploads/2021/11/programing_1122-5-1024x576.jpg" alt="CPU使用率" class="wp-image-4562" srcset="https://sugublog.org/wp-content/uploads/2021/11/programing_1122-5-1024x576.jpg 1024w, https://sugublog.org/wp-content/uploads/2021/11/programing_1122-5-300x169.jpg 300w, https://sugublog.org/wp-content/uploads/2021/11/programing_1122-5-768x432.jpg 768w, https://sugublog.org/wp-content/uploads/2021/11/programing_1122-5.jpg 1200w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>
</div>


<p>Linuxで<strong><span class="swl-inline-color has-swl-deep-01-color">CPUの使用率を確認するコマンド</span></strong>は以下の通りです。</p>



<div class="swell-block-capbox cap_box is-style-onborder_ttl"><div class="cap_box_ttl"><span>LinuxでCPUの使用率を確認するコマンド2選</span></div><div class="cap_box_content">
<ul class="wp-block-list">
<li>vmstatコマンド</li>



<li>topコマンド</li>
</ul>
</div></div>



<h3 class="wp-block-heading">vmstatコマンドの特徴</h3>



<p>CPUの他にもメモリやネットワークなどの情報も表示されて、<span class="swl-bg-color has-swl-deep-02-background-color">総合的なリソースが確認</span>できます。</p>



<p>間隔と回数を指定して情報を表示できる為、<span class="swl-marker mark_blue">リソースの推移などを確認する時に便利です。</span></p>



<h3 class="wp-block-heading">topコマンド</h3>



<p><span class="swl-marker mark_green"><strong><span class="swl-inline-color has-swl-deep-03-color">CPU使用率が高い順</span></strong>にプロセスを並び替えてくれる為、<span class="swl-bg-color has-swl-deep-03-background-color">負荷の高いプロセスを確認したり終了させる時</span>に便利です。</span></p>
]]></content:encoded>
					
					<wfw:commentRss>https://sugublog.org/linux-cpu-usage-check/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
