Hi,
I have a 4GB Raspberry Pi 4 and I have mounted a LEMP server, with a domain in Namecheap, following this guide: https://www.techcoil.com/blog/how-to-host-a-wordpress-website-on-a-raspberry-pi-with-raspbian-buster-lite-and-nginx/
Right now, we have a clean WordPress installation without installing additional plugins or themes.
The error we are having is that when trying to access the web, sometimes it gives a Timeout error, and at other times it works fine. It usually happens on the first connection, and once the main page loads, you can move through the menus and load quickly.
For testing, one way to check is with PageSpeed Insights, and it usually gives “FAILED_DOCUMENT_REQUEST” error or takes a long time to load “Speed Index”.
The website is https://dualbix.com
Any ideas?
Thank you.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hi there @dualbix,
There are a few things which could be causing the problem:
I can see that your WordPress installation is now up and running. Would you mind sharing here with the community how did you get this to work?
Regards, Bobby
The intermittent timeout and slow-loading issues you’re experiencing with your WordPress site on a Raspberry Pi 4 LEMP server could stem from various factors, particularly performance limitations and configuration. Here’s a comprehensive approach to troubleshoot and resolve these issues:
Raspberry Pi 4 has limited resources (4GB RAM, ARM processor), and WordPress can be resource-intensive.
htop or top to check server load:htop
Monitor Disk I/O: Use iotop to check if disk operations are causing delays:
sudo apt install iotop
sudo iotop
Ensure your Nginx is optimized for low-resource environments:
/etc/nginx/nginx.conf) and set reasonable limits:worker_processes auto;
worker_connections 1024;
keepalive_timeout 10;
client_max_body_size 64M;
server_tokens off;
gzip on;
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
gzip_min_length 256;
WordPress heavily relies on PHP, and poorly configured PHP-FPM can cause timeouts.
/etc/php/7.x/fpm/pool.d/www.conf (adjust 7.x to match your PHP version):sudo nano /etc/php/7.x/fpm/pool.d/www.conf
pm = dynamic
pm.max_children = 10
pm.start_servers = 3
pm.min_spare_servers = 2
pm.max_spare_servers = 4
These values are optimized for low-resource systems like Raspberry Pi.
Restart PHP-FPM:
sudo systemctl restart php7.x-fpm
/etc/mysql/mariadb.conf.d/50-server.cnf and add:query_cache_size = 16M
query_cache_limit = 1M
query_cache_type = 1
SET GLOBAL slow_query_log = 'ON';
sudo mysqlcheck -o --all-databases
Caching can drastically reduce server load and improve response times.
location / {
try_files $uri $uri/ /index.php$is_args$args;
}
Review server logs for timeout errors or warnings:
sudo tail -f /var/log/nginx/error.log
sudo tail -f /var/log/php7.x-fpm.log
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.