Vagrant + puppet + mysql + php非常慢

我刚刚为我的开发人员环境创建了一个带有virtualbox的流浪汉机器,但对于那些使MySQL查询执行的页面 非常慢。</ p>

我正在使用MySQL 5.6和PHP 5.6。</ p>

下面的我的Vagrantfile:</ p>

 # -  *  -  mode:ruby  -  *  -

#vi:set ft = ruby​​:

Vagrant.configure(“2”)do | config |

#Box
config.vm .box =“ubuntu / trusty64”

#Network
config.vm.network:private_network,ip:“192.168.33.10”
config.vm.network“forwarded_port”,guest:80,host:8080, auto_correct:true

#Shared Folder
config.vm.synced_folder“/ vagrant / guest / var / www”,“/ var / www”,owner:“www-data”,group:“www-data” ,
mount_options:[“dmode = 777,fmode = 777”]

config.vm.network:forwarded_port,guest:3306,host:3306

#Provider
config.vm.provider“virtualbox “do | v |
v.memory = 1024
v.cpus = 2
v.cpuexecutioncap = 90
end

#Provision(Puppet)
config.vm.provision:puppet do | pu PPET |

puppet.module_path =“puppet / modules”
puppet.manifests_path =“puppet / manifests”
puppet.manifest_file =“base.pp”
end

end
</ code> </ pre>

</ div>

展开原文

原文

I'm just created a vagrant machine with virtualbox for my developer environment, but for pages who make MySQL queries the execution is very slow.

I'm using MySQL 5.6 and PHP 5.6.

My Vagrantfile below:

# -*- mode: ruby -*-
# vi: set ft=ruby :

Vagrant.configure("2") do |config|

  # Box
  config.vm.box = "ubuntu/trusty64"

  # Network
  config.vm.network :private_network, ip: "192.168.33.10"
  config.vm.network "forwarded_port", guest: 80, host: 8080, auto_correct: true

  # Shared Folders
  config.vm.synced_folder "/vagrant/guest/var/www", "/var/www", owner: "www-data", group: "www-data", 
    mount_options: ["dmode=777,fmode=777"]

  config.vm.network :forwarded_port, guest: 3306, host: 3306 

  # Provider
  config.vm.provider "virtualbox" do |v|
    v.memory = 1024
    v.cpus = 2
    v.cpuexecutioncap = 90
  end

  # Provision (Puppet)
  config.vm.provision :puppet do |puppet| 
    puppet.module_path  = "puppet/modules"
    puppet.manifests_path = "puppet/manifests" 
    puppet.manifest_file = "base.pp" 
  end 

end

dongpu3792
dongpu3792 你有什么设置你的域名?你在使用.local或.dev还是别的什么?如果您想使用内部DNS,可能会遇到外部DNS,请参阅有关serverfault的好文章-serverfault.com/questions/478365/routing-a-host-to-vagrant
5 年多之前 回复
dongshi3818
dongshi3818 客户端和主机之间存在网络延迟,因为您将看到是否使用浏览器的调试工具来查看性能
5 年多之前 回复
dongqian5639
dongqian5639 vm在localhost上运行,因此没有网络延迟。
5 年多之前 回复
douweng7308
douweng7308 并且puppet不会影响代码的执行速度,它可以配置VM....一旦配置了VM,puppet再没有什么可做的,直到下次再次启动VM
5 年多之前 回复
dongzao9044
dongzao9044 什么慢?来宾与主机之间的网络延迟?PHP执行?数据库访问?
5 年多之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问
相关内容推荐