Forum breadcrumbs – You are here:Asgaros Support ForumSupportForum Running Slow
Please or Register to create posts and topics.

Forum Running Slow

PreviousPage 2 of 3Next

When I go to the forum page where the short code [forum] is. It takes awhile for it to load just the main area to see the different topics and sub forums, when I remove the short code the page loads just fine. If it takes too long the server times out the connection.

Just to make sure that I understand it correctly: You said that only the main area is slow. That means the following forum-areas:

  • Overview (shows all forums/subforums)
  • Forum-View (shows all topics in a forum and subforums)

Correct? Other areas like when you visit a topic are loading at normal speed? Leave me a short note again when I understood it correctly because that could help me to find the problem.

Another point: How many topics/posts has your forum?

If you want to support the development of Asgaros Forum, you can leave a good review or donate. Thank you very much!

It doesn’t come up at all, I cant see the count of how many posts are on the forum, I think it might be over 10k.

I just tried going to individual forums and they work, it looks like its just the main area of the forum that is having issues, like the area on this forum where I picked Support.

Mh, I was curious about it because maybe it could be a problem when there are a lot of posts/topics inside a forum. You can see that information when the “Show statistics” option is enabled. Maybe it is already activated and its calculations slows the forum down?

Please check if disabling those three features temporarily has an effect:

  • Show who is online
  • Show statistics
If you want to support the development of Asgaros Forum, you can leave a good review or donate. Thank you very much!

Nothing happens when I disable those options.

Thank you for all your feedback! I will do some performance-tests with thousands of topics/posts and will try to do some improvements.

If you want to support the development of Asgaros Forum, you can leave a good review or donate. Thank you very much!

Hello again,

I think I found one possible solution. Please try this fix. Open the file /wp-content/plugins/asgaros-forum/includes/forum.php. Search for the following line:

return $this->db->get_row($this->db->prepare("SELECT (SELECT COUNT(p_inner.id) FROM {$this->tables->posts} AS p_inner WHERE p_inner.parent_id = p.parent_id) AS number_of_posts, p.id, p.date, p.parent_id, p.author_id, t.name FROM {$this->tables->posts} AS p INNER JOIN {$this->tables->topics} AS t ON p.parent_id = t.id INNER JOIN {$this->tables->forums} AS f ON t.parent_id = f.id WHERE f.id = %d OR f.parent_forum = %d ORDER BY p.id DESC LIMIT 1;", $id, $id));

Replace it with:

return $this->db->get_row($this->db->prepare("SELECT (SELECT COUNT(p_inner.id) FROM {$this->tables->posts} AS p_inner WHERE p_inner.parent_id = p.parent_id) AS number_of_posts, p.id, p.date, p.parent_id, p.author_id, t.name FROM {$this->tables->posts} AS p, {$this->tables->topics} AS t WHERE p.id = (SELECT p_id_query.id FROM {$this->tables->posts} AS p_id_query INNER JOIN {$this->tables->topics} AS t_id_query ON p_id_query.parent_id = t_id_query.id INNER JOIN {$this->tables->forums} AS f_id_query ON t_id_query.parent_id = f_id_query.id WHERE f_id_query.id = %d OR f_id_query.parent_forum = %d ORDER BY p_id_query.id DESC LIMIT 1) AND t.id = p.parent_id;", $id, $id));

This change makes a query which is used inside the overview much more faster so it needs less than 1% of the execution-time before when a forum has a lot of topics and posts.

Please give me feedback when you tested it so that I can release a fix for this as soon as possible.

If you want to support the development of Asgaros Forum, you can leave a good review or donate. Thank you very much!

I could identify more bottlenecks which are now hopefully all fixed. Please download this development-version of the plugin and replace the files on your server via an FTP-client:

https://github.com/Asgaros/asgaros-forum/archive/6690ba61446fa409304a06159d2d284bc4a9abb6.zip

That version should be stable and safe to use. I am looking forward to your feedback! 🙂

If you want to support the development of Asgaros Forum, you can leave a good review or donate. Thank you very much!

Ok great, I will setup a staging area to test it out, I will let you know as soon as I can.

PreviousPage 2 of 3Next