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

  1. vim /etc/my.cnf (add innodb_buffer_pool_size = 20M under [mysqld])
  2. 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
  3.   Create a Swap file (fallocate -l 512MB /swapfile)
  4. chmod 600 /swapfile
  5. mkswap /swapfile
  6. swapon /swapfile
  7. Make the Swap File Permanent (vim /etc/fstab)
    
    /swapfile swap swap sw 0
  8. vim /etc/sysctl.conf
    
    vm.swappiness = 10
  9. 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.

0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

Your email address will not be published. Required fields are marked *