簡體   English   中英

WordPress在無用的虛擬機上運行非常慢

[英]Wordpress running very slow on a vagrant virtual machine

我已經用ubuntu,php,nginx和mysql設置了一個無聊的虛擬機來運行wordpress網站。

問題是插槽運行非常頻繁,我通常會收到502錯誤的網關錯誤。 我還在Mac中使用Mamp配置了該站點,運行速度快了4倍。

關於如何提高虛擬機性能的任何想法?

這是我的Nginx配置文件:

server {
listen 80;
server_name {{www_domain}};
root   {{www_document_root}};
index index.php;

access_log  /var/log/nginx/{{phpmyadmin_domain}}.access.log;
error_log  /var/log/nginx/{{phpmyadmin_domain}}.error.log error;

# serve static files directly
location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt)$ {
    access_log        off;
    expires           max;
}

location / {
    try_files $uri $uri/ /index.php?q=$uri&$args;
}

location ~ .php$ {
    try_files $uri =404;
    fastcgi_pass unix:/var/run/php5-fpm.sock;
    include fastcgi_params;
    fastcgi_index  index.php;
    fastcgi_param  SCRIPT_FILENAME $document_root$fastcgi_script_name;
    fastcgi_intercept_errors on;
    fastcgi_buffer_size 64k;
    fastcgi_buffers 16 64k;
}}

這是VagrantFile配置:

嘗試增加VM可以訪問的內存和CPU數量:

config.vm.provider "virtualbox" do |v|
  # Customize the amount of memory on the VM:
  v.memory = 2048
  v.cpus = 2
end

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM