0

Migrated website from old cPanel to Hostinger and now slow queries are killing the server.

I have deleted more than 97% data and rest of the content from one query is:

UPDATE wp_options SET option_value = 'a:21:{s:59:"get:/v1/installs/9006034/addons.json?enriched=true&count=50";O:8:"stdClass":3:{s:6:"result";O:8:"stdClass":1:{s:7:"plugins";a:23:{i:0;O:8:"stdClass":34:{s:16:"parent_plugin_id";s:4:"3752";s:12:"developer_id";s:4:"6233";s:8:"store_id";s:4:"1561";s:10:"install_id";s:7:"2629141";s:4:"slug";s:20:"ocean-footer-callout";s:5:"title";s:20:"Ocean Footer Callout";s:11:"environment";i:0;s:4:"icon";s:93:"//s3-us-west-2.amazonaws.com/freemius/plugins/3754/icons/a5696beb8fd43d782e206a2a2f05077b.png";s:15:"default_plan_id";s:4:"6079";s:5:"plans";i:6079;s:8:"features";N;s:17:"money_back_period";N;s:13:"refund_policy";N;s:24:"annual_renewals_discount";N;s:22:"renewals_discount_type";s:10:"percentage";s:11:"is_released";b:1;s:15:"is_sdk_required";b:1;s:18:"is_pricing_visible";b:1;s:19:"is_wp_org_compliant";b:1;s:6:"is_off";b:0;s:24:"is_only_for_new_installs";b:0;s:14:"installs_limit";N;s:19:"free_releases_count";i:0;s:22:"premium

07:53:38";s:22:"\0FS_Entity\0_is_updated";b:0;}}}s:7:"created";i:1679151123;s:9:"timestamp";i:1679237523;}}', autoload = 'no' WHERE option_name = 'fs_api_cache'

1
  • Why highlight that query in particular? Is that something you're seeing a lot, i.e. this plugin is updating its cache on every request? That's what I'd try and get to the bottom of. Is your server clock correct? I could believe it's because your server is out of sync with theirs, if they're constructing the cached data expiry time.
    – Rup
    Commented Mar 30, 2023 at 23:16

1 Answer 1

0

It seems like you're experiencing slow queries after migrating your website to Hostinger. The query you provided is an update statement for the wp_options table in a WordPress site. This query appears to be related to the Freemius API, which is a monetization platform for WordPress plugin and theme developers.

Here are some steps to help you optimize your website and reduce slow queries:

  • Optimize your database: Perform regular database optimization to clean up overhead and reduce the database size. You can use a plugin like WP-Optimize to help with this task.

  • Enable caching: Install and configure a caching plugin like WP Super Cache, W3 Total Cache, or WP Rocket to cache your site's content and reduce the load on your server.

  • Monitor your plugins: Some plugins may cause slow queries or negatively impact your site's performance. Deactivate unnecessary plugins and monitor the remaining ones to ensure they aren't causing issues. Make sure to use plugins from reliable sources and keep them up-to-date.

  • Enable object caching: Object caching can help reduce the load on your database by caching the results of complex queries. You can enable object caching using a plugin like W3 Total Cache or by implementing a solution like Redis or Memcached.

  • Optimize your theme: Make sure your theme is well-optimized for performance. Choose a lightweight, well-coded theme, and remove any unnecessary features or assets.

  • Optimize your images: Large, unoptimized images can slow down your site's loading time. Use an image optimization plugin like ShortPixel, Imagify, or Smush to compress and optimize your images.

  • Review your hosting plan: Make sure your hosting plan can handle the traffic and resource usage of your website. You might need to upgrade to a higher-tier plan or consider switching to a managed WordPress hosting provider like Kinsta or WP Engine for better performance.

  • Monitor server logs: Regularly check your server logs for any errors or issues that could be causing slow queries. You can use a log management tool like Loggly or Papertrail to monitor and analyze your logs.

  • Use a Content Delivery Network (CDN): Implementing a CDN like Cloudflare or StackPath can help distribute your site's static content across multiple servers, reducing the load on your main server and improving performance.

  • Seek professional help: If you're still experiencing slow queries after implementing these optimizations, consider consulting a professional WordPress developer or a database expert to help diagnose and resolve the issue.

1
  • I'm not sure most of that is relevant to the problem here
    – Rup
    Commented Mar 30, 2023 at 23:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.