首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >流浪+ Drupal运行速度极慢

流浪+ Drupal运行速度极慢
EN

Stack Overflow用户
提问于 2017-01-17 21:59:39
回答 1查看 124关注 0票数 0

我正在使用vagrant托管几个环境。几周前,一次电涌毁掉了我的VM,它工作得很好。一个后端开发人员为我创建了一个新的Vagrantfile,但它的速度太慢了。在我支持的最大的站点上运行drush cc all可能需要10分钟。我尝试了许多解决方案,但都没有起到作用。值得注意的是,加载正面页面比加载管理页面要快得多。使用drush和git也非常慢。

这是我的Vagrantfile:

代码语言:javascript
复制
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

我见过的一种常见的修复方法是将NFS设置为true,但这对性能没有影响。任何关于如何提高我的表现的提示都是非常有帮助的。

EN

回答 1

Stack Overflow用户

发布于 2017-01-17 23:36:58

这是我的,工作得很好。尝试使用它,或者结合使用这两种方法。

代码语言:javascript
复制
# -*- 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
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/41699076

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档