V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
sundayhk
V2EX  ›  Docker

使用 Docker PHP 性能 跟裸机差距很大。

  •  
  •   sundayhk · Apr 2, 2019 · 7051 views
    This topic created in 2590 days ago, the information mentioned may be changed or developed.

    Docker PHP 与 裸机差距

    OS: CentOS 7
    Docker: 18.09.4

    裸机 PHP 7.1.3:
    Requests/sec: 540.04
    Transfer/sec: 528.47KB

    Docker PHP 7.1.26 Debian Strech(官方):
    Requests/sec: 460.68
    Transfer/sec: 450.81KB

    均开启 OPcache + HugePages
    PHP 版本不同,参数配置一致.
    Docker 网络使用 Host 模式性能也是上不去,跟 Bridge 一样。
    测试过其他机使用 Ubuntu 16.04 Docker PHP 也有同样的性能差距。
    测试过 Nginx 没什么差距。
    请教下那 Docker PHP 这个差距是什么造成的呢。
    可以怎么优化下呢?

    5 replies    2019-04-09 14:11:44 +08:00
    BlackHole1
        1
    BlackHole1  
    PRO
       Apr 3, 2019 via Android
    尝试给容器增加一下 cpu mem,再看一下
    fire9
        2
    fire9  
       Apr 6, 2019
    如果做优化,建议别用官方源,自己构建比较好,系统参数可以调整等.
    sundayhk
        3
    sundayhk  
    OP
       Apr 9, 2019
    没有限制资源
    sundayhk
        4
    sundayhk  
    OP
       Apr 9, 2019
    谢谢。试过了。自己做性能会比官方的好。但还是有些差距。看过国外测评,php docker 无可避免 性能差距。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2694 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 38ms · UTC 10:14 · PVG 18:14 · LAX 03:14 · JFK 06:14
    ♥ Do have faith in what you're doing.