31
16

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Docker for Mac のファイル共有でconsistencyを指定してアクセスを速くする(CE-17.04.0)

Last updated at Posted at 2017-04-07

Docker for MacのEdgeチャンネルにCE-17.04.0が来たので、新機能のconsistencyを指定することでファイル共有が速くなるか確認してみました。

以前に書いたDocker for Macのファイル共有が遅いので計測してみるのベンチマークのコードを引っ張り出して、新しいマウントフラグ consistent, cached, delegated をそれぞれ試してみます。
https://github.com/WHITEPLUS/advent-calendar2016-docker-volume-bench

#! /bin/bash -Ceu

[ ! -f ./gophercolor.png ] && \
curl -O https://golang.org/doc/gopher/gophercolor.png

echo \#consistent
docker run -v `pwd`:/go/src/bench-fio:consistent `docker build --no-cache -q .`
echo \#cached
docker run -v `pwd`:/go/src/bench-fio:cached `docker build --no-cache -q .`
echo \#delegated
docker run -v `pwd`:/go/src/bench-fio:delegated `docker build --no-cache -q .`

#----------- 出力 ----------
#consistent
testing: warning: no tests to run
BenchmarkReadVolumeFile_Buf128-2          500    2765689 ns/op
BenchmarkReadVolumeFile_Buf1024-2         500    2173428 ns/op
PASS
ok   bench-fio 3.013s
#cached
testing: warning: no tests to run
BenchmarkReadVolumeFile_Buf128-2         1000    1254827 ns/op
BenchmarkReadVolumeFile_Buf1024-2        2000     755789 ns/op
PASS
ok   bench-fio 3.032s
#delegated
testing: warning: no tests to run
BenchmarkReadVolumeFile_Buf128-2         1000    1244565 ns/op
BenchmarkReadVolumeFile_Buf1024-2        2000     654835 ns/op
PASS
ok   bench-fio 2.799s

cached, delegated は、少なくとも(バッファ少なめな非効率な読み出しでも)__2倍以上速い!__これで体感は結構速くなるんじゃないでしょうか。

実際にどのフラグを使うかはこちらなどを参考にして、リネットの開発環境でも試していこうと思います。

31
16
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
31
16

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?