Skip to:
Content
Pages
Categories
Search
Top
Bottom

Slow to Post


  • Nitac
    Participant

    @mchl

    Been running a bbp forum for a couple of weeks after migrating from phpbb (thanks a lot for writing the migration scripts). Though the forum seems to be going ok ive been getting a lot of users complaining about how long it takes to post a reply.

    There are about ~470k replies and ~15k topics so there is a fair amount of content, it’s running on AWS with EC2 m1.medium server and RDS db.m3.medium database so there’s plenty grunt there.

    So was wondering if there’s anything I could be doing optimise bbp or if anyone knew if some server config that may help.

    Thanks

Viewing 25 replies - 1 through 25 (of 25 total)
  • We have a rather large performance increase coming up in bbPress 2.6 that will address most of your issues, primarily it relates to the sort order of topics as we have a slow database join when we need to sort the topic order based on the latest reply.


    Nitac
    Participant

    @mchl

    cool cheers, how close are you guys to releasing it so I keep the users at bay?

    Thanks

    It’s the same answer as “How long is a piece of string” at the moment, and if the planets align I should be able to give you a respectable answer to this question by the end of the week, not the next release, just an answer to the question šŸ˜‰


    Nitac
    Participant

    @mchl

    haha yeh I hear ya, thanks


    Nitac
    Participant

    @mchl

    if I could get my forum posting anywhere as quick this site I’d be stoked, cheers.


    Nitac
    Participant

    @mchl

    can anything be done in the mean time?

    I’m starting to lose users because of the slow performance.

    thanks


    Robkk
    Moderator

    @robkk

    Do whatever you can to speed up your website.

    click the link

    http://lmgtfy.com/?q=how+to+speed+up+my+wordpress+website


    Nitac
    Participant

    @mchl

    no need for that dude.

    rest of the site is fine this is specifically related to how long it takes users to post in the forum.

    maybe you should have read all the replies before responding.


    Robkk
    Moderator

    @robkk

    haha i read everything

    what i just doing is lead you to a google search , it was suppose to help you to find info that might help you

    any kind of information is good when trying to speed up a website.

    i dont know if you use alot of bbpress plugins or plugins that work with it and you need to optimize scripts and css handling.

    or if your forums have alot embedded images or uploaded images.

    or that you need a database optimizer plugin

    im just trying to help you on a pretty broad question

    i wasnt trying to be rude or anything if you took it that way

    other than that i guess wait til 2.6


    Nitac
    Participant

    @mchl

    when i respond using LMGTFY its normally a dig at the other person, so hopefully you can see why i took it ‘that’ way. but i’m going to move on.

    ive eliminated all the points you’ve made above, and the site only chokes when users are submitting posts in the forum, so I’m confident i’ve isolated the issue.

    as mentioned i’m coping heaps of flack for the performance of the forum and losing users so i hope you can appreciate why there’s an element of urgency.


    Robkk
    Moderator

    @robkk

    when i respond using LMGTFY its normally a dig at the other person

    XD haha alright

    ive eliminated all the points youā€™ve made above, and the site only chokes when users are submitting posts in the forum, so Iā€™m confident iā€™ve isolated the issue.

    great!! i was hoping you did , because any second shaved in loading helps.

    as mentioned iā€™m coping heaps of flack for the performance of the forum and losing users so i hope you can appreciate why thereā€™s an element of urgency.

    post more information about how you are setup on your site. (this is good for support of others users)

    do you have threaded replies active? (this always took awhile to load on a reply for me)
    do you have the forum on root? (some huge bbpress forums i saw have the forum on a subdomain)
    do you have a cdn? (i checked two huge forums that use bbpress and they use cloudflare)

    here are the forums
    http://tamrielfoundry.com/forums
    http://www.highexistence.com/discussions

    and also can you post a link to your forum?


    Robkk
    Moderator

    @robkk

    nevermind on the CDN

    but do post a link to your forum

    i actually want to see how long it takes to load


    Nitac
    Participant

    @mchl

    http://killyourstereo.com – the main forum is private

    Server : AWS EC2 m1.medium
    DB : AWS RDS db.m3.medium
    CDN: AWS S3 (currently only serving images)

    Here’s a breakdown of the site: http://builtwith.com/killyourstereo.com let me know if any other info would help.

    Not using anything crazy from a plugin perspective either:
    ACF
    BBPress
    Quick Cache Pro (caching only for guests at the moment)
    All in One SEO

    and few other plugins.

    – No threaded replies
    – The forum is on the root, hadn’t really considered moving but it feels like its more of a db issue.

    at the moment its taking about ~15seconds to reply

    cheers

    I saw this pop up on my phone whilst I was out and wasn’t even going to try to chime whilst mobile. Anyways, I’m just going to have some dinner but whilst I eat that I’m generating a test site with a few hundred thousand posts to test a plugin, this “might” help but I’ve never tested it before, so give me half an hour and I’ll let you know.


    Robkk
    Moderator

    @robkk

    ~15seconds to reply

    hell id be pissed too if its 15 seconds

    ok im going to be signing up for your website in a minute , and ill see first hand on these slow replies.

    but hey if you want your users to stay active on your forum , i think using tapatalk might help for a while as your users wait til you get this help on your replies on your websites actual forum but yeah im not sure on this.

    crazy alternative while this gets fixed is make a subreddit. (i seen sites do this)

    or of course stay active on other social media sites like facebook or twitter

    Two things, the plugin I thought would help actually makes things worse, didn’t expect that, though the second thing, running what I ‘thought’ should work that I have tested previously also now doesn’t work. šŸ™

    I’ll need to test both of these tomorrow, and I’ll update things then, depending on the solution we are talking a range of 50-90% improvement in performance, so why either of these options is failing for me at the moment I’m unsure.


    Nitac
    Participant

    @mchl

    ok cool, thanks for looking into it Stephen really appreciate it.

    cheers


    Robkk
    Moderator

    @robkk

    @mchl did the reply submitting slow down after you installed a specific plugin??

    cause i read the new site topic on your private forum, and it seems that users only started to complain about reply submitting being slow after you installed some plugins like unread posts and go to first unread posts.

    if it was always slow wait til @netweb gives you some info and ill do more research on the problem, if it was until you installed the plugins deactivate them and see if it makes a difference.

    Firstly, a quick breakdown via pingdom, quite a delay in getting your JavaScript files, I’d get these into your Amazon CDN.

    As you stated above “ive eliminated all the points youā€™ve made above, and the site only chokes when users are submitting posts in the forum, so Iā€™m confident iā€™ve isolated the issue.”

    • What happens when you deactivate either/or “Go to first unread” & “Unread posts” plugins you’re using and submit a reply to an affected topic?
    • Another test, this time with the ‘Quotes’ plugin disabled submit a reply to an affected topic.
    • Another, what code and/or plugin are you using to show the user registration in each reply e.g. Join Date: Mar 2009
    • And another, what code and/or plugin are you using for the counts shown next to the username in each reply e.g Posts: 4529

    Can you run the following two queries in phpMyAdmin, it will give me an idea of the state of the data in your database, it is the topic and three replies (two imported replies and one new bbPress reply) from the ~10k topic you have:

    
    SELECT ID, post_author, post_parent, menu_order, post_type
    FROM  wp_posts
    WHERE  ID
    IN ( 490979, 831628, 837704, 1031603 ) 
    

    and

    
    SELECT * 
    FROM  wp_postmeta
    WHERE  post_id
    IN ( 490979, 831628, 837704, 1031603 ) 
    

    Once you have the results of each (they don’t show any ‘sensitive’ data) click the “Print View” and copy and paste them to a text file, a Gist or to pastebin for me to checkout please.

    Over the weekend I had to reinstall everything here locally (and my online servers for a different reason) as something was up with my database, I’ve created a topic here locally with ~10,000 replies today (similar in size to your second most popular topic) and it takes ~1.6 seconds to post a reply to this topic. To time the queries, install the following plugin and of course only have it activated whilst your debugging this stuff https://wordpress.org/plugins/query-monitor/


    Nitac
    Participant

    @mchl

    Cheers for the response and thanks for your time and effort looking into this, much appreciated.

    For the test below i set up a hidden forum on my live server.

    What happens when you deactivate either/or ā€œGo to first unreadā€ & ā€œUnread postsā€ plugins youā€™re using and submit a reply to an affected topic?

    • I just went through all the bbpress related plugins and tried different combos and didn’t notice any significant performance differences.

    Another test, this time with the ā€˜Quotesā€™ plugin disabled submit a reply to an affected topic.

    • Using GDPress and had the same results as above

    Another, what code and/or plugin are you using to show the user registration in each reply e.g. Join Date: Mar 2009
    And another, what code and/or plugin are you using for the counts shown next to the username in each reply e.g Posts: 4529

    • Using the function below. Again I disabled and noticed no significant improvement.
    
    
    function func() {
    
    $roleData = bbp_get_user_role(bbp_get_reply_author_id( $reply_id ));
    
    if($roleData=='bbp_moderator'){
            $data='<div class="bbp-author-role">Moderator</div>';
    }
    
    $registered = date("M Y", strtotime(get_userdata(bbp_get_reply_author_id())->user_registered));
    
    $post_count = bbp_get_user_reply_count_raw( bbp_get_reply_author_id( $reply_id )) ;
    
    $data.='<div class="bbp-reply-ip"><span class="bbp-author-ip">';
    $data.='Join Date: '.$registered;
    $data.='<br />';
    $data.='Posts: '.$post_count;
    $data.='</span></div>';
    }
    

    Here’s the results for the first query

    And the second query

    Something I did notice when testing, was that when I was posting in the new topc I created, posts seemed to be submitting relatively quicker, 2 – 5 secs per post. Though when posting in a thread that had a lot more replies the post submission took a lot longer.

    I tried the query plugin you suggested and getting relatively good results everything is < 2 secs, but it only shows the performance of the query results, and doesn’t take into account the time it takes to submit, which is > 10 secs. (unless I’m overlooking something??)

    Thanks


    daniellajos.nl
    Participant

    @daniellajosnl

    For our site, with 121 forums, +150k topics and +1.1m replies, it could take up 30s before something is posted. I traced it down to this query:

    
            //$voices = $wpdb->get_col( $wpdb->prepare( "SELECT COUNT( DISTINCT post_author ) FROM {$wpdb->posts} WHERE ( post_parent = %d AND post_status = '%s' AND post_type = '%s' ) OR ( ID = %d AND post_type = '%s' );", $topic_id, bbp_get_public_status_id(), bbp_get_reply_post_type(), $topic_id, bbp_get_topic_post_type() ) );
    

    includes/topics/functions.php, line 2610. It uses an OR clause, and MySQL (only in 5.1.73?) isn’t able to use an index anymore after a certain amount of records in the wp_posts table. I replaced the query with an UNION statement, and it executes much faster now, since it is using indexes again (as the EXPLAIN statements show me on a database with and without this amount of replies/topics):

    
            $unionQuery = "SELECT COUNT( DISTINCT post_author )
                FROM (
                    SELECT post_author
                    FROM {$wpdb->posts}
                    WHERE post_parent = %d AND post_status = '%s' AND post_type = '%s'
                  UNION
                    SELECT post_author
                    FROM {$wpdb->posts}
                    WHERE ID = %d AND post_type = '%s'
                  ) AS alias;";
        $voices = $wpdb->get_col( $wpdb->prepare( $unionQuery, $topic_id, bbp_get_public_status_id(), bbp_get_reply_post_type(), $topic_id, bbp_get_topic_post_type() ) );
    

    Robkk
    Moderator

    @robkk

    @daniellajosnl

    thanks for sharing!!


    @netweb

    check that out.


    TriiXx
    Participant

    @triixx

    Hi,

    Sorry for up this old topic but i have the same issue.

    I’ve migrate my Kunena forum to bbpress. It’s good but create topic and post answer are so sllllllow (juste post and create).

    I’ve trie @daniellajosnl script but without success.

    Thanks for your help


    senatorman
    Participant

    @senatorman

    Is there any solution for this slow post/reply problem.

    I’ve the same problem and lose visitors


    senatorman
    Participant

    @senatorman

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