Need suggestion: performance question

Hi,

Disclaimer: I am pretty good in front end development, but know very little in server administration etc. So, please don’t judge if my question is dumb :slight_smile:

I work with several projects at once. Maybe 4-5. Some of them are pure ReactJS apps, some WordPress sites, some are the mix of both. Devilbox is a super tool for me, it helps me a lot! I just have some performance issues which I don’t know how to solve them. And maybe I am using Devilbox wrong, I don’t know)

So, 3-4 WordPress installs slows down each other. Kind of. I don’t open all these local sites in the browser, still, it seems like opening even one leads to the kind of using others. Because WP sends many HTTP requests when is being loaded - checks for new core updates, plugins/themes updates, other routines - it really slows down everything. I mean, sometimes I have to wait 5-10 seconds everytime I reload the page.

The thing is when I “disconnect” all other installs except one - for instance, provide wrong DB or user DB name, so the site cannot actually start - it seems like it helps. So, at the moment, I disabled other installs and work only with the current. If I have to work with another one, I “disable” the current and “enable” that another one.

Another thing is the time for the execution of HTTP requests. It does not matter where I work - home, some coworking etc - I tried different places - the result is HTTP requests are slow. So, it must be my something on my laptop, but not the internet connection in a certain place. On the hosting WP admin area is being loaded fast, on my local site it is slow as hell. Again, mostly the first time of the day because of all those checks I mentioned before.

Please, suggest, how to improve the situation? I believe it is something related to how Devilbox configured/works in Docker.

Thanks!

Could you please provide some background information about your setup:

  • Host operating system
  • Docker or Docker Toolbox
  • Docker/Docker-Compose version
  • Webserver used
  • PHP version used
  • Database used
  • Also did you make any changes to httpd/php settings?
  • Have you tried disabling unnecessary modules (e.g.: xdebug)

Sure.

MacOS Mojave 10.14.2
Docker 2.0.0.2
docker-compose 1.23.2
Nginx stable, PHP 7.2, mariadb 10.3, also mongoDB latest
No, I did not make any changes to httpd/php settings
I disabled only those which are kind of suggested to be disabled in env-example:
PHP_MODULES_DISABLE=rdkafka,swoole
That’s all.

As I’ve expected. This is a specific MacOS issue. It has already been for a long time: https://forums.docker.com/t/file-access-in-mounted-volumes-extremely-slow-cpu-bound/8076/281

Currently I only have one option to mitigate it via volume caching: https://devilbox.readthedocs.io/en/latest/getting-started/install-the-devilbox.html#osx-performance

An alternative is to try Docker Toolbox on MacOS.

However there is already a Devilbox issue to tackle this one once and for all via docker-sync: https://github.com/cytopia/devilbox/issues/105

As I currently do not have a Mac anymore it is pretty hard for me to get it to work. Feel free to join the above GitHub discussion and try to make it run. Once docker-sync is in place, the performance will be fast again.

However, the above mentioned cache mitigation might already solve your performance problems. Let me know about this one.

1 Like

Thanks for the suggestion!

Ok, I have tried ‘cached’, ‘delegated’ and ‘consistent’. Twice. None of these helped me. Will also check docker-sync solution.

Note that you have to enter ,cached with a leading comma. As far as I can tell from the GitHub issue, this has helped a lot.

You might also run a: docker-compose rm -f afterwards before starting up again.

I put it with a leading comma, of course, and used docker-compose down command. Is this wrong command? Should I use docker-compose rm -f instead?

When doing any changes to volumes I usually do the whole thing to be safe:

docker-compoes down
docker-compose rm -f
docker-compoes up

But it’s a good idea to look it up if all of that is really required.
Anyway, if simply stopping the Devilbox did not make any difference for you, you should give it a try.

Thanks! I have tried. Unfortunately, no difference.

OK, good to know, but still strange as it should really give you some performance boosts. I guess your current chance is now docker-sync. If you happen to make any progress there, please let me know.

I was looking for a hi speed local dev environment on Windows 10 and found DevilBox. I tried DevilBox as virtual machines with VirtualBox and Hyper-V and was disappointed about performance working with big websites such as Shopware. Some days ago I discovered WSL2 and this changed everything! With WSL2 you get a full Linux machine integrated in Windows 10.
So, if you use Windows 10 you can get a super fast development stack and forget about VirtualBox etc…
In short:
Install Windows 10 Pro Insider Preview last Build (now 190830)
Activate WSL2 as default and install a Linux Distro from Microsoft Store (i.e. Ubuntu 18.04).
Install all necessary packages on Ubuntu, including Docker. This is very important moment. You can install a special version of Docker which works with WSL2 on Windows side but in this case, the system will be very slow! So, install everything in WSL2.
You will get a nice, hi speed development environment installed on Linux with the possibility to work from both sides (Linux and WIndows).
DevilBox installed on WSL2 is fantastic!

here some info how to:

1 Like