swoft-cloud / swoft

🚀 PHP Microservice Full Coroutine Framework
https://swoft.org
Apache License 2.0
5.58k stars 786 forks source link

Win10 WLS2 中,特别迟缓…… #1369

Closed uiosun closed 4 years ago

uiosun commented 4 years ago
Q A
Bug report? no
Feature request? no
Swoft version 2.0.9
Swoole version 4.4.18
PHP version 7.2.33
Runtime environment Win10 的 WSL2 的 Docker

环境用了 Win10 的 WLS2,里面直接用了官方的 Docker,映射到 windows 盘里的代码。

一句 php bin/swoft -V 执行了二十几秒……是不是忒慢了点啊……求助。

Docker 镜像 run 代码:docker run -p 18308:18308 --rm -d -v /mnt/e/codes/unknow:/var/www/swoft --name swoft swoft/swoft 服务是 WS + HTTP 服务

root@ebb8d76f83d7:/var/www/swoft# php bin/swoft -V
2020/09/19-13:21:12 [INFO] Swoft\SwoftApplication:setSystemAlias(417) Project path: @base=/var/www/swoft
2020/09/19-13:21:12 [INFO] Swoft\SwoftApplication:setSystemAlias(418) Set alias @app=@base/app
2020/09/19-13:21:12 [INFO] Swoft\SwoftApplication:setSystemAlias(419) Set alias @config=@base/config
2020/09/19-13:21:12 [INFO] Swoft\SwoftApplication:setSystemAlias(420) Set alias @runtime=@base/runtime
2020/09/19-13:21:13 [INFO] Swoft\Processor\EnvProcessor:handle(60) Env file(/var/www/swoft/.env) is loaded
2020/09/19-13:21:31 [INFO] Swoft\Processor\AnnotationProcessor:handle(45) Annotations is scanned(autoloader 36, annotation 474, parser 93)
2020/09/19-13:21:32 [INFO] Swoft\Processor\BeanProcessor:handle(53) Bean is initialized(singleton 332, prototype 79, definition 50)
2020/09/19-13:21:32 [INFO] Swoft\Processor\BeanProcessor:handle(57) Config path is /var/www/swoft/config
2020/09/19-13:21:32 [INFO] Swoft\Processor\BeanProcessor:handle(62) Config env is not setting
2020/09/19-13:21:32 [INFO] Swoft\Processor\EventProcessor:handle(35) Event manager initialized(66 listener, 4 subscriber)
2020/09/19-13:21:32 [INFO] Swoft\WebSocket\Server\Listener\AppInitCompleteListener:handle(44) WebSocket server route registered(module 3, message command 8)
2020/09/19-13:21:32 [INFO] Swoft\Tcp\Server\Listener\AppInitCompleteListener:handle(45) Tcp server route registered(routes 4)
2020/09/19-13:21:32 [INFO] Swoft\Error\Listener\AppInitCompleteListener:handle(34) Error manager init completed(4 type, 5 handler, 5 exception)
2020/09/19-13:21:33 [INFO] Swoft\Processor\ConsoleProcessor:handle(36) Console command route registered (group 14, command 44)
Swoft - An PHP micro-service coroutine framework (Version: 2.0.9)
   _____               ______     ___    ____
  / ___/      ______  / __/ /_   |__ \  / __ \
  \__ \ | /| / / __ \/ /_/ __/   __/ / / / / /
 ___/ / |/ |/ / /_/ / __/ /_    / __/_/ /_/ /
/____/|__/|__/\____/_/  \__/   /____(_)____/

PHP: 7.2.33, Swoft: 2.0.9, Swoole: 4.4.18
uiosun commented 4 years ago

呼叫一下有经验的大佬们,Win10 WLS2 执行 php bin/swoft -V,特别慢,求帮助。

@manyoubaby123

难道是因为我把代码放到了 windows 盘里了?

inhere commented 4 years ago

wsl 里可以直接用 php, swoole 了。不用再走docker

inhere commented 4 years ago

不用 wsl 时,Windows下到可以用docker

uiosun commented 4 years ago

不用 wsl 时,Windows下到可以用docker

感谢大佬,懒于自己装环境,Oneinstack 这种懒人包又不能用,干脆 Docker 了😀~

换到了 WSL2 的盘,快了很多,23333

先把游戏基本接口写完,再折腾环境,没太多经验,怕出问题卡很久。