Thor Samsberg
Thor Samsberg

Reputation: 2279

Php application started working slowly with docker

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.

Upvotes: 0

Views: 1588

Answers (1)

Andy Shinn
Andy Shinn

Reputation: 28493

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.

Upvotes: 1

Related Questions