How to optimize memory and speed?

Universal guide:
1.) GitHub - masonr/yet-another-bench-script: YABS - a simple bash script to estimate Linux server performance using fio, iperf3, & Geekbench

wget -qO- yabs.sh | bash

You must to have more than this:

Geekbench 5 Benchmark Test:
---------------------------------
Test            | Value                         
                |                               
Single Core     | 468                           
Multi Core      | 456                           
Full Test       | https://browser.geekbench.com/v5/cpu/6936264

I.e. Single core > 800 = normal, okay performance.
More than 1000 = great core performance. I.e. very good provider.
< 700, but > 500 = normal, but can be better.
< 500 = awful provider, avoid the provider at all costs.

The rest part related to disk:

  • must be ssd / nvme with high iops. High = how much is that? > 1.000

That’s from where everything starts: CPU performance & Disk performance.
RAM not really important. Ram = it’s fast, and there can’t be so much issues in 2022. I mean i can write long story about ram, but in short - ram not important.

When you have fast enough KVM VPS or dedi server you can go to next step:

2.) classic installation of hestiaCP by command on website - will result in “for all solutions good setup, but in cost of performance”. I do not like it. It’s slow. Apache always slow. I hate apache. It’s sucks.

But what to do?
hestiaCP great, and can help you to install nginx + php + mysql/mariadb without apache.

How to do that?
https://gabizz.github.io/hestiacp-scriptline-generator/

For example:

wget https://raw.githubusercontent.com/hestiacp/hestiacp/release/install/hst-install.sh

sudo bash hst-install.sh --apache no --phpfpm yes --multiphp no --vsftpd no --proftpd no --named no --mysql yes --postgresql no --exim yes --dovecot yes --sieve no --clamav no --spamassassin no --iptables yes --fail2ban no --quota no --api yes --interactive yes --hostname no --email no --password no --with-debs no  --port '8083' --lang 'en'   

This is just example. Try to play with settings, maybe you find your best. I do not need anything else. So it’s pretty minimal installation.

When you will setup that, you will have nginx + php (latest version) + mysql (or mariadb, does not matter).

3.) Login to control panel, to your user.
Edit web domain → Advanced Options → Web Template → Wordpress.
cache duration → 5m, 10m, whatever. If you have a lot of dynamic content, you can make microcache. I.e. write there 30s. It will be great too. I like 10m.

4.) Now your website will be crazy fast. Not need to install any caching plugins, whatever. ALl of them sucks.

If you wanna add extra important changes, i suggest to:

  • remove 3rd party code which loaded from 3rd party domains (chat widgets, help desks, analytics, fonts, images from 3rd party domains, etc)
  • you can install autoptimzie to concatanate all resources into one to reduce requests
  • not much else can be done without deep understanding about your website

5.) if everything above does not help (which is strange)
Enable debug, install debug plugin for your wordpress. Trace delays. Probably can be related to a lot of sql queries.
For such case you can install php-redis & redis plugin. It will be damn fast too because of cached requests.

Hope it will help you.

4 Likes