I maintain another vagrant package for my project and found this snippet from someone complaining about Vagrant performance of VMs. This formula works pretty well for contextually allocating memory and processor cores based on the system its running on. Drastic increase for my boxes.

https://github.com/btopro/elmsln-vagrant/blob/master/Vagrantfile#L36

Comments

alexiswatson’s picture

Loving the concept of this! My only concern off the top of my head is what happens when cpus and mem are smaller than what Undine needs to function, and how to scale MySQL memory allocation (if we want to scale it at all out of the box). May be a non-issue, but something to look into.

Come to think of it, this may be one of those places where a configuration builder/installer may come in handy (#2271871: Improve Undine's initial setup and configuration): it should be intuitive for people to set their own --memory if they want to, but we should also provide sane defaults based on what they have, much in the same way we're looking to do for NFS and the like.

alexiswatson’s picture

Title: Vagrant performance » Dynamically scale Vagrant resource allocation based on host's resources

Making the issue title more Google-friendly. Pay no attention to the engineer behind the curtain.

alexiswatson’s picture

Been kicking this around a bit: we could just take the larger of 1/4 RAM and 1024MB if we want to set clear minimum requirements. That way we make sure the VM isn't going to thrash about on a weaker config (though it'll obviously still be slow), while still providing sane defaults for those machines with a bit more kick to them. Thoughts?

btopro’s picture

I like that idea a lot; I can't take credit for what I added into that vagrant file so if you have ideas -- http://www.stefanwrobel.com/how-to-make-vagrant-performance-not-suck

alexiswatson’s picture

Sounds good; thanks for the link! Contacted @swrobel to ask if it was cool to use it (one of the biggest reasons Undine reinvents certain things is license compatibility, and I would like to keep it hosted here as long as possible). Failing that, it's no big deal to whip something up.

alexiswatson’s picture

Just got permission to use it here, will whip up a patch sometime today or tomorrow. For the sake of completeness: https://twitter.com/swrobel/status/474346633543819264

alexiswatson’s picture

Status: Active » Fixed

Sorry for the massive delay on this, lots of restructuring in the past several months and my time spent in front of an IDE has been all but non-existent until very recently.

Finally had the opportunity to circle back and test this, and it's now committed. Thanks again!

  • davidwatson committed 5418c78 on 7.x-1.x authored by btopro
    Issue #2278447 by btopro, davidwatson: Added dynamic RAM and CPU core...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.