If you like DNray Forum, you can support it by - BTC: bc1qppjcl3c2cyjazy6lepmrv3fh6ke9mxs7zpfky0 , TRC20 and more...

 

How to speed up MySQL database?

Started by maxikk, Aug 05, 2022, 05:02 AM

Previous topic - Next topic

maxikkTopic starter

Greetings,

I have a WordPress website that is constantly being updated with new content. As a result, the MySQL database has grown significantly, causing the site to slow down and the pages to take a longer time to load. Despite trying to optimize, clean, and cache the site, the issue persists.

I am wondering if there is a way to allocate more resources to the database to help speed it up. I apologize in advance for any ignorance on my part, but I couldn't find anything helpful through Google. This is a new situation for me, so any assistance would be greatly appreciated.
  •  


vinodkumar

1. It's safe to assume everything is working correctly if you have never accessed the PHP admin panel. The only exception might be an outdated version, which can be updated to a newer version for faster performance regardless of the database size.
2. Delve into the engine's admin panel; WordPress has some effective tools worth trying, including WP Optimize and WP Cleaner (backup recommended).
3. Other plugins and their settings may also be responsible; it's up to you to identify the culprit or hire a professional.

For further and safer steps:
1. Contact your hosting provider for assistance, and if necessary, enlist the help of a specialist. A reliable hosting provider will ensure that your websites are functioning as quickly and reliably as possible.
2. For personal servers, consider hiring a specialist to work on a permanent basis or educate yourself on progressive tools like MariaDB instead of using phpMyAdmin.

Additional options include accelerator tools like Redis at the server level. You can also reduce your database size by replacing the commenting system with an external one and importing existing comments to a different host.
  •  

richardBranson

To improve performance, it's important to utilize all standard database features, with proper index usage being crucial. Optimization of queries can be done incrementally by using the slow query log to identify areas in need of improvement.

Setting up MySQL with optimized parameters can have a significant impact on speed, and caching is a popular solution for further optimization. Internal caching can be achieved through MySQL's built-in cache, but external solutions like Memcache and Redis offer more flexibility.

While replication can improve load versatility, it shouldn't be solely relied upon for scaling under heavy load. Instead, it's best used as a backup mechanism for high availability purposes.

Sharding can be used to distribute data across different servers, with vertical sharding used to distribute tables across servers and horizontal sharding used to split large tables into smaller parts located on different servers. Complicated application logic may result, but sharding remains one of the most effective scaling mechanisms available.
  •  

Harry_99

There isn't one definitive solution to this issue, but there are several steps that can be taken to improve site performance.

Firstly, if the server response time exceeds 200 milliseconds, consider switching providers (e.g., using a Google PageSpeed test). Installing a caching plugin and using browser caching can also significantly improve website speed.

HTML, JavaScript, and CSS files should be optimized by removing unnecessary spaces, newlines, comments, and block markup. Enabling smart Gzip compression reduces the size of responses sent from the server to browsers.

Regularly deleting unnecessary data such as old post/page versions, drafts, moderated comments, trash pages, etc., can also help improve performance.

Finally, there are many other optimization techniques available, each with varying levels of effectiveness depending on your specific website's needs.
  •  

swatrih

You should check the current hosting plan you have. Many shared hosting plans come with limited resources. If your website is growing, consider upgrading to a VPS (Virtual Private Server) or a dedicated server. These options will give you more control over your resources and often better performance.
Look into using a more optimized version of MySQL, such as MariaDB. It often provides better performance with enhanced features. If your hosting allows it, you can switch to that and see if it helps.

Next, examine your database tables and indexes. Sometimes, tables can become fragmented, and indexes can be outdated. Running a regular maintenance schedule through phpMyAdmin or using a plugin like WP-Optimize can help. You can use the "Optimize tables" feature to defragment them.

Caching is also an important factor. If you haven't already, consider implementing an advanced caching plugin like WP Rocket or W3 Total Cache. These plugins can drastically reduce the load on your database by serving static files instead of querying the database every time a page is loaded.

Another key area is to limit the number of revisions WordPress keeps for each post. By default, WordPress saves every single draft and revision. You can limit this by adding this line in your wp-config.php file: "define('WP_POST_REVISIONS', 5);" This will keep the last five revisions and delete the rest.

Ensure that your database is optimized for speed. You can adjust the MySQL configuration by changing settings like query_cache_size, innodb_buffer_pool_size, and max_connections. However, this would typically require access to the server.
Consider offloading some of your database work. If you have an eCommerce section of your site, maybe set up a dedicated database for that. Or, if you use a lot of external services like Google Analytics or Facebook Pixels, minimize the amount of data being stored in your database.
  •  


If you like DNray forum, you can support it by - BTC: bc1qppjcl3c2cyjazy6lepmrv3fh6ke9mxs7zpfky0 , TRC20 and more...