我在 docker 容器上遇到了问题。Rails 应用程序运行非常缓慢(意味着页面在浏览器上加载时间过长)。
申请详情:
导轨版本: 4.2.0
Ruby 版本:2.2.0
当我通过命令检查内存状态时docker stats
,显示主容器(1
)的 CPU 利用率非常高。有时它会50%
被利用。
我尝试了一些配置,即增加了CPU
docker的分配,性能得到了一点点提高。
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 "rm -f tmp/pids/server.pid && bundle exec rails s -p 3000 -b '0.0.0.0'"
stdin_open: true
tty: true
volumes:
- .:/home
ports:
- "3000:3000"
depends_on:
- db …
Run Code Online (Sandbox Code Playgroud)