# HG changeset patch # User Daichi TOMA # Date 1390900592 -32400 # Node ID 31df2d4d0e9c84cd6a80a3ac2248ac938ef646fb # Parent a349b2c01cfede0664d795d3fb03e91abc1d233a add ch04 diff -r a349b2c01cfe -r 31df2d4d0e9c paper/chapter4.tex --- a/paper/chapter4.tex Tue Jan 28 06:40:52 2014 +0900 +++ b/paper/chapter4.tex Tue Jan 28 18:16:32 2014 +0900 @@ -1,6 +1,164 @@ \chapter{ベンチマーク}\label{ch:bench} +前章では木構造データベース Jungle の利用方法及び詳細な実装について述べた。 +本章では、まず始めに木構造データベース Jungle の読み込みと書き込みの性能の計測を行う。 +次に簡単な掲示板システムを作成し、既存の Java の並列データベースの実装との性能比較を行う。 +また、Web アプリケーションの性能計測の際の諸注意について述べる。 + +\section{並列読み込み} +木構造データベース Jungle の並列読み込みの実験を行う。 +\subsubsection{実験方法} +12コア CPU のマシン上で、プログラムを実行するコア数を変更しながら並列に読み込む実験を行う。 +木構造データベース Jungle を利用し、約90万の子を持つ木構造を作成する。 +その木構造を読み込むためのTaskを1000個作成し、並列に実行する。 + + +\subsubsection{実験環境} +実験を行うサーバの仕様について表\ref{tab:server_spec_1}に示す。 +Haskell のコンパイラには、The Glasgow Haskell Compiler (GHC) の 7.63 を使用する。 + +\begin{table}[!htbp] +\caption{実験を行うサーバの仕様} +\label{tab:server_spec_1} +\begin{center} +\begin{tabular}{|c||c|} \hline +名前 & 概要 \\ \hline \hline +CPU & Intel(R) Xeon(R) CPU X5650@2.67GHz * 2\\ \hline +物理コア数 & 12 \\ \hline +論理コア数 & 24 \\ \hline +Memory & 126GB \\ \hline +OS & Fedora 14 \\ \hline +GHC & 7.63 \\ \hline +\end{tabular} +\end{center} +\end{table} + +\subsubsection{実験結果} +並列読み込みの実験結果を表\ref{tab:par_read}に示す。 +12 CPUで動かした時に、1 CPUと比べて10.72倍の速度向上が見られる。 +また、Intel のハイパースレッディング機能を利用し24 CPUで動かした際にも僅かながら性能が向上している。 + + +\begin{table}[!htbp] +\caption{並列読み込みの実験結果} +\label{tab:par_read} +\begin{center} +\begin{tabular}{|c||r|} \hline +CPU数 & 実行時間 \\ \hline +1 コア& 59.72 s\\ \hline +2 コア& 33.77 s\\ \hline +4 コア& 15.95 s\\ \hline +6 コア& 10.72 s\\ \hline +8 コア& 8.10 s\\ \hline +10 コア& 6.56 s\\ \hline +12 コア& 5.57 s\\ \hline +24 コア& 4.80 s\\ \hline +\end{tabular} +\end{center} +\end{table} + +\section{並列書き込み} +木構造データベース Jungle の並列書き込みの実験を行う。 +\subsubsection{実験方法} +12コア CPU のマシン上で、プログラムを実行するコア数を変更しながら並列に書き込む実験を行う。 +木構造データベース Jungle を利用し、1000個ほどの子を持つ木構造を並列に作成する。 +木構造を作成するTaskの数は1000であり、それを各コアで分割して実行する。 + + +\subsubsection{実験環境} +実験を行うサーバの仕様については並列読み込みの実験時と同じである。 + +\subsubsection{実験結果} +並列読み込みの実験結果を表\ref{tab:par_write}に示す。 +速度向上が8コアあたりで止まってしまっている。 +ルートノードの更新や、木の作成がIO操作であり、大量に作成更新するためボトルネックになっていると考えられる。 + -\section{実験環境} -\section{実験} -\section{実験結果} +\begin{table}[!htbp] +\caption{並列書き込みの実験結果} +\label{tab:par_write} +\begin{center} +\begin{tabular}{|c||r|} \hline +CPU数 & 実行時間 \\ \hline +1 コア& 50.36 s\\ \hline +2 コア& 32.04 s\\ \hline +4 コア& 19.32 s\\ \hline +6 コア& 17.99 s\\ \hline +8 コア& 14.81 s\\ \hline +10 コア& 17.74 s\\ \hline +12 コア& 14.72 s\\ \hline +24 コア& 14.84 s\\ \hline +\end{tabular} +\end{center} +\end{table} + +\section{Web アプリケーションに組み込んでの性能評価} +\subsubsection{実験方法} +木構造データベース Jungle と Haskell の HTTP サーバ Warp を用いて簡易掲示板システムを作成する。 +Warp とは ~~ である。 +weightttpを用いて負荷をかける。 +weighttpの説明 +10スレッドから、1スレッドあたり100並列に1000回リクエストを投げる。 +負荷をかけるマシンおよび、かけられるマシンは共に12コアのコア数の多いマシンを用いる。 + +\subsubsection{実験環境} + +負荷をかけるマシンおよび、負荷をかけられるマシンの仕様を表\ref{tab:server_spec_2}に示す。 +同じ仕様のサーバを2台用いる。 +\begin{table}[!htbp] +\caption{サーバの仕様} +\label{tab:server_spec_2} +\begin{center} +\begin{tabular}{|c||c|} \hline +名前 & 概要 \\ \hline \hline +CPU & Intel(R) Xeon(R) CPU X5650@2.67GHz * 2\\ \hline +物理コア数 & 12 \\ \hline +論理コア数 & 24 \\ \hline +Memory & 126GB \\ \hline +OS & Fedora 14 \\ \hline +GHC & 7.63 \\ \hline +\end{tabular} +\end{center} +\end{table} + +\subsubsection{実験結果} + +読み込みが止まってしまう時、1秒あたり35000 reqほど +webサーバのボトルネックにかかってる? +\begin{table}[!htbp] +\caption{読み込み} +\label{tab:par_write} +\begin{center} +\begin{tabular}{|c||r|} \hline +CPU数 & 実行時間 \\ \hline +1 コア& 60.78 s\\ \hline +2 コア& 37.19 s\\ \hline +4 コア& 26.87 s\\ \hline +6 コア& 28.61 s\\ \hline +8 コア& 28.21 s\\ \hline +10 コア& 28.60 s\\ \hline +12 コア& 28.46 s\\ \hline +24 コア& 51.31 s\\ \hline +\end{tabular} +\end{center} +\end{table} + +\begin{table}[!htbp] +\caption{書き込み} +\label{tab:par_write} +\begin{center} +\begin{tabular}{|c||r|} \hline +CPU数 & 実行時間 \\ \hline +1 コア& 54.16 s\\ \hline +2 コア& 36.71 s\\ \hline +4 コア& 31.74 s\\ \hline +6 コア& 32.76 s\\ \hline +8 コア& 31.58 s\\ \hline +10 コア& 32.64 s\\ \hline +12 コア& 32.68 s\\ \hline +24 コア& 73.84 s\\ \hline +\end{tabular} +\end{center} +\end{table} + +ただのpingpongとそんなに変わらない… diff -r a349b2c01cfe -r 31df2d4d0e9c paper/master_paper.pdf Binary file paper/master_paper.pdf has changed