• Resolved annieaan

    (@annieaan)


    Hi!
    I have a wordpress site runnings woocoomerce as an afiiliate site.
    The site has around 20 000 products atm.
    When I use woocommerce shortcodes it takes A LOT of power from the server (a lot more than it should!).
    The site does not have a lot of visitors. It runs on a VPS server with 32gb ram.

    When I use a short code to display a single product based on post id it immediately (when adding the shortcode to a page or post) breaks the entire site.
    What is happening is something with the mysql call and the site gets overloaded and the ram gets maxed out. At first the databse stopps working and within seconds the entire server gets overloaded due to this mysql call.

    Does anyone know what the issue could be?
    Is it always like this?
    It should be possible to have 20 000 products and still a working site, right?

    It would be great if anyone could help! ??

    Kind regards Annie

Viewing 9 replies - 1 through 9 (of 9 total)
  • Thomas Shellberg

    (@shellbeezy)

    Automattic Happiness Engineer

    @annieaan – I haven’t ever heard of users suffering from performance issues when using shortcodes. Do you have anything from your server’s error logs that could shed some light on what exactly is happening?

    Thread Starter annieaan

    (@annieaan)

    Hi,

    Thanks for the reply.
    I am checking the servers error logs with my host and will get back ASAP.
    Thanks!

    Kind regards Annie

    Thread Starter annieaan

    (@annieaan)

    @shellbeezy – I got a reply from my host, they are wondering if I want them to activate the database error log? They say it is different error logs depending on if the error is a PHP error or a MySQL error. Do you know which one I need to look at?
    Thank you!

    Plugin Support Ryan Ray, a11n

    (@ryanr14)

    Hi @annieaan,

    At this point it could be either. When you said it breaks the site, do you get any sort of error message or perhaps just a blank screen?

    You could also check the fatal errors or any other logs in WooCommerce > Status > Logs for hints.

    Ultimately any logging or something that could point us to the likely issue is helpful!

    Thread Starter annieaan

    (@annieaan)

    Hello @ryanr14

    When I add the shortcode to a page or post immediately (before I press update) everything stopps working in the admin area.
    Then all the pages that use the database (all the pages that are not cached – I use the plugin fastest cache) stop working.
    When visiting the pages that need the database it shows the message “Error establishing a database connection”. All the database info is correct, username, password etc.
    One page also showed a longer mesage:

    “Error establishing a database connection.
    This either means that the username or password in your wp-config.php file is incorrect or we can’t contact the database server at localhost. This could mean your database server is down.

    *Are you sure you have the correct username and password?
    *Are you sure you have typed the correct host name?
    *Are you sure that the database server is running?

    If you’re unsure what these terms mean you should probably contact your host. If you still need help you could always visit the WordPress Support Forums.”

    We have to reboot the server for it to start working again – this probably cancels the process that is causing the issue.

    My host says what is happening is the server runs out of RAM and the MySQL process gets stuck.

    Thanks for the help! ??

    Kind regards Annie

    jessepearson

    (@jessepearson)

    Automattic Happiness Engineer

    @annieaan Can you confirm the shortcode you are trying to enter with all of the options? The only thing I can think here is that it’s trying to either load all of the products, or is trying to search through all of the products.

    Thread Starter annieaan

    (@annieaan)

    Hi @jessepearson,

    The shortcode is this:

    [product id=”232324″]

    And the database has around 20 000 products.

    But when this is happening I am using the plugin Visual Composer -> Add Element -> Woo product (show a single product based on post id).

    I also use WooCommerce shortcodes to show product categories and this works without breaking the site, but the pages with WooCommerce shortcodes is slower than other pages.

    Also to be able to show the woocommerce categories with shortcodes our host had do increase memory limit – before they did that all pages with woocommerce short code only showed a blank white page.

    Thanks!

    Kind regards Annie

    Thomas Shellberg

    (@shellbeezy)

    Automattic Happiness Engineer

    When I add the shortcode to a page or post immediately (before I press update) everything stopps working in the admin area.
    Then all the pages that use the database (all the pages that are not cached – I use the plugin fastest cache) stop working.

    Okay, since this breaks before even rendering the shortcode on the site, it might be an issue with the Visual Composer method of adding the shortcode.

    What if you just add it via the normal text method and paste in [product id=”232324″]?

    Kenin

    (@kbassart)

    Automattic Happiness Engineer

    We haven’t heard back from you in a while, so I’m going to mark this as resolved – if you have any further questions, you can start a new thread.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Woocommerce shortcode breaks mysql database’ is closed to new replies.