0

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: memcached

But 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.

2
  • What do you mean by "started working much slower"? It might be the time it takes for the docker containers to boot? Commented Mar 5, 2016 at 16:03
  • Average request time grew to 5 s while usually it is 2 sec Commented Mar 5, 2016 at 16:07

1 Answer 1

1

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:

Basically, you will need to experiment with some other sharing methods (NFS, xhyve, Vagrant rsync) to get up to more native performance.

Sign up to request clarification or add additional context in comments.

4 Comments

yes, you're right Mac OS X. I removed volume from docker-compose.yml and it started working as it works in vagrant. So yes, problem is about the volumes.
as I understand there is no a silver bullet for using Docker for development , is there ?
No, not at the moment. The alternatives I've listed all come with their own quirks as well. You will end up trading the performance issue for a permission issue or more complicated setup. Dynamic languages don't really favor local Docker development right now.
This seems like a big disadvantage to me. Thanks for clarify, Andy.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.