Slow Response Times: Laravel 5.2 In Docker Container
When running Laravel 5.2 within a PHP-7 docker container I'm getting response times in
300ms - 400ms.
That is extremely slow although if I'm just echoing out
phpinfo() on the same container the response time is
15ms - 50ms is anyone experiencing these slow response times with Laravel in a Docker container?
Okay, problem solved.
On a local development environment using Docker 1.10 with the VirtualBox driver and a volume mounted to the host system (that would be Boot2Docker VM and OSX) the performance is incredibly woeful, as described above
300ms - 600ms.
Use the same configuration without the mounted volumes
20ms - 30ms response times. My assumption is that because Laravel has intensive disk I/O due to the large amount of files it loads on each request this is impacted by how VirtualBox shares folders between the host and a VM.
Issue is not a Docker or Laravel, its a VirtualBox VM issue.
Comparing differing environments in a docker
Note: the below are without
artisan optimize --force or
- HHVM 13ms - 31ms (TCP port 9000)
- HHVM 12ms - 22ms (Unix socket)
- PHP-7 FPM 42ms - 73ms (TCP port 9000)
- PHP-7 FPM 38ms - 55ms (Unix socket)
HHVM with artisan optimisations + unix sockets: 8ms - 12ms
PHP-7 FPM with artisan optimisations + unix sockets: 38ms - 42ms
Take a look at HHVM with optimizations and unix sockets. It's very fast.
- → "failed to open stream" error when executing "migrate:make"
- → October CMS Plugin Routes.php not registering
- → OctoberCMS Migrate Table
- → OctoberCMS Rain User plugin not working or redirecting
- → October CMS Custom Mail Layout
- → October CMS - How to correctly route
- → October CMS create a multi select Form field
- → October CMS - Conditionally Load a Different Page
- → How to disable assets combining on development in OctoberCMS
- → October CMS - Radio Button Ajax Click Twice in a Row Causes Content to disappear
- → OctoberCms component: How to display all ID(items) instead of sorting only one ID?
- → In OctoberCMS how do you find the hint path?
- → How to register middlewares in OctoberCMS plugin?