メールサーバ負荷ツールの一つである「MStone」のインストールを行います。
この「MStone」を使えば、SMTP/POP/IMAP/WMAPのベンチマークができます。
「MStone」については、以下のURLを参照して下さい。
http://mstone.sourceforge.net/index.html(本家)
http://www.mozilla-japan.org/projects/mstone/(翻訳版)
注意:このツールは、あくまでもベンチマークのためにあるものです。外部の稼動サーバにこのツールを使用すると、法的責任を取らされる場合があります。なので、絶対に使用しないようにしましょう。いかなる場合でも、私は一切責任を負いません。この事に同意して頂いた方のみ以下を参考にしてみてください。
■必要なソフトウェア
◎MStone(本体)
◎gcc(CMakeインストール時に必要)
◎CMake(MStoneインストール時に必要)
◎gnuplot(結果をグラフ表示する場合に必要)
(1)「CMake」のダウンロード、インストールを行う。
「CMake」のダウンロード先は以下のURLです。
http://www.cmake.org/cmake/resources/software.html
注)2010年5月22日の最新版は【cmake-2.8.1.tar.gz】です。
[root@mail1 ~]# wget http://www.cmake.org/files/v2.8/cmake-2.8.1.tar.gz [root@mail1 ~]# tar zxvf cmake-2.8.1.tar.gz [root@mail1 ~]# cd cmake-2.8.1 [root@mail1 cmake-2.8.1]# ./configure --prefix=/usr/local/cmake [root@mail1 cmake-2.8.1]# make && make install
(2)インストール後、「CMake」のパスを通す。(この操作は任意)
各ユーザーが自前で設定する場合(ここではrootを例にする)
[root@mail1 ~]# vi .bashrc ----------最終行にでも追加---------- PATH=/usr/local/cmake/bin:$PATH [root@mail1 ~]# source .bashrc ← # 設定を反映する
前ユーザーに「CMake」のパスを設定する場合
[root@mail1 ~]# vi /etc/profile # No core files by default ulimit -S -c 0 > /dev/null 2>&1 if [ -x /usr/bin/id ]; then USER="`id -un`" LOGNAME=$USER MAIL="/var/spool/mail/$USER" pathmunge /usr/local/cmake/bin ← # 追加 fi
(3)「MStone」の結果をグラフ表示させるように「gnuplot」のダウンロード、インストールを行う。
「gnuplot」のダウンロード先は以下のURLです。
http://sourceforge.net/projects/gnuplot/files/
注)2010年5月22日の最新版は【gnuplot-4.4.0.tar.gz】です。
ちなみに、「yum」でもインストール可能です。「yum」でインストールしても問題ありません。
ここではソースからのインストールを紹介します。
[root@mail1 ~]# wget http://sourceforge.net/projects/gnuplot/files/gnuplot/4.4.0/gnuplot-4.4.0.tar.gz/download [root@mail1 ~]# tar zxvf gnuplot-4.4.0.tar.gz [root@mail1 ~]# cd gnuplot-4.4.0 [root@mail1 gnuplot-4.4.0]# ./configure [root@mail1 gnuplot-4.4.0]# make && make install
(4)「MStone」のダウンロード、インストールを行う。
「MStone」のダウンロード先は以下のURLです。
http://sourceforge.net/projects/mstone/files/mstone/4.9.4/
注)ダウンロードするファイル名は【mstone+docs-4.9.4.tar.gz】です。
[root@mail1 ~]# wget http://sourceforge.net/projects/mstone/files/mstone/4.9.4/mstone%2Bdocs-4.9.4.tar.gz/download [root@mail1 ~]# tar zxvf mstone+docs-4.9.4.tar.gz [root@mail1 ~]# cd mstone-4.9.4/ [root@mail1 mstone-4.9.4]# cmake . [root@mail1 mstone-4.9.4]# cmake CMakeLists.txt [root@mail1 mstone-4.9.4]# make && make install
警告など出るが問題ない。
インストール先は自動的に【/usr/local/mstone】になっている。
(5)「MStone」のセットアップを行う。
まず、「License」に同意する必要があるため、以下を実行し「License」に同意する。
[root@mail1 ~]# cd /usr/local/mstone/ [root@mail1 mstone]# ./mstone config mstone setup was never run. Running setup. Netscape Mailstone. Copyright (c) 1997-2000 Netscape Communications Corp. The contents of this software package are subject to the Netscape Public License Version 1.1 (the "License"); you may not use this software except in compliance with the License. You may obtain a copy of the License at http://www.mozilla.org/NPL/ Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License. Alternatively, the this software package may be used under the terms of the GNU Public License (the "GPL"), in which case the provisions of the GPL are applicable instead of those above. If you wish to allow use of your version of this file only under the terms of the GPL and not to allow others to use your version of this file under the NPL, indicate your decision by deleting the provisions above and replace them with the notice and other provisions required by the GPL. If you do not delete the provisions above, a recipient may use your version of this file under either the NPL or the GPL. Do you agree to the terms of the license? (yes/no) yes ← # 同意 Found these message files: en-17k.msg en-1k.msg en-20k.msg en-2k.msg en-32k.msg en-3k.msg en-5k.msg en-750.msg en-gif-17k.msg gr-3k.msg nu-5k.msg words-ascii.dat Copying build/Linux2.6_x86_64/mailclient and message files to /var/tmp/ Linux example.local 2.6.18-238.19.1.el5 #1 SMP Fri Jul 15 07:31:24 EDT 2011 x86_64 x86_64 x86_64 GNU/Linux
次に、「MStone」の初期設定を行う。
[root@mail1 mstone]# ./mstone config Netscape Mailstone. Copyright (c) 1997-2000 Netscape Communications Corp. Configure test clients [n]? y # (1) You can enter multiple machines like this: host1,host2 What is the name of the client(s) for default OS [localhost]: # (2) What additional client(s) [none]: # (3) Configure SMTP/POP/IMAP protocols [n]? y # (4) What is the name of the mail host [mailhost.example.com]: mail1.com # (5) What is the user name pattern [mailtestuser%ld]: user%ld # (6) What is the password pattern [myPassword]: passwd # (7) How many users [100]: 100 # (8) What is the first user number [0]: 1 # (9) Do you want to view the new conf/general.wld [y]? # (10) Here is the new conf/general.wld: # common setup info for tests # See sample.wld for detailed usage # Information on how the test is distributed and reported # Test independent configuration <CONFIG> # Debug with short runs and a few clients, then increase test time # These get overridden in the test specific files (or the command line) clientCount 2 # nominal clientCount (usually overriden) rampTime 20s time 1m # Each test should set a title/comments in their CONFIG section # This is a reminder to set something title Need to set test title... comments Some sort of testing... #sysConfig conf/sample.html # File for additonal system config # Uncomment this to enable core dumps: #clientCommand ulimit -Sc 900000; ./mailclient </CONFIG> # Each <Monitor> section defines remote monitoring commands # for one or more machines. # Commands containing '%c' run to completion. # Otherwise the command will be shutdown down <MONITOR> name vmstat.txt # outfile will be CLIENT*-NAME command vmstat %f process conf/clean_vmstat.pl # custom processing script </MONITOR> # The PreTest sections will run before the test starts <PRETEST> name preifconfig.txt # outfile will be CLIENT*-NAME command ifconfig </PRETEST> # The PostTest sections will run after the test ends <POSTTEST> name ifconfig.txt # outfile will be CLIENT*-NAME command ifconfig; uname -a # clean_ifconfig expects the input name to be preifconfig.txt or pretest.txt process conf/clean_ifconfig.pl # custom processing script </POSTTEST> # The <DEFAULT> tag sets protocol block defaults <DEFAULT> # defaults for both e-mail and revision control systems loginFormat user%ld passwdFormat passwd numLogins 100 firstLogin 1 # e-mail defaults server mail1.com smtpMailFrom user0@mail1.com addressFormat user%ld@mail1.com numAddresses 100 firstAddress 1 # revision control system defaults repoUrl http://myLocalSvn topDir repoTop/mstone </DEFAULT> # Specify client machines # mstone assigns the same process/thread counts to each host in a client block. # Use one host per client block for maximum allocation flexibility. <CLIENT HOSTS=localhost> maxThreads 100 </CLIENT> Configure SVN support [n]? # (11) Generate an account LDIF file for Netscape Directory Server [n]? # (12) Make any additional changes to conf/general.wld and then re-run 'setup'
(1)テストクライアントの設定を行うか?
(2)クライアントのホスト名設定
(3)追加クライアント設定(複数のマシンで負荷を与えることが出来る)
(4)SMTP/POP/IMAPの設定を行うか?
(5)負荷対象サーバのドメイン(ホスト名)を設定
(6)メールアカウントを設定、ここでは【user1】【user2】【userN】とするので%ldを指定している。%ldにはランダムな数字が入る。
(7)メールアカウントのパスワードを設定
(8)負荷対象サーバに登録されているメールアカウント数を設定
(9)メールアカウントの初番の値を設定
(10)設定した内容を確認するか?
(11)SVNに関しての設定をするか?
(12)NMSのユーザ情報LDIFを自動生成するか?
次に「MStone」のセットアップを行う。
[root@mail1 mstone]# ./mstone setup Netscape Mailstone. Copyright (c) 1997-2000 Netscape Communications Corp. Found these message files: en-17k.msg en-1k.msg en-20k.msg en-2k.msg en-32k.msg en-3k.msg en-5k.msg en-750.msg en-gif-17k.msg gr-3k.msg nu-5k.msg words-ascii.dat Copying build/Linux2.6_x86/mailclient and message files to /var/tmp/ Linux mail1.com 2.6.18-164.15.1.el5 #1 SMP Wed Mar 17 11:37:14 EDT 2010 i686 i686 i386 GNU/Linux