Better Option, Upgrade server or add new droplet for Mysql

July 24, 2019 187 views
MySQL WordPress Ubuntu 18.04

Hello, I started with the lowest 1Gb Ram 1 CPU plan, but as my site has grown. my wordpress site now has a Real Estate plugin which is sometimes slow due to the amounts of Data it has to pull, I have extensively reviewed with the plugin developer. The database is around 1GB. Issue is since there is around 9K properties, the database has to search thru all that to pull up the property info that was clicked on, so it slows down the site ( I have images hosted elsewhere because of the size over, 90K images ) So if someone can please tell me which of the two is a better option:

  1. Upgrade to a bigger plan ( not sure if 2GB plan would be enough ), not sure if its RAM or CPU that is linked to the database processing speed .

  2. Create another starter droplet and host only the database there. I searched and read some articles here but only found how to do this only with a new install, not on an existing installing. If this is the better option vs the first option, can someone can please point me to an article on how to achieve separating the database to a separate droplet on an existing installing.

PS:
Mysql Cache is enabled / verified via ssh
Im using Plesk Onyx 18
Site traffic is low for now, but expecting more, currently about 10 visitors a day performing searches pull database info

Thank You

2 Answers

Hi Roman,

I believe that for the moment it would be better for you to upgrade the current droplet to at least have 3GB of RAM.

Then you could focus on the optimization:

  • As you've noticed that the SELECT queries are the bottle neck in this case, I would suggest making sure that you have indexes for those tables, this would drastically improve the performance
  • Install a caching plugin like WP super cache or W3 total cache, that way the pages would be cached and you would reduce the unnecessary load on the database
  • Make sure that your PHP is well configured as well, some tips: install OpCache, adjust the memory limit and the execution time
  • Consider implementing Redis or Memcached
  • As this is a wordpress website, I would strongly recommend deleting all of the plugins and themes that are not being used

Also if you could share your current webserver setup I might be able to suggest some optimizations there as well. Are you using Apache or Nginx for example?

As a side note, I had to optimize a website that was using a Real Estate plugin recently, it turned out that the main delay was caused by a security plugin called Wordfence. So if you are using any security plugins I would recommend trying to completely disable and delete those as a test. Note that there are a lot of other ways to keep your website secure.

Hope that this is a good starting point for you!

Let me know if you have any questions.
Bobby

Hello Bobby, thank you for the reply. I'll upgrade as you suggested. below are some of my configurations:

Nginx only / cache at server level enabled / mysql cache on / nginx gziped

I removed the WP cache plugin since it was causing cache issue, the drop down box for city selection would not drop down sometimes, so I installed Fast Velocity Minify and enabled the Nginx cache on server ( not sure if it works the same as a cache plugin )

For security, I have Itheme plugin, will disable to see if it helps

Using Query Monitor, there are 3 queries that show as slow on home page, as you suggested, they are SELECT, the plugin is structured this way so not sure if I can change this, I'll do some research.

Thank You Much

Have another answer? Share your knowledge.