title: Docker Container running very slow for Rails Application on development mode
body: <p>I am facing an issue on docker container. Rails Application is running very slow(means pages taking too much time to load on the browsers).</p>
  <p>Application details:</p>
  <p>Rails Version: <code>4.2.0</code>
  Ruby version: <code>2.2.0</code></p>
  <p>When I checked the status of memory by command <code>docker stats</code>, it is showing that the CPU utilization is very high for the main container(<code>1</code>). Sometimes it goes to <code>50%</code> of utilization.</p>
  <p>I tried with the few configurations i.e increase the <code>CPU</code> allocation for the docker, the performance get increased a little bit.</p>
  <pre><code>version: '3.7'
  
  services:
    selenium:
      image: selenium/standalone-chrome-debug:3.141.59-krypton
      ports: ['4444:4444', '5900:5900']
      logging:
        driver: none
    redis:
      image: redis:3.0.0
    elastic:
      image: elasticsearch:1.5.2
    db:
      image: postgres:9.3.10
      volumes:
        - ./tmp/db:/var/lib/postgresql/data
        - .:/home
    XYZ:
      build: .
      command: bash -c &quot;rm -f tmp/pids/server.pid &amp;&amp; bundle exec rails s -p 3000 -b '0.0.0.0'&quot;
      stdin_open: true
      tty: true
      volumes:
        - .:/home
      ports:
        - &quot;3000:3000&quot;
      depends_on:
        - db
        - redis
        - elastic
        - selenium
      environment:
        - REDIS_URL=redis://redis:6379/0
        - ELASTICSEARCH_URL=elastic://elastic:9200/0
        - SELENIUM_HOST=selenium
        - SELENIUM_PORT=4444
        - TEST_APP_HOST=XYZ
        - TEST_PORT=3000
  </code></pre>
  <p>And I observed that the js files which are loading on browser taking too much time to load approx <code>1.3 min</code>, e.g If there are 4 js files, each file taking more that <code>1 min</code> to load</p>
  <p>What I feel is docker is running slow on a mac machine, because the same application is running very well on Linux machine, might be I am wrong, but this is the observation which I saw.</p>
  <p>Any help will be appreciated.</p>