Support » Plugin: WP ULike » latest version seems to be hitting my database too hard

  • Resolved vitamincee

    (@vitamincee)


    Version 2.8 has been hitting the CPU of my database server too hard since I upgraded it, slowing my site down considerably. The load average went from about 12% up to about 90% which is not doable for us.

    I’m going to roll back to the older version, but in the meantime, do you have any idea what could be causing this?

    Thanks!
    Cee

    The page I need help with: [log in to see the link]

Viewing 15 replies - 1 through 15 (of 15 total)
  • Plugin Author Alimir

    (@alimir)

    Hi @vitamincee

    Hoom! I am sure that we have not made any kind process in this version that will increase CPU usage. I checked both versions on my server and there was no difference between them.
    Are you sure that this is not from other plugins?!

    Regards,
    Alimir

    Absolutely sure, unfortunately. The server load spiked the minute I updated the plugin. I’ve rolled back the plugin for the time being, and the load is way back down.

    Plugin Author Alimir

    (@alimir)

    @vitamincee

    What is your PHP version?

    PHP 7, and I run PHP-FPM on the web server. The web server is fine and not struggling like the db server (I split the load over two servers). Our site gets millions of hits a month, so it’s quite high volume.

    Update: Rolling back to the older version did not help either. Only when the plugin is disabled completely does the db CPU load go back to a reasonable level.

    Plugin Author Alimir

    (@alimir)

    @vitamincee

    Temporarily remove the following code from ‘admin/stats.php’ file and check it again:
    include( plugin_dir_path(__FILE__) . 'classes/tmp/geoiploc.php');

    If it does not change, try to remove the following code from ‘admin/admin.php’ & let me know the result:
    require_once( plugin_dir_path(__FILE__) . 'stats.php');

    Hello again! Thanks for your reply. I tried commenting both out and re-enabling the plugin (v 2.7) and the DB CPU load went from 10% to 90% within 1 min, and held steady at 90% for 5 minutes before I disabled it.

    Any other ideas?

    Thanks!

    Plugin Author Alimir

    (@alimir)

    @vitamincee

    It is very strange that you did not have this problem before updating! Other than ULike, what other plugins have you upgraded? Have you made any special changes to your system?

    It looks like the server did have a problem, but it wasn’t as bad, and it’s just getting worse. I wonder if it’s due to the large number of likes stored in the database (121k), and the huge number of users (49k) we have? Perhaps it’s just time to upgrade our hardware again if we plan to keep hitting the db so much with each comment load. We get a ton of traffic.

    I’m testing out lazy loading our comments in hopes I can fix the load that way.

    ** edit: the plugin seems to not work with lazy load. any ideas? i think that may help solve the problem (thanks for all of your help!)

    Plugin Author Alimir

    (@alimir)

    @vitamincee

    I do not know what plugin you have used for lazy loading! But I suggest instead of using auto display mode, try out the following function in your comments loop:

    if( function_exists( 'wp_ulike_comments' ) ) wp_ulike_comments( 'get' );

    • This reply was modified 3 months, 1 week ago by  Alimir.

    Hello! The plugin is called “Lazy Load for Comments”.

    I turned off auto-display mode, and put that function in my loop, and the like button displays perfectly and shows old likes, but it does not allow for clicking.

    It looks like when I load via that function, I get a class “wp_ulike_click_is_disabled” added to the a tag.

    code via the function:
    <div id="wp-ulike-comment-812414" class="wpulike wpulike-default"> <div class="wp_ulike_general_class wp_ulike_is_not_liked"> <a data-ulike-id="812414" data-ulike-nonce="b085ebcfe7" data-ulike-type="likeThisComment" data-ulike-status="4" class="wp_ulike_btn wp_ulike_put_image wp_ulike_click_is_disabled"> </a> <span class="count-box">14</span> </div> </div>

    code via auto-display:
    <div id="wp-ulike-comment-812414" class="wpulike wpulike-default"> <div class="wp_ulike_general_class wp_ulike_is_not_liked"> <a data-ulike-id="812414" data-ulike-nonce="b085ebcfe7" data-ulike-type="likeThisComment" data-ulike-status="1" class="wp_ulike_btn wp_ulike_put_image"> </a> <span class="count-box">13</span> </div> </div>

    Any idea how I can turn that tag off? Or make the link enabled?

    edit: I’m logged in and should be allowed to comment

    • This reply was modified 3 months, 1 week ago by  vitamincee.
    Plugin Author Alimir

    (@alimir)

    @vitamincee

    Which logging method do you use for comments likes?
    Status ‘4’ means you’ve already liked it and you’re no longer allowed. (Try logged by user ID for like/unlike support)

    Plugin Author Alimir

    (@alimir)

    @vitamincee

    Any update?!

    Hello sorry for the delay. I use log by username. I could not get it to work with lazy load, but with lazy load off, the hard coding of the plugin on, and turning off “automatic display” it does work. It seems to be slightly faster with the automatic display off, so I’m going to test that for a few days to see if it’s enough! Thanks again for all of your help.

Viewing 15 replies - 1 through 15 (of 15 total)
  • You must be logged in to reply to this topic.