HestiaCP is an actively developed fork of popular VestaCP, whos development somewhat stalled in the last little while.
This guide in ispired by excelent post on the official HestiaCP forum by user desp:
How to optimize memory and speed?
Here are three easy steps:
1. Determine hosting/server provider speed
Use excelent YABS script to determine the speed of your hosting solution.
*Geekbench 6 update: since 27 Feb 2023 update YABS uses Geekbench 6 as default benchmark – we’ll use flag -5 to run version 5 so we can compare the results.
# Full GB6 test
wget -qO- yabs.sh | bash
# Full GB5 test
wget -qO- yabs.sh | bash -s -- -5
Or if you just want Geekbench score (skipping disk (fio) -f and network (iperf) -i tests):
# GB6 score only (no disk and network)
wget -qO- yabs.sh | bash -s -- -fi
# GB5 score only (no disk and network)
wget -qO- yabs.sh | bash -s -- -fi5
Test will return something like this:
Geekbench 5 Benchmark Test:
---------------------------------
Test | Value
|
Single Core | 832
Multi Core | 867
Full Test | https://browser.geekbench.com/v5/cpu/<test_id_number>
CPU Single Core score
Single core performance is the score we are interested in:
| GB 5 | GB 6 | Rating |
| 1000 or more | 1200 or more | π₯π₯π₯ Great core performance, very good provider |
| 700 – 1000 | 850 – 1200 | βοΈβοΈ Normal performance, okay provider |
| 500 – 700 | 650 – 850 | βοΈ Normal performance, can be better |
| 500 or less | 650 or less | β Awful performance, avoid the provider |
Keep in mind, it’s the performance and page speed we’re after, if this is storage/backup optimized server with SAS (spinning) drives, lower numbers are completly accaptable.
Disk IOPS
Disk performance (IOPS):
fio Disk Speed Tests (Mixed R/W 50/50):
---------------------------------
Block Size | 4k (IOPS) | 64k (IOPS)
------ | --- ---- | ---- ----
Read | 22.76 MB/s (5.6k) | 173.71 MB/s (2.7k)
Write | 22.76 MB/s (5.6k) | 174.62 MB/s (2.7k)
Total | 45.52 MB/s (11.3k) | 348.33 MB/s (5.4k)
| |
Block Size | 512k (IOPS) | 1m (IOPS)
------ | --- ---- | ---- ----
Read | 170.55 MB/s (333) | 213.61 MB/s (208)
Write | 179.61 MB/s (350) | 227.84 MB/s (222)
Total | 350.16 MB/s (683) | 441.45 MB/s (430)
| Total 4k IOPS | Typical Storage Type | Rating and Real-World Web Stack Impact |
| 100k or more | Dedicated Enterprise NVMe / Gen4+ NVMe | ππππ Instantaneous database queries under heavy concurrent traffic (e.g., busy WooCommerce stores, large forums). Zero I/O wait. |
| 40k β 100k | Good Cloud NVMe (e.g., Hetzner, Vultr HF, DigitalOcean Premium) | π₯π₯π₯ Handles high traffic, complex PHP apps, and heavy database writes without breaking a sweat. |
| 10k β 40k | Standard Cloud NVMe / Good SATA SSD | βοΈβοΈ Fine for most standard WordPress sites, blogs, and moderate business traffic. Might feel slightly sluggish during backups or heavy admin tasks. |
| 3k β 10k | Throttled Cloud Block Storage / Budget SSD | βοΈ Acceptable only for low-traffic sites or sites heavily relying on full-page caching (like Cloudflare or Redis) to avoid touching the disk. |
| 3k or less | HDD / Oversold Shared Storage / Network Storage | β Noticeable lag, slow Time to First Byte (TTFB), database locks, and high CPU “I/O Wait” (wa% in top) during traffic spikes. |
Web servers, PHP, and databases rely heavily on small, random operations rather than large sequential file transfers.
Which Block Size Matters for Your Stack?
- 4k (Most Critical): MariaDB (InnoDB) reads and writes data in 16k pages, while Linux filesystem operations, PHP session handling, and uncached small assets rely on 4k random I/O. High NVMe storage IOPS will keep database queries and dynamic PHP execution snappy.
- 64k (Secondary): Relevant for slightly larger database sequential scans, medium-sized static assets (CSS, JS bundles, small images), and PHP opcode cache misses.
- 512k & 1m (Least Relevant for Page Load): These measure sequential throughput. Unless your site serves large video files, software downloads, or handles massive uncached media uploads, these numbers won’t noticeably impact standard webpage response times (TTFB). They mainly help during server backups or large database dumps.
Key Caveats for Web Performance
- Reads Matter More Than Writes: Most websites are 80%β95% read-heavy.
- RAM Caching Overrides Disk Speed: If MariaDB’s
innodb_buffer_pool_sizeand Nginx/Apache caching are properly tuned, most frequent queries and assets will be served directly from RAM, bypassing disk I/O altogether. - Diminishing returns above 50k: For 95% of websites, upgrading from 65k IOPS to 150k IOPS will not result in a noticeable difference in page load speed. Bottlenecks are much more likely to be single-core CPU speed (for PHP execution) or unoptimized database queries.
RAM size is not as important unless you’re on tiny VPS running into heavy swapping.
Now that we established our KVM VPS / dedi server is fast enough, we can move on to the next step.
2. Lean HestiaCP install
Classic installation of hestiaCP will result in good enough general setup, that works for most, but it costs us performance. It uses Apache as webserver and Nginx only for caching proxy. Apache is slow.
So let’s trim of the fat and install only
Nginx + PHP + MySQL/MariaDB – without Apache.
Let’s use the handy Install string 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 yes --proftpd no --named no --mysql yes --postgresql no --exim yes --dovecot no --sieve no --clamav no --spamassassin no --iptables yes --fail2ban yes --interactive yes
This will give us minimal installation, without BIND (DNS), and only EXIM as mailing solution and vsftpd.
3. Set WordPress template and caching
Login to control panel and your user.
Set tamplate
- Edit Web domain β Advanced Options β Web Template β WordPress
Set Fast CGI caching
For small presentation style sites with not a lot of changing content, Fast CGI can be more than enough.
- Enable Fast CGI Cache
- Set Cache duration β 5m, 10m
(if you have a lot of dynamic content, you can try microcache of 30s).
Or implement full Redis cache
For more complex websites or ecommerce sites, Redis is recommendet.
It is a bit more work and requires either that your hosting provider offers Redis or that you have root access to your VPS. If that’s the case, it takes about 5 minutes to implement.
Install Redis on your VPS (example for Ubuntu):
apt update
apt install redis-server
systemctl enable redis-server
Edit the Redis configuration /etc/redis/redis.conf and set the maximum memory size (adjust accordingly if your machine has more RAM and your load requires it) and memory policy:
maxmemory 256M
maxmemory-policy allkeys-lru
Save the changes and restart the Redis server to apply the new configuration:
systemctl restart redis-server
Install PHP Extension:
apt install php-redis
If you have multiple PHP-FPM versions installed, install them each individually (ie. for PHP 8.4):
apt install php8.4-redis
Enable the module (again example for PHP 8.4):
phpenmod -v 8.4 -s ALL redis
Now on to your WordPress website, open wp-config.php file and add the following code to authenticate the key (replace mysite with your unique string for this site, so Redis can keep the caches apart if you’re running more then one website on the same machine):
define('WP_CACHE_KEY_SALT', 'mysite');
define('WP_CACHE', true);
Next, install the Redis Object Cache plugin. It installs a PHP script that helps WordPress communicate with Redis.
After installing the plugin, you need to enable it by navigating to Setting > Redis and Enable Object Cache button. Status should show Connected. If not, ensure you have added the configuration to the wp-config.php file above.
That’s it on the HestiaCP side, now your website should be crazy fast. For further optimisations, look into optimizing WP plugins and theme code.
Thank you for writing this post!
Thanks for your help and for writing this post. Itβs been great.
is it still work for newest hestiacp ..
Yes, it still works, currently tested on latest v1.8.8.
Hi, i’ve follow the tutorial. Thanks for this.
But if i want to use docker and containers how can i use these templates to forward to a specific port? I was using hestiacp with apache and used the nginx templates to point to container port in a sub domain.
server {
listen %ip%:%proxy_ssl_port% ssl http2;
server_name %domain_idn% %alias_idn%;
ssl_certificate %ssl_pem%;
ssl_certificate_key %ssl_key%;
ssl_stapling on;
ssl_stapling_verify on;
error_log /var/log/%web_system%/domains/%domain%.error.log error;
include %home%/%user%/conf/web/%domain%/nginx.hsts.conf*;
location / {
proxy_set_header Connection ”;
chunked_transfer_encoding off;
proxy_buffering off;
proxy_cache off;
proxy_pass http://%ip%:8003;
location ~* ^.+\.(%proxy_extentions%)$ {
proxy_set_header Connection ”;
chunked_transfer_encoding off;
proxy_buffering off;
proxy_cache off;
root %sdocroot%/home/user/web/xxx.xxxx.xxx/public_html;
access_log /var/log/%web_system%/domains/%domain%.log combined;
access_log /var/log/%web_system%/domains/%domain%.bytes bytes;
expires max;
try_files $uri @fallback;
}
}
location /error/ {
alias %home%/%user%/web/%domain%/document_errors/;
}
location @fallback {
proxy_set_header Connection ”;
chunked_transfer_encoding off;
proxy_buffering off;
proxy_cache off;
proxy_pass http://%ip%:8003;
}
location ~ /\.ht {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
location ~ /\.bzr/ {return 404;}
include %home%/%user%/conf/web/%domain%/nginx.ssl.conf_*;
}
You can copy the default templates and modify the new version to your need.
Further details can be found in the official docs:
https://hestiacp.com/docs/server-administration/web-templates.html