我确信这是一个太普遍的问题。 但仍希望得到一些有用的建议。
所以我使用vagrant运行我们的php应用程序,我们使用postgres,rabbitmq和memcached。 我设置了docker环境。 这是我的docker-compose.yml
web: build: app ports: - "80:80" volumes: - /Users/ihorsamusenko/my/project:/var/www/app links: - db - rabbit - memcached db: build: postgres ports: - 5432:5432 environment: POSTGRES_PASSWORD: postgres POSTGRES_USER: postgres rabbit: image: rabbitmq memcached: image: memcached但是使用这样的设置应用程序开始工作比以前慢得多。 我明白我的问题可能是应用程序特定的。 但是,也许这些问题有一些常见的提示。
I am sure it is too general question. But still hope to get some helpful advice.
So I use vagrant to run our php application, we use postgres, rabbitmq and memcached. I set up docker environment. Here's my docker-compose.yml
web: build: app ports: - "80:80" volumes: - /Users/ihorsamusenko/my/project:/var/www/app links: - db - rabbit - memcached db: build: postgres ports: - 5432:5432 environment: POSTGRES_PASSWORD: postgres POSTGRES_USER: postgres rabbit: image: rabbitmq memcached: image: memcachedBut with such setup application started working much slower than it used to do. I understand that probably my problem is application specific. But still, maybe there are some common tips for such problems.
最满意答案
我猜你在Windows或Mac OS X上使用VirtualBox。
造成这种情况的可能原因是VirtualBox的容量共享速度缓慢。 一些参考:
https://news.ycombinator.com/item?id=10052837 https://github.com/boot2docker/boot2docker/issues/593 https://superuser.com/questions/859149/slow-disk-performance-in-docker-container基本上,您需要尝试其他一些共享方法(NFS,xhyve,Vagrant rsync)以获得更多本机性能。
I'm guessing you are using VirtualBox on Windows or Mac OS X.
What is likely causing this is the slow volume sharing performance of VirtualBox. Some references:
https://news.ycombinator.com/item?id=10052837 https://github.com/boot2docker/boot2docker/issues/593 https://superuser.com/questions/859149/slow-disk-performance-in-docker-containerBasically, you will need to experiment with some other sharing methods (NFS, xhyve, Vagrant rsync) to get up to more native performance.
更多推荐
发布评论