Hey folks. A couple of you have come to me with problems saying that the vagrant VM is very slow. There are three reasons for this, mostly because needing to turn on debugging for new users is a bit trickier than turning off debugging.

  • Apache is running only one thread. The reason for this is to be able to attach a debugger to that thread or to run Devel::NYTProf to figure out where things are slow. You can adjust this by editing /etc/apache2/apache2.conf and setting the servers to something a bit more sane, like:
    <IfModule mpm_prefork_module>
            StartServers         4
            MinSpareServers      4
            MaxSpareServers      4
            MaxClients           4
            MaxRequestsPerChild  4000
  • The VM is execution capped to 50% of available CPU. This is to make sure that the machine doesn't chew through every ounce of foreground power if like me, you leave it running. In the Vagrantfile:
      config.vm.provider :virtualbox do |vb|
        vb.customize ["modifyvm", :id, "--cpuexecutioncap", "50"]
        vb.customize ["modifyvm", :id, "--memory", 1024]
    You can tweak those to be a bit more sane for your environment
  • Root is not using the S3 CDN. Because the default account I am using is root (because it exists and you can log in, etc), I've put in the setting (useRawStylesheets), which I believe means to use local, non-minified, non-gzipped, non-cached stylesheets and javascript snippets. You can change this by going to (once logged in): http://localhost:8888/user/root?displaytype=editvars and shutting that setting off. This is mostly caused by the Apache threads (see the first item) going into contention and waiting to serve your first requests (Page, CSS, Javascript) before your page can finish rendering. We're going to need to clean up our Javascript so that it's always one file, but for now, we're inefficient
Best of debugging!

Log in or registerto write something here or to contact authors.