capistranoをほんのちょっと動かしてみる③の補足
(3)で同時実行数の制限やインターバルを設定したがその検証を少し行う。
テストパターンは下記のとおり。
on roles( :client ), in: :groups, limit: 3, wait: 0 do
on roles( :client ), in: :groups, limit: 2, wait: 0 do
on roles( :client ), in: :groups, limit: 1, wait: 0 do
on roles( :client ), in: :groups, limit: 3, wait: 5 do
on roles( :client ), in: :groups, limit: 2, wait: 5 do
on roles( :client ), in: :groups, limit: 1, wait: 5 do
1.on roles( :client ), in: :groups, limit: 3, wait: 0 do
$ time cap manage mkdir
INFO [6633a717] Running /usr/bin/env mkdir -p /root/test on capistrano
DEBUG [6633a717] Command: mkdir -p /root/test
INFO [456fad8a] Running /usr/bin/env mkdir -p /root/test on openvz
DEBUG [456fad8a] Command: mkdir -p /root/test
INFO [32c08bf7] Running /usr/bin/env mkdir -p /root/test on chef
DEBUG [32c08bf7] Command: mkdir -p /root/test
INFO [456fad8a] Finished in 0.164 seconds with exit status 0 (successful).
INFO [6a273110] Running /usr/bin/env ls -ld /root/test on openvz
DEBUG [6a273110] Command: ls -ld /root/test
DEBUG [6a273110] drwxr-xr-x 2 root root 4096 Jul 7 02:15 /root/test
INFO [6a273110] Finished in 0.022 seconds with exit status 0 (successful).
INFO [32c08bf7] Finished in 0.357 seconds with exit status 0 (successful).
INFO [134c9f95] Running /usr/bin/env ls -ld /root/test on chef
DEBUG [134c9f95] Command: ls -ld /root/test
DEBUG [134c9f95] drwxr-xr-x. 2 root root 4096 Jul 7 01:36 /root/test
INFO [134c9f95] Finished in 0.037 seconds with exit status 0 (successful).
INFO [6633a717] Finished in 0.421 seconds with exit status 0 (successful).
INFO [6c913a3c] Running /usr/bin/env ls -ld /root/test on capistrano
DEBUG [6c913a3c] Command: ls -ld /root/test
DEBUG [6c913a3c] drwxr-xr-x. 2 root root 4096 Jul 7 02:39 /root/test
INFO [6c913a3c] Finished in 0.029 seconds with exit status 0 (successful).
real 0m0.889s
2.on roles( :client ), in: :groups, limit: 2, wait: 0 do
$ time cap manage mkdir
INFO [1643bc54] Running /usr/bin/env mkdir -p /root/test on openvz
DEBUG [1643bc54] Command: mkdir -p /root/test
INFO [21c20ee0] Running /usr/bin/env mkdir -p /root/test on chef
DEBUG [21c20ee0] Command: mkdir -p /root/test
INFO [1643bc54] Finished in 0.139 seconds with exit status 0 (successful).
INFO [6d42baf4] Running /usr/bin/env ls -ld /root/test on openvz
DEBUG [6d42baf4] Command: ls -ld /root/test
DEBUG [6d42baf4] drwxr-xr-x 2 root root 4096 Jul 7 02:15 /root/test
INFO [6d42baf4] Finished in 0.021 seconds with exit status 0 (successful).
INFO [21c20ee0] Finished in 0.339 seconds with exit status 0 (successful).
INFO [819368aa] Running /usr/bin/env ls -ld /root/test on chef
DEBUG [819368aa] Command: ls -ld /root/test
DEBUG [819368aa] drwxr-xr-x. 2 root root 4096 Jul 7 01:36 /root/test
INFO [819368aa] Finished in 0.031 seconds with exit status 0 (successful).
INFO [48d17524] Running /usr/bin/env mkdir -p /root/test on capistrano
DEBUG [48d17524] Command: mkdir -p /root/test
INFO [48d17524] Finished in 0.363 seconds with exit status 0 (successful).
INFO [09829b1c] Running /usr/bin/env ls -ld /root/test on capistrano
DEBUG [09829b1c] Command: ls -ld /root/test
DEBUG [09829b1c] drwxr-xr-x. 2 root root 4096 Jul 7 02:39 /root/test
INFO [09829b1c] Finished in 0.029 seconds with exit status 0 (successful).
real 0m1.220s
3.on roles( :client ), in: :groups, limit: 1, wait: 0 do
$ time cap manage mkdir
INFO [4581eae2] Running /usr/bin/env mkdir -p /root/test on chef
DEBUG [4581eae2] Command: mkdir -p /root/test
INFO [4581eae2] Finished in 0.338 seconds with exit status 0 (successful).
INFO [382747e8] Running /usr/bin/env ls -ld /root/test on chef
DEBUG [382747e8] Command: ls -ld /root/test
DEBUG [382747e8] drwxr-xr-x. 2 root root 4096 Jul 7 01:36 /root/test
INFO [382747e8] Finished in 0.032 seconds with exit status 0 (successful).
INFO [b6ad8fcf] Running /usr/bin/env mkdir -p /root/test on openvz
DEBUG [b6ad8fcf] Command: mkdir -p /root/test
INFO [b6ad8fcf] Finished in 0.120 seconds with exit status 0 (successful).
INFO [1e56a4ed] Running /usr/bin/env ls -ld /root/test on openvz
DEBUG [1e56a4ed] Command: ls -ld /root/test
DEBUG [1e56a4ed] drwxr-xr-x 2 root root 4096 Jul 7 02:15 /root/test
INFO [1e56a4ed] Finished in 0.020 seconds with exit status 0 (successful).
INFO [2d16a360] Running /usr/bin/env mkdir -p /root/test on capistrano
DEBUG [2d16a360] Command: mkdir -p /root/test
INFO [2d16a360] Finished in 0.373 seconds with exit status 0 (successful).
INFO [ef492cb0] Running /usr/bin/env ls -ld /root/test on capistrano
DEBUG [ef492cb0] Command: ls -ld /root/test
DEBUG [ef492cb0] drwxr-xr-x. 2 root root 4096 Jul 7 02:39 /root/test
INFO [ef492cb0] Finished in 0.030 seconds with exit status 0 (successful).
real 0m1.389s
4.on roles( :client ), in: :groups, limit: 3, wait: 5 do
$ time cap manage mkdir
INFO [73bcebca] Running /usr/bin/env mkdir -p /root/test on openvz
DEBUG [73bcebca] Command: mkdir -p /root/test
INFO [d98f1ab5] Running /usr/bin/env mkdir -p /root/test on chef
DEBUG [d98f1ab5] Command: mkdir -p /root/test
INFO [d72f8be1] Running /usr/bin/env mkdir -p /root/test on capistrano
DEBUG [d72f8be1] Command: mkdir -p /root/test
INFO [73bcebca] Finished in 0.171 seconds with exit status 0 (successful).
INFO [568f8e8e] Running /usr/bin/env ls -ld /root/test on openvz
DEBUG [568f8e8e] Command: ls -ld /root/test
DEBUG [568f8e8e] drwxr-xr-x 2 root root 4096 Jul 7 02:15 /root/test
INFO [568f8e8e] Finished in 0.030 seconds with exit status 0 (successful).
INFO [d98f1ab5] Finished in 0.383 seconds with exit status 0 (successful).
INFO [17e14a69] Running /usr/bin/env ls -ld /root/test on chef
DEBUG [17e14a69] Command: ls -ld /root/test
INFO [d72f8be1] Finished in 0.402 seconds with exit status 0 (successful).
INFO [7ba48d5f] Running /usr/bin/env ls -ld /root/test on capistrano
DEBUG [7ba48d5f] Command: ls -ld /root/test
DEBUG [17e14a69] drwxr-xr-x. 2 root root 4096 Jul 7 01:36 /root/test
INFO [17e14a69] Finished in 0.034 seconds with exit status 0 (successful).
DEBUG [7ba48d5f] drwxr-xr-x. 2 root root 4096 Jul 7 02:39 /root/test
INFO [7ba48d5f] Finished in 0.038 seconds with exit status 0 (successful).
real 0m5.913s
5.on roles( :client ), in: :groups, limit: 2, wait: 5 do
$ time cap manage mkdir
INFO [75daad98] Running /usr/bin/env mkdir -p /root/test on openvz
INFO [55e107dd] Running /usr/bin/env mkdir -p /root/test on chef
DEBUG [55e107dd] Command: mkdir -p /root/test
DEBUG [75daad98] Command: mkdir -p /root/test
INFO [75daad98] Finished in 0.136 seconds with exit status 0 (successful).
INFO [26c6b155] Running /usr/bin/env ls -ld /root/test on openvz
DEBUG [26c6b155] Command: ls -ld /root/test
DEBUG [26c6b155] drwxr-xr-x 2 root root 4096 Jul 7 02:15 /root/test
INFO [26c6b155] Finished in 0.020 seconds with exit status 0 (successful).
INFO [55e107dd] Finished in 0.380 seconds with exit status 0 (successful).
INFO [d10d6bdc] Running /usr/bin/env ls -ld /root/test on chef
DEBUG [d10d6bdc] Command: ls -ld /root/test
DEBUG [d10d6bdc] drwxr-xr-x. 2 root root 4096 Jul 7 01:36 /root/test
INFO [d10d6bdc] Finished in 0.036 seconds with exit status 0 (successful).
INFO [291bdb27] Running /usr/bin/env mkdir -p /root/test on capistrano
DEBUG [291bdb27] Command: mkdir -p /root/test
INFO [291bdb27] Finished in 0.358 seconds with exit status 0 (successful).
INFO [11d1580f] Running /usr/bin/env ls -ld /root/test on capistrano
DEBUG [11d1580f] Command: ls -ld /root/test
DEBUG [11d1580f] drwxr-xr-x. 2 root root 4096 Jul 7 02:39 /root/test
INFO [11d1580f] Finished in 0.031 seconds with exit status 0 (successful).
real 0m11.259s
6.on roles( :client ), in: :groups, limit: 1, wait: 0 do
$ time cap manage mkdir
INFO [4b80f071] Running /usr/bin/env mkdir -p /root/test on chef
DEBUG [4b80f071] Command: mkdir -p /root/test
INFO [4b80f071] Finished in 0.337 seconds with exit status 0 (successful).
INFO [ecb0ac53] Running /usr/bin/env ls -ld /root/test on chef
DEBUG [ecb0ac53] Command: ls -ld /root/test
DEBUG [ecb0ac53] drwxr-xr-x. 2 root root 4096 Jul 7 01:36 /root/test
INFO [ecb0ac53] Finished in 0.032 seconds with exit status 0 (successful).
INFO [1dd44c9b] Running /usr/bin/env mkdir -p /root/test on openvz
DEBUG [1dd44c9b] Command: mkdir -p /root/test
INFO [1dd44c9b] Finished in 0.116 seconds with exit status 0 (successful).
INFO [4082cebe] Running /usr/bin/env ls -ld /root/test on openvz
DEBUG [4082cebe] Command: ls -ld /root/test
DEBUG [4082cebe] drwxr-xr-x 2 root root 4096 Jul 7 02:15 /root/test
INFO [4082cebe] Finished in 0.020 seconds with exit status 0 (successful).
INFO [159e9397] Running /usr/bin/env mkdir -p /root/test on capistrano
DEBUG [159e9397] Command: mkdir -p /root/test
INFO [159e9397] Finished in 0.345 seconds with exit status 0 (successful).
INFO [86776b77] Running /usr/bin/env ls -ld /root/test on capistrano
DEBUG [86776b77] Command: ls -ld /root/test
DEBUG [86776b77] drwxr-xr-x. 2 root root 4096 Jul 7 02:39 /root/test
INFO [86776b77] Finished in 0.029 seconds with exit status 0 (successful).
real 0m16.333s
結論としては3台程度では検証できない。 waitを0にすると順実行され、 waitは処理終了後に必ず実行される。