同一サーバ、単一PHPから、
ログイン、chdir後、異なる5000ファイルをアップロード
vsftpd 3.0.3 from source
pure-ftpd v1.0.30 from yum install
pure-ftpdの方が早いみたい。。
vsftpd
num : 5000
total : 2.30912 s
one : 0.00046s/req
pure-ftpd
num : 5000
total : 2.0004 s
one : 0.0004s/req
同一サーバ、単一PHPから、
ログイン、chdir後、異なる5000ファイルをアップロード
vsftpd 3.0.3 from source
pure-ftpd v1.0.30 from yum install
pure-ftpdの方が早いみたい。。
vsftpd
num : 5000
total : 2.30912 s
one : 0.00046s/req
pure-ftpd
num : 5000
total : 2.0004 s
one : 0.0004s/req
100000DIR×3階層ほどでも、
検知は一瞬。
establish までの初期化が遅い。数十秒。
20000DIR
$ php glob.php
13.52773 ms
$ php opendir.php
5.3176 ms
#ファイルとDatabaseの書き込みの差
#filesystem read→write
10000ファイル
1.24ms
0.00012ms/req
#filesystem append
10000ファイル
0.26852 ms
3.0E-5ms/req
#psql insert
1000 insert
0.52306 ms
0.00052ms/req
※ ×10レコードでも大差無い
#psql insert
10000 insert
4.29751 ms
0.00043ms/req
vi /etc/exports
# 共有ボリュームのパス, 接続許可ホスト, エクスポートプション (rw) = Read Write
/root/nfs 127.0.0.1(rw,no_root_squash)
/root/nfs 160.16.117.208(rw,no_root_squash)
service rpcbind start
service nfslock start
service nfs start
|
1 2 3 4 5 6 7 8 9 10 11 12 13 |
<span class="c"># エクスポートテーブルの確認 exportfs -a</span> exportfs -v mount -t nfs 160.16.117.208:/root/nfs /mnt/nfs #仮想IPでマウント ip addr add 172.25.0.1/24 dev eth0 vi /etc/exports /root/nfs 172.25.0.0/24(rw,no_root_squash) |
|
1 2 |
<span class="c">exportfs -a</span> exportfs -v |
|
1 2 |
#インストール yum install zabbix-agent |
|
1 2 3 4 5 |
yum install zabbix-server-mysql zabbix-web-mysql https://www.zabbix.com/documentation/2.4/manual/installation/install_from_packages #DB作成 |
|
1 2 3 4 5 6 7 8 |
shell> mysql -uroot -p<password> mysql> create database zabbix character set utf8 collate utf8_bin; mysql> grant all privileges on zabbix.* to zabbix@localhost identified by '<password>'; mysql> quit; shell> mysql -uzabbix -p<password> zabbix < database/mysql/schema.sql # stop here if you are creating database for Zabbix proxy shell> mysql -uzabbix -p<password> zabbix < database/mysql/images.sql shell> mysql -uzabbix -p<password> zabbix < database/mysql/data.sql |
|
1 2 3 |
https://www.zabbix.com/documentation/2.4/manual/appendix/install/db_scripts #データ設定 |
|
1 2 3 4 5 6 7 8 |
shell> mysql -u<username> -p<password> mysql> create database zabbix character set utf8; mysql> quit; shell> cd create/schema shell> cat mysql.sql | mysql -u<username> -p<password> zabbix shell> cd ../data shell> cat data.sql | mysql -u<username> -p<password> zabbix shell> cat images_mysql.sql | mysql -u<username> -p<password> zabbix |
|
1 2 3 4 5 |
https://www.zabbix.com/documentation/1.8/manual/installation/installation_from_source #設定 vi /etc/services |
|
1 2 3 4 5 6 7 8 9 |
zabbix-agent 10050/tcp Zabbix Agent zabbix-agent 10050/udp Zabbix Agent zabbix-trapper 10051/tcp Zabbix Trapper zabbix-trapper 10051/udp Zabbix Trapper /etc/init.d/zabbix-agent start /etc/init.d/zabbix-server start vi /etc/httpd/conf.d/zabbix.conf |
|
1 2 3 4 5 6 |
php_value max_execution_time 300 php_value memory_limit 128M php_value post_max_size 16M php_value upload_max_filesize 2M php_value max_input_time 300 # php_value date.timezone Europe/Riga |
|
1 |
service httpd restart |
※localhost指定だと遅くなるのでハマっていた・・。
#同一サーバ localhost pgpool経由 select
1000req
0.0401ms/req
#同一サーバ自IPアドレス指定 pgpool経由 select
1000req
0.0002ms/req
#同一サーバ localhost psql直 select
1000req
0.00012ms/req
#同一サーバ自IPアドレス指定 psql直 select
10000req
0.00012ms/req
#インターネット経由 pgpool経由 select
1000req
0.00276ms/req
#インターネット経由 psql直 select
1000req
0.00237ms/req
※事前にテーブル作成
pgbench -i
※DB名省略
$ pgbench -p 9999 -S
Password:
starting vacuum…end.
transaction type: SELECT only
scaling factor: 1
query mode: simple
number of clients: 1
number of transactions per client: 10
number of transactions actually processed: 10/10
$ pgbench -p 5432 -S
Password:
starting vacuum…end.
transaction type: SELECT only
scaling factor: 1
query mode: simple
number of clients: 1
number of transactions per client: 10
number of transactions actually processed: 10/10
tps = 1378.549766 (including connections establishing)
tps = 3500.175009 (excluding connections establishing)
インストール
yum install rsync
手動同期
mkdir rsync
cd rsync/
mkdir source
mkdir backup
touch source/test
rsync -av source/ backup
デーモン化
vi /etc/rsyncd.conf
rsync –daemon –config=/etc/rsyncd.conf
同期
touch source/test2
rsync -av source/ rsync://127.0.0.1/backup
lsyncdインストール、起動
yum install lsyncd
vi /etc/lsyncd.conf
lsyncd /etc/lsyncd.conf
同期
touch source/lsync
rsync version 3.0.6 protocol version 30
lsyncd
Version: 2.1.5
/etc/rsyncd.conf
### グローバル・オプション
uid = root
gid = root
log file = /var/log/rsyncd.log
pid file = /var/run/rsyncd.pid
### モジュール・オプション
[backup]
comment = rsyncd server
path = /home/nilesflow/rsync/backup
read only = no
/etc/lsyncd.conf
settings = {
logfile = “/var/log/lsyncd.log”,
statusFile = “/var/log/lsyncd.stat”,
statusInterval = 1,
}sync{
default.rsync,
source = “/home/nilesflow/rsync/source/”,
target = “127.0.0.1::backup”,
rsync = {
_extra = { “-a” },
}
}
php.ini
session.save_path = “tcp://127.0.0.1:6379,tcp://127.0.0.1:6380”
これだと、ラウンドロビンっぽく順にアクセスするので、障害対応にはならない。
アプリ側で指定するか、redis sentinel 使うか、仮想IP使うか・・。