2017-01-17 7 views
0

私はいくつかの環境をホストするために迷路を使用しています。数週間前、パワーサージが急激に働いていたVMを破壊しました。バックエンド開発者が私に新しいヴァガントールファイルを作りましたが、それは非常に遅いです。 drush cc allを実行すると、私がサポートしている最大のサイトで最大10分かかることがあります。私は数多くのソリューションを試しましたが、どれも役に立たなかった。前向きページの読み込みは、管理ページの読み込みよりはるかに高速です。 drushとgitを使うことも非常に遅いです。ここでVagrant + Drupal Running非常に遅い

は私のVagrantfileです:私が見た

Vagrant.configure(2) do |config| 

    config.vm.provider "virtualbox" do |vb| 
      vb.memory = "4096" 
    end 

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

    config.vm.network "private_network", ip: "192.168.33.10" 

    config.vm.synced_folder "www", "/var/www", 

    # config.vm.synced_folder "./", "/var/sites/dev.query-auth", id: "vagrant-root" 
    owner: "vagrant", 
    group: "www-data", 
    mount_options: ["dmode=775,fmode=664"] 


    config.vm.provision "fix-no-tty", type: "shell" do |s| 
    s.privileged = false 
    s.inline = "sudo sed -i '/tty/!s/mesg n/tty -s \\&\\& mesg n/' /root/.profile" 
    end 

    config.vm.provision :shell, path: "provision.sh" 

end 

共通修正がtrueにNFSを設定しているが、それはパフォーマンスに影響を及ぼしません。私のパフォーマンスを改善する方法についてのヒントは非常に役立つでしょう。

答えて

0

ここは私のもので、かなりうまく機能します。それを使用してみるか、それらを組み合わせてください。

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

# Vagrantfile API/syntax version. Don't touch unless you know what you're doing! 
VAGRANTFILE_API_VERSION = "2" 

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| 

    # Every Vagrant virtual environment requires a box to build off of. 
    config.vm.box = "ubuntu/trusty64" 

    # Create a private network, which allows host-only access to the machine using a specific IP. 
    config.vm.network "private_network", ip: "192.168.33.22" 

    # Share an additional folder to the guest VM. The first argument is the path on the host to the actual folder. 
    # The second argument is the path on the guest to mount the folder. 
    config.vm.synced_folder "./", "/var/www/html", nfs: true 

    # Define the bootstrap file: A (shell) script that runs after first setup of your box (= provisioning) 
    config.vm.provision :shell, path: "bootstrap.sh" 

config.vm.boot_timeout = 3000 

config.vm.provider "virtualbox" do |v| 
    # v.gui = true 
    v.memory = 3072 
    v.cpus = 2 
end 


end 
+0

nfsがtrueに設定されていて、2つのCPUコアを割り当てている以外は、違いはほとんどありません。私は実際にこれらのオプションの両方を試してみましたが、Vagrantのパフォーマンスを向上させるものでもありません。 – Kellen

+0

ええと...それはこの設定ではありません。 – MilanG