• shashikant91

    (@shashikant91)


    Hi Team,

    We have implemented a website pcstudio.in on the wordpress (woocommerce) and hosted in on hostgator VPS server. We have been facing performance issues from last couple of weeks and with the help of our hosting team (as we do not have any system administrator with us) have identified that there is a huge load on the server (4 Core CPU – average load is between 7-9). This load keeps fluctuating all the time and we have seen that the load is more during the working hours like from morning 11am – 9pm IST.

    As per the hosting team, the load is due to couple of things i)lot of traffic is coming from single/multiple IP hits and hence the server is loaded – we have fixed it partly by enabling cloudflare DNS (firewall & page rules)

    ii) the database operations are overloaded and hence asked us to optimize the same from the backend. Is there a way that we can find out what plugin is causing this DB overloading issue so that we can fix it from our end or is there any what that we can optimize the database other than doing it from the PHPMYADMIN as that is not working.

    Our processes show that the below command is the most used one and it occupies around 50% of the CPU.

    Kindly help us or suggest us a way out from this as we have revamped the website and expecting lot of traffic from our marketing but the website performance seems to be very slow.

    Let us know the possible ways to find & fix it like crons, db optimization etc.

    We have tried WP-OPTIMIZE plugin too but that gave us a temporary relief. The server load fluctuates every 10-15 and goes upto 9 & 10 and again comes back to 3-4.

    Thanks
    Shashikant

Viewing 14 replies - 1 through 14 (of 14 total)
  • a2hostingrj

    (@a2hostingrj)

    on the wordpress (woocommerce)

    How many products do you have? How many plugins do you have active on your site?

    First, before doing any changes make a full backup of the site (files and database).

    I suggest you to make a copy of your site in a local development environment, and check how it behaves.

    Also, run this plugin to find out if there’s something wrong with your site:

    https://wordpress.org/plugins/health-check/

    Thread Starter shashikant91

    (@shashikant91)

    Hi @a2hostingrj,

    We have around 2000 products on our website and around 30 plugins are installed on the website. In that around 6 to 7 belong to one plugin only which is crocoblock.

    It’s a huge website and we are scared to even take a backup of the website and the space runs out and website stops working.

    Is there any way that we can check which plugin is creating load on server on production itself?

    It would help us a lot.

    a2hostingrj

    (@a2hostingrj)

    We have around 2000 products on our website and around 30 plugins are installed on the website.

    Once you surpass 1,000 products, you need to start thinking about optimization. Right now, I cannot not recommend to do anything to the site, even if you have an contingency plan do not modify anything.

    Is there any way that we can check which plugin is creating load on server on production itself?

    No. I wouldn’t recommend touching production site without knowing if something will break.

    It’s a huge website and we are scared to even take a backup of the website and the space runs out and website stops working.

    I strongly suggest you to get in touch with your hosting tech support, talk about the performance issues with the database, and see if there’s anything that can be done without touching the site.

    Thread Starter shashikant91

    (@shashikant91)

    I strongly suggest you to get in touch with your hosting tech support, talk about the performance issues with the database, and see if there’s anything that can be done without touching the site.

    We already got in touch with them and they just ask us to optimize the database as there is a huge load shown on that on the processes running.

    Also, we had a xmlrpc and wp login attack and hence added few firewall and page rule settings through cloudflare cdn. Do you think that might be one of the reasons of high load? Because even now we are able to see hits coming to cloudflare ips everyminute from different countries either as bot or ddos attacks. I hope they aren’t reaching our origin server but are stopped here at cloudflare as we can still see them at cloudflare panel.

    a2hostingrj

    (@a2hostingrj)

    few firewall and page rule settings through cloudflare cdn. Do you think that might be one of the reasons of high load? Because even now we are able to see hits coming to cloudflare ips everyminute from different countries either as bot or ddos attacks.

    That might be the issue. I suggest you to consider creating a blacklist to prevent those attacks. Caching and a CDN will help, however I suggest you to consider increasing your server resources to deal with the new load.

    Website Rob

    (@website-rob)

    Just went to your site and received “Access denied” msg. — for the last 5 minutes or so.

    Couple of questions.

    Is this a managed server?
    Do you have 8 GB or RAM or more?
    Any Firewall on the server?
    Do you have Indexes turned off in the .htaccess file or at server level?

    There are a few changes to your site .htaccess file that can be done, or at the server level, to help the situation.

    And a few plugins I can recommend that will help are:
    BBQ by Jeff Starr
    Block Bad Bots by Jeff Starr
    Limit Login Attempts Reloaded by Limit Login Attempts Reloaded

    You definitely want to get rid the CloudFlare blocking as blocking everyone is not the way to go.

    Thread Starter shashikant91

    (@shashikant91)

    Hi @website-rob

    Is this a managed server?

    No this is a self managed server, hence this issue we don’t have a server or system admin to help us.

    Do you have 8 GB or RAM or more?

    Yes we have 8gb of ram 4 core cpu

    Any Firewall on the server?

    Yes we have few firewall rules installed through cdn and hence you are not able to access the site. We had no other option as there were continuous attacks. We blocked countries other than India and united states I guess.

    There are a few changes to your site .htaccess file that can be done, or at the server level, to help the situation.

    Can you please help us by letting us know what are those changes? And I would go through and install those plugins suggested if they help us for sure.

    Do you have Indexes turned off in the .htaccess file or at server level?

    I don’t think so. Do you want me to share the file or how do you want me to check that?

    Website Rob

    (@website-rob)

    You can check for indexes using: pcstudio . in/wp-content/uploads/

    If you see anything other than a blank page, that’s bad.

    Add this line at the top of your ‘public_html/.htaccess file:
    Options -Indexes

    Then reload the same page which will now be blank. Note that this will create a line in your site Error log but you can add a Redirection later. Also make sure you installed those plugins I mentioned.

    Speaking which, I misstated one. It should be: Blackhole for Bad Bots. You’ll need to make an edit to the ‘robots.txt’ file for it to work. All three are set n’ forget plugins so they are easy to use and very effective.

    Not being able to see your site, I’m hesitant to suggest anything else as I won’t know what to suggest if it doesn’t work, other than remove it.

    You could try these online tools to see if they help your situation:
    https://gtmetrix.com/
    https://webpagetest.org/
    https://validator.w3.org/

    Thread Starter shashikant91

    (@shashikant91)

    Hi @website-rob

    We have removed the firewall setting of blocking other countries from the Cloudflare panel. Now you will be able to see and access the website.

    Also, we have installed both the suggested plugin BBQ Firewall & Black Hole as per your suggestion as we already have the 3rd plugin (Limit Login attempts reloaded.)

    Hope you will be now able to see the website and help us explore more on the performance issues.

    Thanks
    Shashikant

    Thread Starter shashikant91

    (@shashikant91)

    Hi @website-rob

    I also have noticed many fatal errors in the php error log file which are being logged from almost 1-2 weeks.

    These errors are related to woocommerce and recently one got logged today morning also.

    [29-May-2021 04:58:52 UTC] PHP Fatal error: Uncaught Error: Class ‘Symfony\Component\CssSelector\XPath\Extension\AbstractExtension’ not found in /home/pcstudio/public_html/wp-content/plugins/woocommerce/vendor/symfony/css-selector/XPath/Extension/PseudoClassExtension.php:27
    Stack trace:
    #0 {main}
    thrown in /home/pcstudio/public_html/wp-content/plugins/woocommerce/vendor/symfony/css-selector/XPath/Extension/PseudoClassExtension.php on line 27

    Also, just wanted to check if the action schedulers or crons also create performance issues? Like the crons or schedulers which run regularly and put load on data base

    Thanks
    Shashikant

    Website Rob

    (@website-rob)

    Due to the various problems that need attention and will take some time & testing to correct, I would suggest you contact a service company for outsourcing support. Do search on your own and here are some suggestions to get you started.

    acunett. com
    bobcares. com
    serversurgeon. com
    supportmonk. com

    I have no experience or affiliation with them although I’ve read good feedback about each of them. Spending around $100 USD per month is not unreasonable and paying monthly would allow you to move on to another if you choose. And once your problems are sorted out, you can downgrade to less support at less cost.

    Thread Starter shashikant91

    (@shashikant91)

    Hi @website-rob ,

    Can you please help me with one last thing here?

    My hosting support team had confirmed yesterday evening that my cpu resources are being overused by mysql queries and few of the processes or plugins are triggering unnecessary mysql sleep queries.

    Is there any way that we can observe these sleep query and fix them either from wordpress panel or the server.

    They had given me one command to see the live logs and suggested me to deactivate all pkugins except woocommerce and activate each plugin at a time and monitor which plugin is causing to trigger sleep queries.

    This method might also fix the cause of critical and fatal errors.

    Thanks
    Shashikant

    Website Rob

    (@website-rob)

    If your hosting support team is part of your Hoster, can you hire them? I know your server is not managed although the Hoster will usually provide paid-for Support. I bring this up because you seem to have some problems that require an experienced person looking at what is going on. Trying to get answers from a Forum where people volunteer answers for the problems you are having is not good in this particular situation. Especially since no one but you can see what is going or the results of what happens when you make suggested changes.

    You say “they” gave you a command to see the live logs but if you’re not sure what to do, how does that help? Messing with Plugins may not be the answer for the problems you are having at this time. You’ve got to turn on gzip, change Cache settings, fix repeating PHP & HTML errors, setup some security within the Headers and more. I can see all that just from looking at your website and not looking at any error logs.

    If you want to see live Apache error logs on the server, this command may help as well.

    tail -f /usr/local/apache/logs/error_log — may be different path on your server

    Or look in cPanel -> Metrics -> Errors

    You can view logs for previous PHP errors from within the Hosting Control Panel – File Mgr:
    /home/username/logs/ dir. <- if the file is many MB in size, delete it and wait a few minutes–a new one will be created that will be easier to read.

    Your various error logs will tell where problems are so one can start at the correct places for fixing them.

    a2hostingrj

    (@a2hostingrj)

    My hosting support team had confirmed yesterday evening that my cpu resources are being overused by mysql queries and few of the processes or plugins are triggering unnecessary mysql sleep queries.

    Due to the amount of products of your site, you will have to do some serious debugging and optimization. You are going to need a dev site to find out the issues and resolve them. I strongly suggest you to work with your dev team, and find a good way to approach this situation without affecting the site.

    Is there any way that we can observe these sleep query and fix them either from wordpress panel or the server.

    There are tools for WordPress that let you monitor your site:

    https://wordpress.org/plugins/query-monitor/

Viewing 14 replies - 1 through 14 (of 14 total)

The topic ‘Load on server due to wp database’ is closed to new replies.