If you have a Linux server running at your office or at a data center for which you are responsible, you want to maintain an uptime of as close to a hundred percent.あなたのオフィスの場合はLinuxサーバで稼動しているか、担当しているデータセンターでは、次のように100パーセントに近いのアップタイムを維持するためにします。 In such a case you want to make sure you keep an eye on how the system is running.このような場合にはどのようにシステムを実行している場合を見守ることを確認したい。 To be precise you want to monitor all the system resources that contribute to the system running fine which then results in a high uptime.あなたは、このシステムの高い稼働時間には罰金を実行して結果に寄与するすべてのシステムリソースを監視する正確にしてください。 Memory, CPU, disk usage… are some of the things you want to observe.メモリ、 CPU 、ディスクの使用量...いくつかを観察することがあります。 We would usually use a combination of the tools that come with a Linux or UNIX installation, such as “free”, “top”, “vmstat”… I’ll introduce you to a tool that gives you just about all the info that the other tools combined give you, all under one roof - Dstat.私たちは通常、 " vmstat " ...私は、ほぼすべての情報を提供するツールをご紹介しますが、 LinuxやUNIXのインストールは、このような"無料"となるのツールを組み合わせて、 " "トップを使用するとは、一つ屋根の下で他のツールを与える組み合わせることで、すべての-D stat。 The developer of this command line tool, Dag Wieers, calls it “a versatile replacement for vmstat, iostat, netstat and ifstat”.このコマンドラインツール、ダーWieersの開発者は、 vmstat 、 iostat 、 netstatとifstatのために"は多彩な交換"を呼び出します。 He adds that “Dstat overcomes some of their limitations and adds some extra features…” To me Dstat is the mother of all command line system monitoring tools.彼は、 " Dstat一部の限界を克服、いくつかの特別な機能が追加されます追加されて... "私にとってDstatすべてのコマンドラインのシステム監視ツールの母。 It’s simple to install, easy to use, can be tweaked with ease, and it generates reports that you can plot as a graph to impress your boss.これを使用して、簡単にインストールするには、簡単に調整できますが、シンプルで、それによると、あなたの上司を感心させるには、グラフとしてプロットすることができますが生成されます。
Installing DstatインストールDstat
Start by downloading the Dstat installer. Dstatインストーラをダウンロードして起動します。 Point your web browser to the Dstat project’s homepage -ポイントをお客様のウェブブラウザはDstatプロジェクトのホームページに- http://dag.wieers.com/home-made/dstat/ . 。 Scroll down to the section of the page where the downloads are listed.下にスクロールして、ページのダウンロードのセクションに記載されている。 Pick the flavor of Linux on which you want to install the application and click on the download link. Linuxの味を選択する場合は、ダウンロードリンクをクリックしてアプリケーションをインストールしたい。 Now download the latest version of Dstat for the version of the Linux distribution you are running.今すぐ実行している場合は、 LinuxディストリビューションのバージョンにDstatの最新バージョンをダウンロードしてください。 I’ll show you how to do it for a Red Hat Enterprise Linux version 4 machine:私はRed Hat Enterprise Linuxのバージョン4機がやってお見せしましょう:
# wget http://dag.wieers.com/rpm/packages/dstat/dstat-0.6.6-1.el4.rf.noarch.rpm # wgetをhttp://dag.wieers.com/rpm/packages/dstat/dstat-0.6.6-1.el4.rf.noarch.rpm
Now install Dstat:今すぐインストールDstat :
# rpm -Uvh dstat-0.6.6-1.el4.rf.noarch.rpm #はrpm - Uvh dstat - 0.6.6 - 1.el4.rf.noarch.rpm
If the installation went though without errors, that’s it, you have Dstat installed and ready for use.インストールはエラーもなく、これを行った場合、 Dstatをインストールして使用できる状態にしている。 If there were some dependencies that came up during the installation just install the required packages and try again.がある場合は、インストール中には、必要なパッケージをインストールし、再度試してくださいしたいくつかの依存関係だった。 I don’t think that Dstat has too many dependencies, so you should not face any problems.私は、 Dstatあまりにも多くの依存関係しているので、何か問題に直面てはならないとは思わない。
Using Dstat Dstatを使用する
With Dstat installed on your system you should be good to go.とDstatもう行ってもいいがシステムにインストールする必要があります。 Begin by launching the command from a terminal:ターミナルからコマンドを起動することから始めましょう:
# dstat # dstat
The output would be something like the following.出力は、次のようなものになるだろう。 Hit the key combination of ctrl+c to exit. Ctrlを押しながらのキーの組み合わせ55731 + Cを終了します。
# dstat # dstat
—-total-cpu-usage—- -disk/total -net/total- —paging– —system– -合計のC PU使用率- -d isk/total-- n et/total--ページングシステム
usr sys idl wai hiq siq|_read write|_recv _send|__in_ _out_|_int_ _csw_ USR社システムIDLでワイhiq siq |書く| _recv _send | __in_ _out_ | _read _int_ _csw_
7 1 91 1 0 0| 0 0 | 0 0 | 0 0 | 0 0 7月1日91 1 0 0 | 0 0 | 0 0 | 0 0 | 0 0
1 0 99 0 0 0| 0 0 | 0 0 | 0 0 |1051 1945 1 0 99 0 0 0 | 0 0 | 0 0 | 0 0 | 1051 1945
0 0 100 0 0 0| 0 12k|2269B 11.2k| 0 0 |1031 1923 0 0 100 0 0 0 | 0 12k | 2269B 11.2k | 0 0 | 1031 1923
1 0 99 0 0 0| 0 40k| 0 0 | 0 0 |1078 2235 1 0 99 0 0 0 | 0 40k | 0 0 | 0 0 | 1078 2235
0 0 100 0 0 0| 0 16k|6027B 21.5k| 0 0 |1008 2219 0 0 100 0 0 0 | 0 16Kビット| 6027B 21.5k | 0 0 | 1008 2219
There are a number of options available for Dstat.このオプションをDstatがご利用いただけますが多数あります。 As I mentioned earlier Dstat is quite easy to tweak.私としてはかなり以前Dstat微調整が簡単だということを申し上げました。 So if you want to limit the data reading to the CPU, disk, and network, run the following command:だから場合は、データは、 CPU 、ディスク、およびネットワークでは、以下のコマンドを実行して読書を制限するために思う:
# dstat -CDN # dstat -なCDN
-disk/total -net/total- —paging– —system– -disk/total - -net/total- -ページングシステム
_read write|_recv _send|__in_ _out_|_int_ _csw_書き込み| _recv _send | __in_ _out_ | _read _int_ _csw_
0 0 | 0 0 | 0 0 | 0 0 0 0 | 0 0 | 0 0 | 0 0
0 12k|2295B 9603B| 0 0 |1053 1957 0 12k | 2295B 9603B | 0 0 | 1053 1957
0 0 | 594B 0 | 0 0 |1002 1893 0 0 | 594B 0 | 0 0 | 1002 1893
0 960k| 292B 3346B| 0 0 |1072 2012 0 960k | 292B 3346B | 0 0 | 1072 2012
0 4096B| 64B 0 | 0 0 |1031 1939 0 4096B | 64B 0 | 0 0 | 1031 1939
You can find more options in the application’s help document which you can access by entering the following:あなたは、アプリケーションのヘルプドキュメントで次のように入力してアクセスすることができますより多くの選択肢を見つけることができます:
# dstat -h # dstat - hで
Play with the options a little so you get comfortable with them.このオプションでの再生になるので、彼らと快適な小さな。 The default interval between data reads is two seconds.データの間のデフォルトの間隔を読み取る2秒です。 You can change that interval if you need to.する必要がある場合はその間隔を変更することができます。 To increase the interval to ten seconds enter the following: 10秒の間隔を大きくするには、以下を入力してください:
# dstat 10 # dstat 10
Another useful feature is to get aggregated updates for each entry.もう1つの便利な機能を集約、各エントリの更新プログラムを入手することです。 So you can have Dstat give you an update every ten seconds in a new line, but as the data changes your line itself gets updated every second.としては、データ自体は1秒ごとに更新されるお客様の行を変更だから、 Dstat場合は、新しい行に、 10秒ごとに更新プログラムを与えるが、することができます。
You might optionally want Dstat to give you five updates with a frequency of three seconds. Dstatオプションを3秒の頻度で5つの更新プログラムを与えることをお勧めします。 Here’s how you would go about doing that:ここにどうやってやろうとするとのこと:
# dstat 3 5 # dstat 3月5日
—-total-cpu-usage—- -disk/total -net/total- —paging– —system– -合計のC PU使用率- -d isk/total-- n et/total--ページングシステム
usr sys idl wai hiq siq|_read write|_recv _send|__in_ _out_|_int_ _csw_ USR社システムIDLでワイhiq siq |書く| _recv _send | __in_ _out_ | _read _int_ _csw_
3 1 95 2 0 0| 0 0 | 0 0 | 0 0 | 0 0 3 1 95 2 0 0 | 0 0 | 0 0 | 0 0 | 0 0
2 11 87 1 0 0| 0 180k|2581B 3239B| 0 0 |1136 697 2 11 87 1 0 0 | 0 180k | 2581B 3239B | 0 0 | 1136 697
7 8 85 0 0 0| 0 0 | 115k 106k| 0 0 |1603 3985 7 8 85 0 0 0 | 0 0 | 115k 106k | 0 0 | 1603 3985
2 1 98 0 0 0| 0 0 |77.5k 170k| 0 0 |1744 3856 2月1日98 0 0 0 | 0 0 | 77.5k 170k | 0 0 | 1744 3856
1 0 100 0 0 0| 0 0 |3451B 9993B| 0 0 |1045 149 1 0 100 0 0 0 | 0 0 | 3451B 9993B | 0 0 | 1045 149
2 1 94 4 0 0| 0 276k|20.4k 31.1k| 0 0 |1219 804 2 1 94 4 0 0 | 0 276k | 20.4k 31.1k | 0 0 | 1219 804
The feature that I find most useful is the output.この機能は、私が最も有用な検索が出力されています。 Dstat allows you to have the output of a session written into a comma separated file which can later be imported into a spreadsheet application such as Microsoft Excel and the data can be plotted into a graph. Dstat場合は、セッションの保存をMicrosoft Excelなどのデータをグラフにプロットすることができますなどのスプレッドシートアプリケーションにインポートすることができるカンマ区切りの出力をファイルに記述することができます。 Here is how it can be used.ここではどのように使用することができます。
# dstat –output /tmp/dstat_data.csv -CDN # dstat出力を/ tmp / dstat_data.csv -なCDN
Let the above command run while you run your applications or do your testing on this machine.一方、お客様のアプリケーションを実行するか、このマシンでのテストを行うには、上記のコマンドを実行してみましょう。 Hit the key combination of ctrl+c when you are done. Ctrlを押しながらのキーの組み合わせ55731 + Cをしたときに行われます。 Open the file dstat_data.csv with a spreadsheet application such as Microsoft Excel or Open Office.オープンは 、 Microsoft Excelやオープンオフィスなどのスプレッドシートアプリケーションでdstat_data.csvファイルです。 You can then select the columns you want plotted into a graph and let your spreadsheet application do the magic.次にあなたがグラフにプロットすると、スプレッドシートアプリケーションでは、魔法やらせるの列を選択することができます。
Get a Report by Mailメールでレポートを取得
There may be cases wherein you want to observe how your server is performing over a period of time.そこをどのようにお客様のサーバーが一定の期間以上の効果を上げている例を観察することがあります。 You can setup a background process in Linux that will give you a reading with a certain interval, generate a report, and mail out the file to you. Linuxで設定することができますがバックグラウンドプロセスでは、一定の間隔で読んで、レポートを生成するだろうし、メールをあなたには、ファイルを。 This can be especially useful during a stress-test.これは特にストレステスト中に有用であることができます。 Here’s how you could do that.ここにどうしてそんなことができるのだ。 The following script will run Dstat for three hours, reading the data every 30 seconds, and will mail out the report to me@myemailid.com.次のスクリプトを3時間、 30秒ごとに、報告書が郵送されますme@myemailid.comには、データの読み取りDstat実行されます。
#!/bin/bash # ! / binに/ bashの
dstat –output /tmp/dstat_data_mail.csv -CDN 30 360 dstat出力を/ tmp / dstat_data_mail.csv -なCDN 30 360
mutt -a /tmp/dstat_data_mail.csv -s “Dstat Report for 3 hour run” me@myemailid.com < /dev/null muttのは、 / tmpに/ dstat_data_mail.csv - " 3時間を実行する" me@myemailid.com <は/ dev / nullのためDstat報告書秒
Save the above script in a file called dstat_script.sh on your server, give it executable permission and then run it as a background process:上記のスクリプトをファイルに保存dstat_script.shお客様のサーバー上で 、実行可能ファイルのアクセス許可を与えるし、バックグラウンドプロセスとして実行すると呼ばれる:
# chmod +x dstat_script.sh # chmod + xはdstat_script.sh
# nohup ./dstat_script.sh & # nohup 。 / dstat_script.sh &
Done.完了した。 Yes, it’s that simple.はい、それは簡単です。 You will now be mailed this report after it’s done running.現在、この報告を完了した後、実行していることが郵送されます。 You can optionally schedule this script as a daily cron job so that you can receive this data every day.オプションは、このデータを受け取ることができます毎日毎日のcronジョブとしてはこのスクリプトをスケジュールすることができます。
As you may already have realized Dstat is a wonderful tool when applied to performance monitoring and debugging.すでにごDstat実現している可能性のある素晴らしいパフォーマンス監視ツールとデバッグ時に適用されます。 The granularity, frequency, and nature of the data collected are completely up to you.は、粒度、周波数、およびデータ収集の性質を完全にはあなた次第です。 Dstat empowers you to know what is going on on your server. Dstat何が起こっているのを知っている上にサーバーを強化。 Used wisely this power can result in a lot less sleepless nights for you.賢くこのパワーは多くの眠れぬ夜を少なくすることができます結果を使わせていただいています。






















{ 0 comments… ( 0コメント... add one now今すぐ追加 } )
Leave a Commentコメントを残しなさい