WordPress Error Connecting to Databases high-load pentest
Are you getting error connecting to databases error on your wordpress while your site are handling big traffic even just browsing your main page?
Solution
-
vim /etc/my.cnf (add innodb_buffer_pool_size = 20M under [mysqld])
-
Run a command to check is it your server swap file exist (swapon -s) If it return empty , means you don't have any swap for the server
-
Create a Swap file (fallocate -l 512MB /swapfile)
-
chmod 600 /swapfile
-
mkswap /swapfile
-
swapon /swapfile
-
Make the Swap File Permanent (vim /etc/fstab) /swapfile swap swap sw 0
-
vim /etc/sysctl.conf vm.swappiness = 10
-
Reboot your server then run free -m and you can see the swap is 512MB.
Now you are able to stress test your wordpress site again.
Leave a Reply
Want to join the discussion?Feel free to contribute!