-
-
Notifications
You must be signed in to change notification settings - Fork 607
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Better VM preformance when using 1 CPU core #410
Comments
Obviously this seems counter to what we'd expect. I don't really have anything to say about this unless other people are also experiencing this. |
I hope other people try this out and let us know. If not, feel free to close the ticket, but at least you've been warned in case that someone else reports this in the future. |
Intel or AMD? |
Intel. I hope to find some time to do consistent testing with Apache's ab tool this week on multiple machines to either confirm or decline this issue. |
I benchmarked roots example project with Apache Benchmark and I can confirm this (OSX 10.10.5, VirtualBox 4.3.30). Results (run with command With
|
Server Software: | nginx | ||
---|---|---|---|
Server Hostname: | roots-example-project.dev | ||
Server Port: | 80 | ||
Document Path: | / | ||
Document Length: | 6416 bytes | ||
Concurrency Level: | 1 | ||
Time taken for tests: | 5.822 seconds | ||
Complete requests: | 20 | ||
Failed requests: | 0 | ||
Total transferred: | 135000 bytes | ||
HTML transferred: | 128320 bytes | ||
Requests per second: | 3.44 | ||
Transfer rate: | 22.64 kb/s received | ||
Connnection Times (ms) | |||
min | avg | max | |
Connect: | 0 | 0 | 3 |
Processing: | 263 | 291 | 566 |
Total: | 263 | 291 | 569 |
With vb.customize ['modifyvm', :id, '--cpus', 1]
Server Software: | nginx | ||
---|---|---|---|
Server Hostname: | roots-example-project.dev | ||
Server Port: | 80 | ||
Document Path: | / | ||
Document Length: | 6416 bytes | ||
Concurrency Level: | 1 | ||
Time taken for tests: | 3.330 seconds | ||
Complete requests: | 20 | ||
Failed requests: | 0 | ||
Total transferred: | 135000 bytes | ||
HTML transferred: | 128320 bytes | ||
Requests per second: | 6.01 | ||
Transfer rate: | 39.59 kb/s received | ||
Connnection Times (ms) | |||
min | avg | max | |
Connect: | 0 | 0 | 2 |
Processing: | 151 | 166 | 358 |
Total: | 151 | 166 | 360 |
More real-world example (more complex theme, couple of plugins installed) was even more problematic:
With vb.customize ['modifyvm', :id, '--cpus', cpus]
Connnection Times (ms) | |||
---|---|---|---|
min | avg | max | |
Connect: | 0 | 0 | 2 |
Processing: | 873 | 930 | 1194 |
Total: | 873 | 930 | 1196 |
With vb.customize ['modifyvm', :id, '--cpus', 1]
Connnection Times (ms) | |||
---|---|---|---|
min | avg | max | |
Connect: | 0 | 0 | 2 |
Processing: | 230 | 333 | 687 |
Total: | 230 | 333 | 689 |
I pinged @swrobel over twitter. It would be great to have him elaborate on this, as AFAIK you guys added these Vagrantfile 'improvements' after this blogpost. |
Moreover, I experience the same issues on linux machine as well. |
@primozcigler really interesting findings. I suppose in my post, I take for granted that more cpus = better performance, or at least that it won't cause worse performance. One thing to note is that you didn't test concurrency - not that is a typical concern in development contexts. I used wrk for my NFS vs VirtualBox sharing benchmarks because it's supposed to better emulate real-world traffic than |
@swrobel thanks for stopping by 😃 I could use wrk as well, but I can tell the performance slowdown is noticeable even when developing - without benchmarks. |
Figured I'd test this out myself. I'm a bit dubious of how much these benchmarks matter and they definitely aren't rigorous or anything. I timed CPUS: 4 (
|
Fixes #410 - Default to 1 CPU in Vagrant
@primozcigler thanks for bringing this up. Finally went with 1 as the default. |
My pleasure. |
Hi there,
I had an issue with the local VM (VirtualBox), when the server was responding slowly. I moved the WP network from my previous VM.
The TTFB on the previous VM was around 500ms for the HTML to get back. The stack was pretty much the same (nignx + php-fpm, mariadb).
When I copies the files to the Trellis and dumped the DB, the TTFB increased to around 1500ms - 2000ms. This was unexpected and I couldn't tolerate such deplay during dev, as page is refreshed frequently. I decided to compare the config to find the problem that introduced the delay. Started with php-fpm, went to nginx, mariadb and at the end even tried to disable some extensions like xdebug. Nothing made any significant difference.
I almost gave up at the end, when I remembered to check the Vagrantfile as well. I experimented a bit with various settings and at the end I figured out very interesting thing: if I comment out the
vb.customize ['modifyvm', :id, '--cpus', cpus]
which sets the number of cores for VM, the TTFB drops down to 500-600ms for each request => ~4x perf. boost.I would like other to get some feedback regarding this and would like to see if anyone else can test this out and confirm the same strange behavior?
The problem is more apparent in more complex WP stacks, with multiple heavy plugins like WooCommerce, Page Builder by SiteOrigin and all the plugins that heavily rely on filters, like simple lightbox.
I am on Linux now, but I experienced the same problem on Mac as well.
Related #62.
The text was updated successfully, but these errors were encountered: