1. I started to think about latency in the host machine. Looking for "slow DNS” 
and OSX I find information on IPV6 and how its best to turn it off. In System 
Preferences / Network / Advanced / TCP/IP, you chose this and Apply.



This cut latency in Wordpress under Vagrant from 8s to 4s.

2. I then went looking for IPV6 in the VM. Executing these commands in SSH for 
the VM cut latency from 4s to 2.8s:

sudo sysctl -w net.ipv6.conf.all.disable_ipv6=1
sudo sysctl -w net.ipv6.conf.default.disable_ipv6=1

3. I’m not sure if this change survives a reload. So I’m looking for a 
permanent fix. Alvaro Miranda Aguilera mentioned in a 2015 thread here a 
solution to this, but I don’t understand it. It involves editing 
/etc/sysctl.conf but I don’t know how to do that. I’ll try to Google that.

4. Changing natdns settings to “off” in my Vagrantfile seemed to help:

v.customize ["modifyvm", :id, "--natdnsproxy1", "off" ]
v.customize ["modifyvm", :id, "--natdnshostresolver1", "off" ]

5. I saw something on Github that seems related:

try adding options single-request-reopen to your /etc/resolv.conf

RH tries both ipv4 and ipv6 resolve queries over the same socket, and the ipv6 
can take some time to time out. The above option makes your system open a new 
connection for each request.

Trying to figure out how to do that.


> On Jul 23, 2017, at 6:01 PM, Ian Robert Douglas 
> <[email protected]> wrote:
> 
> I still have this problem if anyone can jump in. Developing Wordpress is now 
> painful locally. In fact, it's faster to develop from a live server! The 
> latency on clicks is around 8-9 seconds consistently when working under 
> Vagrant. My life would change significantly for the better if I could get it 
> to 1 second.
> 
> 
> On Wednesday, July 5, 2017 at 8:32:31 PM UTC+2, Ian Robert Douglas wrote:
> Attempting to answer my own question ………….. I commented out my previous NFS 
> shared folder line in my Vagrantfile and added this:
> 
>     config.vm.synced_folder ".", "/var/www", type: "rsync", rsync__exclude: 
> ".git/", rsync__auto: true
> 
> 
> I also installed the vagrant-gatling-rsync plugin because someone in a 
> comment on a page said it helped.
> 
> I notice that when the action happens, it seems to happen faster now. But I 
> still have about a 7s latency.
> 
> All this is under the latest Virtualbox, with KVM paravirtualisation, SSD 
> drive, low number of processors (apparently it’s better that way than the 
> logic of maxing it out), etc.
> 
> 
> Here is my waterfall for wp-admin:
> 
> 
> 
> 
> You can see clearly the very long (7s) lag and then everything happens 
> superfast.
> 
> Life would be perfect if I could get rid of the lag.
> 
> But I don’t know if it’s possible.
> 
> 
> Anyone?
> 
> best wishes,
> ian
> 
> 
> 
>> On Jul 5, 2017, at 4:25 PM, Ian Robert Douglas <[email protected] 
>> <mailto:[email protected]>> wrote:
>> 
>> Hi,
>> 
>> I use Vagrant to develop Wordpress builds locally and then get them online. 
>> I use Scotchbox. I'm seeing latency of 7-12 seconds in wp-admin, and it's 
>> driving me nuts.
>> 
>> I've read around the issue, and it seems that rsync can help get speeds of 
>> under 1s.
>> 
>> This is about all I know. I can comment out lines in a Vagrantfile and I 
>> know how to reload Vagrant. Beyond that, I know nothing.
>> 
>> I don't understand anything about what rsync is for where it lives or how to 
>> enable it or what the pitfalls of using it are.
>> 
>> I need someone to explain in baby steps what to do.
>> 
>> I'm really sorry. I know that much be frustrating for devs. I'm a designer. 
>> My brain just can't process code, beyond absolute basics. I try, but I'm 
>> lost.
>> 
>> Can someone help?
>> 
>> Basically I want to use rsync instead of NFS, to try to speed up Wordpress 
>> on Vagrant to a level that is bearable.
>> 
>> 
>> Thanks in advance for any help,
>> ian
>> 
>> -- 
>> This mailing list is governed under the HashiCorp Community Guidelines - 
>> https://www.hashicorp.com/community-guidelines.html 
>> <https://www.hashicorp.com/community-guidelines.html>. Behavior in violation 
>> of those guidelines may result in your removal from this mailing list.
>>  
>> GitHub Issues: https://github.com/mitchellh/vagrant/issues 
>> <https://github.com/mitchellh/vagrant/issues>
>> IRC: #vagrant on Freenode
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "Vagrant" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected] 
>> <mailto:[email protected]>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/vagrant-up/5c10459b-6155-4273-aef2-557ce6117925%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/vagrant-up/5c10459b-6155-4273-aef2-557ce6117925%40googlegroups.com?utm_medium=email&utm_source=footer>.
>> For more options, visit https://groups.google.com/d/optout 
>> <https://groups.google.com/d/optout>.
> 
> 
> -- 
> This mailing list is governed under the HashiCorp Community Guidelines - 
> https://www.hashicorp.com/community-guidelines.html 
> <https://www.hashicorp.com/community-guidelines.html>. Behavior in violation 
> of those guidelines may result in your removal from this mailing list.
>  
> GitHub Issues: https://github.com/mitchellh/vagrant/issues 
> <https://github.com/mitchellh/vagrant/issues>
> IRC: #vagrant on Freenode
> --- 
> You received this message because you are subscribed to the Google Groups 
> "Vagrant" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected] 
> <mailto:[email protected]>.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/vagrant-up/64576a63-6c74-45bc-a4c4-9789b7dac4b1%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/vagrant-up/64576a63-6c74-45bc-a4c4-9789b7dac4b1%40googlegroups.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout 
> <https://groups.google.com/d/optout>.

-- 
This mailing list is governed under the HashiCorp Community Guidelines - 
https://www.hashicorp.com/community-guidelines.html. Behavior in violation of 
those guidelines may result in your removal from this mailing list.

GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
--- 
You received this message because you are subscribed to the Google Groups 
"Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vagrant-up/E9510B36-3228-486B-8ECE-C78B8CC6DDB9%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to