[Cialug] mariadb and wordpress tuning
Nicolai
nicolai+cialug at chocolatine.org
Sat May 30 18:29:40 UTC 2020
On Sat, May 30, 2020 at 07:13:17AM -0500, Dave Weis wrote:
> Hi All-
>
> I'm trying to improve my wife's web site speed ( www.gogoyogakids.com )
> Any ideas what to check next? I've been using the load speed graph in
> chrome to do the testing/monitoring.
I would start with PHP caching. If you haven't enabled this already,
adapt this from nginx into your Apache config, browse the site a bit to
stuff the cache, and see if that helps.
fastcgi_cache BLAH;
fastcgi_cache_path /var/www/phpcache levels=1:2 keys_zone=MYAPP:100m inactive=24h;
fastcgi_cache_valid 200 24h;
fastcgi_cache_methods GET HEAD;
add_header X-Cache $upstream_cache_status;
This calls your cache BLAH, applies to http status code 200 for 24
hours, and caches GET and HEAD (not e.g. POST). Finally it adds a header
so you can see if your PHP is getting cached.
It's fun to run "curl -I" twice against a fresh cache. The first hit
takes a long time and shows x-cache MISS, while the second is fast and
shows x-cache HIT. Similarly, running a mass wget against the site,
uncached, pins the CPU, while cached does not.
So I find that PHP caching significantly improves performance.
If you get two cache misses in a row, there's probably a Wordpress
plugin interfering with caching.
Nicolai
More information about the Cialug
mailing list