Question
Help optimizing the server for Wordpress (Ubuntu + Nginx + Varnish)
Hi, I'm trying to optimize my server and would be great if someone could help me with the best configuration. The server will be used only to host Wordpress sites (multiple domains), currently I'm using a 2 core/ 2Gb droplet with Ubuntu 12.04 x64 + Nginx + Varnish.
Here are my configs so far:
-------------Nginx-------------
user www-data;
worker_processes 4;
pid /var/run/nginx.pid;
events {
worker_connections 768;
}
http {
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
port_in_redirect off;
server_names_hash_bucket_size 64;
include /etc/nginx/mime.types;
default_type application/octet-stream;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
gzip on;
gzip_disable "msie6";
}
----------------------------------
-------------Varnish-------------
START=yes
NFILES=131072
MEMLOCK=82000
DAEMON_OPTS="-a :80 \
-T localhost:6082 \
-f /etc/varnish/default.vcl \
-S /etc/varnish/secret \
-s malloc,1500m"
----
.connect_timeout = 600s;
.first_byte_timeout = 600s;
.between_bytes_timeout = 600s;
.max_connections = 800;
set req.grace = 2m;
set beresp.grace = 2m;
----------------------------------
Is this ok? Am I missing something? Can I improve it?
I read some people saying that I could use 'file' instead of 'malloc' on varnish to take advantage of the SSD disks, would it be better?
Thank you, any thoughts would be really appreciate.
Add a comment
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
×