Skip to:
Content
Pages
Categories
Search
Top
Bottom

Performance after conversion

  • @talhawp

    Participant

    Hi Everyone,

    I finally upgraded my bbpress 1.x to bbpress 2.5.6 after running it for 7 years. The import process took almost a day with 0.5+ million posts.

    Now I am facing issue with slow performance, despite running on physical server with 16 core CPU and 16 GB RAM. The upgrade ran fine for few hours has but been very slow from last 12 hours.

    The wordpress and bbpress are both so slow that sometimes even the site fails to load. HTOP shows all CPU cores running mysql up to 90%.

    I enabled slow query on mysql (mariadb) and it is giving the following output:

    [root@server]# mysqldumpslow -t 5 -s at /var/log/mariadb/mysql-slow.log 
    
    Reading mysql slow query log from /var/log/mariadb/mysql-slow.log
    Count: 7485  Time=25.48s (190747s)  Lock=2.85s (21328s)  Rows_sent=10.0 (74810), Rows_examined=1582056.1 (11841689862), user[database]@localhost
      SELECT   wp_posts.ID FROM wp_posts  INNER JOIN wp_postmeta ON ( wp_posts.ID = wp_postmeta.post_id ) WHERE N=N  AND ( 
      ( wp_postmeta.meta_key = 'S' AND CAST(wp_postmeta.meta_value AS SIGNED) NOT IN ('S','S') )
      ) AND wp_posts.post_type = 'S' AND ((wp_posts.post_status = 'S' OR wp_posts.post_status = 'S')) GROUP BY wp_posts.ID ORDER BY wp_posts.post_date DESC LIMIT N, N
    

    I tried disabling other plugins but it did not make any difference, however the CPU returns to low if I disable bbpress plugin.

    Can anyone guide me on what could be the issue here?

    Regards,
    T

Viewing 18 replies - 1 through 18 (of 18 total)
  • @casiepa

    Moderator

    Hi,
    Did you run the repair tools after the import (Tools > Forums), one at a time ?
    Pascal.

    @talhawp

    Participant

    Hi Pascal,

    Thanks for replying. No, I didn’t run. Let me try now.

    Regards,
    T

    @talhawp

    Participant

    Hi @Pascal,

    I successfully ran all the repair tools, but unfortunately I still have the issue.

    I also moved my website later to a managed WordPress hosting provider that is optimized for performance, however I have same/worst performance issues. The only solution I had was to disable the bbPress plugin.

    I am confident now that my server is okay.

    Any more things I can try? I am thinking of trying 2.6 as well tonight.

    Regards,
    T

    @talhawp

    Participant

    Update:

    I upgraded to bbPress 2.6 and the site seems to be responding now. Will keep everyone updated on how it goes.

    Thanks

    @casiepa

    Moderator

    Great news ! 2.6 focused on performance and import, so I’m happy to see that you confirm this.

    @talhawp

    Participant

    Hi @casiepa,

    Unfortunately, the site became slow gradually in around 12 hours, until it won’t just load anymore. I tried with even managed WordPress hosting who did some fine tuning but it still won’t work. I am in kind of a desperate situation where I am losing my visitors of more than 7 years.

    I am willing to hire any expert to resolve this issue if possible.

    Thanks, T

    @casiepa

    Moderator

    Hi,
    Do you have lots of subforums ? It seems that subforums inside forums might cause some performance degrading.

    @talhawp

    Participant

    Hi,

    Thanks for tip. I have around 100 subforms at one level deep, but not anything deeper. I will now try to move all the topics in these sub-forums to just a main forum.

    Let me try and update you.

    @casiepa

    Moderator

    And your toplevel is a category or a normal forum ?

    @talhawp

    Participant

    Yes, top level is a normal forum.

    @talhawp

    Participant

    @casiepa,

    I just moved all the topics in sub-forums to forums on top level and then deleted all the sub-forums.(thanks to your wonderful “topic move” plugin, it was all done quickly)

    The forum worked for couple of minutes and then crashed again.

    I have around 6,000 topics (25% of total topics) in trash, can this be causing the issue? I tried emptying the trash but it times-out or crashes the site. I also tried deleting the contents of trash one by one but it will take a week to do this.

    Is there a way to do it directly via SQL query?

    @talhawp

    Participant

    I found this php script online, can anyone suggest if this is safe to empty the trash?

    $strSql="SELECT ID FROM wp_posts WHERE post_status='trash'";
     
    $con=mysqli_connect("localhost","my_wordpress_user","my_db_pass","my_wordpress_db_name") or die("Error connecting");
    $result = mysqli_query($con, $strSql);
    while($row = mysqli_fetch_array($result)){
     printf($row['ID']."\n");
     }
    mysqli_close($con);

    php findtrash.php > trash.txt

    $con=mysqli_connect("localhost","my_wordpress_user","my_db_pass","my_wordpress_db_name") or die("Error connecting");
    $file = fopen("trash.txt", "r") or exit("Unable to open file!");
    while(!feof($file)){
      $intId = fgets($file);
      $result = mysqli_query($con, "DELETE FROM wp_posts WHERE ID=".$intId);
      $result2 = mysqli_query($con, "DELETE FROM wp_postmeta WHERE post_id=".$intId);
      if($result && $result2){
            printf("Deleted id ".$intId);
            }else{
            printf("Results not positive".$result." ".$result2." for ".$intId." ");
            }
      }
    fclose($file);
    mysqli_close($con);

    @talhawp

    Participant

    I tried the following steps without any success:

    1- Upgraded to bbPress 2.6

    2- Removed sub-forums

    3- Emptied Trash/Spam Topics and Replies through admin panel. This took me 3 days! Around 25% of 0.5 million posts were removed

    4- Repaired Forums by going through every single option

    5- Optimized WordPress Database through wp-optimize plugin

    6- Changed theme to WordPress default Twenty Sixteen theme

    7- Deactivated all the plugins except bbPress

    The site works for few minutes then crashes. My WordPress itself has around 30K posts and 400K comments, not sure if this is causing the issue.

    The whole bbPress 1.x worked perfectly for 7 years, then only issue was that the cookies and single sign between WP and bbPress had become incompatible due to newer WP versions.

    Can anyone suggest anything else that I can try?

    @casiepa

    Moderator

    Hi,
    Only saw your last posts now, a SQL to delete the trash would have been better probably…
    But I’m out of ideas for your environment 🙁

    You don’t have any errors in your logs, right ? Your memory is high enough for both WordPress and your environment ? You are running on a public host ?

    Pascal.

    @talhawp

    Participant

    Hi Pascal,

    Yes, I don’t have errors in logs apache logs.

    It is a public server, please let me know if you would like to have a quick look and can find something I have missed.

    Regards,
    T

    @casiepa

    Moderator

    I could have a quick check in some hours. Drop me a mail.
    Please explain how it crashes.

    @talhawp

    Participant

    Hi Pascal,

    Thanks, I have just emailed you the details.

    Regards,
    T

    @reedy

    Participant

    @talhawp Did you get to the bottom of this?

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