2011/10/17

エクセルファイルのバッチ出力 その6 (Excel file processing, Part 6)

ここで一度、サンプルプログラム実行時のマシン負荷を確認します。
今回はプログラムを素で実行し(デバッグモードではなく、EXEを直接起動)、OS統計を収集しました。
統計の取得間隔は2秒です。

【CPU】
論理8コア(物理4コア)の内、コアを4つ使用しています。各コアの使用率は50%程度で推移しており、全体としてのCPU使用率は約25%です。
Figure 11: CPU usage during the Excel file processing

CPU使用率の内訳を確認します。全体でのPrivileged TimeとUser Time(sys、user)の使用率は以下の通りです。Privileged Timeが若干ですが目立ちます。
Figure 12: CPU mode

念のためコンテキストスイッチ(Context Switches)を確認します。高い値で推移しています。Excel 2010では過去のバージョンよりも多くのスレッドが使用されているため、今回のような使用パターンでは値が高止まりしやすいと推測されます。
Figure 13: Context switches


また、エクセルのプロセスを抽出したCPUの使用率の推移は以下の通りです。約200%で推移しており、前述のCPU使用率(全体で25%)と概ね一致しています。
Figure 14: CPU usage of Excel process


今回はDBサーバが同一機材上のVMに構築されているため、VMのCPU使用状況も確認します。最大でも(800%中)約6%と、ほぼ凪であり、影響は概ね無視できると考えられます。
Figure 15: CPU usage of the VM processes


【メモリ】
メモリは余裕のある状態です。グラフは割愛しますが、ページングも発生しておらず、問題は認められません。
Figure 16: Memory usage


【ディスク】
ディスクも余裕のある状態です。問題は認められません。
Figure 17: Disk usage

今回の検証では、エクセル操作はCPUへの負荷が非常に高いことが確認されました。これらの値を踏まえた上で、次回はサンプルアプリにて並列処理を検証します。



[Summary]
Figures above show the OS statistics during the sample program processing.

[CPU]
Figure 11 shows that the sample program (and Excel process) uses 4 cores (Intel Core i7: 4 cores w/ HT).  Each cores are used around 50%.

Figure 12 shows Privileged Time and User Time in total.  the Privileged Time is higher than ordinary level.

Figure 13 shows Context Switches get high level.  Since Excel 2010 handles more threads than the past version (Excel 2003 and older), the overhead of context switch becomes bigger issue.

Figure 14 and 15 show CPU usage of Excel process and DB server on the virtual machine.  The CPU usage of VM is low enough to be ignored.

[Memory]
no problem with the memory (Figure 16).

[Disk]
Disk is not busy at all (Figure 17).

The result shows that Excel operation costs CPU resource.  I will test parallel processing in the next post.

0 件のコメント:

コメントを投稿