Super-Smack solaris10 x86_32bit インストール
MySQLを含め、PostgreSQL、Oracleで使えるDB負荷テストツール、Super Smackをインストールしてみる。
配布サイト→http://vegan.net/tony/supersmack/さんのところの Solaris10 x86 バイナリがバージョンが古いので1.3をsourceからコンパイル。
MySQL 32bit版のパッケージなどを/usr/local/mysqlに展開
正確に測定するためSuperSmackとMySQLは違うホストに入れます。
ただ、Super-SmackにはMySQLクライアントライブラリが必要なので、手っ取り早くTAR PACKAGE版でも展開しましょう。
今回は、以下の構成を用意。
細かい注意
- bison2.xxを使う
- なんか/usr/sfw/bin以下のbisonを使うとエラーが出ます。
- 他のutilも新しいほうがいいかも・・・
- libmysqlclient.soのディレクトリをRUNPATHに
- LDFLAGSにおまじない"-lsocket -lnsl -lm"
bash-3.00# LDFLAGS="-lsocket -lnsl -lm -R/usr/local/mysql/lib/ -L/usr/local/mysql/lib/ " ./configure --with-mysql
/usr/share/smacks/select-key.smackを参考にsmackファイルを作成
以下の部分を書き換える
user "root"; host "192.168.1.102"; db "test"; pass "xxxxxxxxxxxxx";
テストデータ作成
Super Smackホスト 192.168.1.101側で作業
bash-3.00# /usr/local/bin/gen-data -n 90000 -f %12-12s%n,%25-25s,%n,%d > /var/tmp/words.dat bash-3.00# scp /var/tmp/words.dat 192.168.1.102:/var/tmp/
DBサーバ側にテーブルを作る
MySQLサーバホスト 192.168.1.102側で作業
create table http_auth (username char(25) not null primary key, pass char(25), uid integer not null, gid integer not null )";
データのロード
DBサーバ側でデータをテーブルに取り込む
mysql> LOAD DATA INFILE '/tmp/words.dat' INTO TABLE test.http_auth FIELDS TERMINATED BY ',';
smack!
super-smack <設定ファイル> <同時接続数> <トランザクション数>
※5.1系の上限スレッド数は150がデフォルト
bash-3.00# /usr/local/bin/super-smack /usr/share/smacks/select-key_mosa.smack 150 100 Query Barrel Report for client smacker1 connect: max=45ms min=1ms avg= 9ms from 150 clients Query_type num_queries max_time min_time q_per_s select_index 30000 53 0 22479.87
nginxでバーチャルホスト
ロシア製のWebサーバnginxを色々と設定中。
とりあえず備忘録
バーチャルホスト設定とプロクシの設定
既存のApacheを[port:8080]に設定して新規ドメインのみnginxが応答するようにする。
- nginx.conf
server { listen www.mydomdesuyo.ne.jp; server_name www.mydomdesuyo.ne.jp mydomdesuyo.ne.jp; access_log off; location / { proxy_pass http://localhost:8080; } } server { listen mydomdesuyo.com; server_name mydomdesuyo.com *.mydomdesuyo.com; location / { root html; autoindex on; index index.html index.htm index.php; } }