XF 2.1 xenForo and the lovely performance

au lait

Well-known member
after five years since my last post on this subject, I have to bring it up one last time.
When we changed from XF1 to XF2 our loading times increased massively.

so we once invested in a new server - clearly totally oversized.
2 processors (40 cores) 3,2 Ghz
256 GB RAM ECC
8X 1TB SAS SSD RAID 6

nginx, PHP 7.3 - 7.4 comes the days,
The DB is super fast and not at all our problem. It is actually XF.

For example, the method loadNodeTypeDataForNodes is very very very slow and provides almost 300% more time - with hardly measurable more DB time.

More infos zum Testaufbau siehe Spoiler
StartPage without loadNodeTypeDataForNodes
Code:
Page Time: 0.1482s
Memory: 18.8146 MB (Peak: 18.9180 MB)
Queries (6, time: 0.0037s, 2.5%)

vs

with loadNodeTypeDataForNodes
Code:
Page Time: 0.4283s
Memory: 55.7910 MB (Peak: 63.1037 MB)
Queries (9, time: 0.0090s, 2.1%)


At the end of the day our start page is at just under 1 second loading time!
Code:
Page Time: 0.8352s


@au lait it would be interesting to see a profile graph of that using xdebug & webgrind or similar.
NOW :) Attachments :)

owever, in general, we wouldn't consider 2000 nodes to really be a "normal"
i also find the discussion at that time about too many nodes a little out of place! It shouldn't matter if 50 users or 50k users as well as 5 nodes or 5k. I find it crass to say that these are not normal quantities! Who defines normal? Why are 5K or 100k users normal and not just 50? But 5K nodes not but 50?

I think, I hope - that there is still room for improvement on the part of XF that this will get better.

For questions and further data/tests I am at your disposal


And while I'm at it, working with user groups is a massive task of patience at XF! I can't have to wait minutes and minutes for permissions to be rebuilt when I change a group! For me a clear design flaw! Sure, for a small forum like this support forum, everything runs super and fast. But what about a monetized professional environment?

Hence my appeal to the developers to make XF a professional software and not a toy. 😘


For this test I had to make some changes to avoid 10K queries ;)

Code:
    public function getNodeList(\XF\Entity\Node $withinNode = null)
    {
        if ($withinNode && !$withinNode->hasChildren())
        {
            return $this->em->getEmptyCollection();
        }

        $nodes = $this->findNodesForList($withinNode)->fetch();
        //$this->loadNodeTypeDataForNodes($nodes);

        return $nodes;
    }

Code:
    public function actionList(ParameterBag $params)
    {
        $nodeRepo = $this->getNodeRepo();
        $nodes = $nodeRepo->getNodeList();

        $nodeTree = [];
        $nodeExtras = [];
        //$nodeTree = $nodeRepo->createNodeTree($nodes);
        //$nodeExtras = $nodeRepo->getNodeListExtras($nodeTree);

        $viewParams = [
            'nodeTree' => $nodeTree,
            'nodeExtras' => $nodeExtras
        ];
        return $this->view('XF:Forum\Listing', 'forum_list', $viewParams);
    }

As well as emptying the template "forum_list
 

Attachments

resolveExtendedClassToRoot is surprisingly expensive, and is probably one of those things which can be trivially cached.

i also find the discussion at that time about too many nodes a little out of place! It shouldn't matter if 50 users or 50k users as well as 5 nodes or 5k. I find it crass to say that these are not normal quantities! Who defines normal? Why are 5K or 100k users normal and not just 50? But 5K nodes not but 50?
Node count is challenging as it has been baked in that the number of nodes isn't going to be huge, as it is loaded at once in several places.

Users on the other hand, the entire code base expects massive amounts of users so virtually never touches them without paging or limits.
 
I'm about to face an interesting challenge later this year when I upgrade the last of me XF1.5 sites to 2.x - that one has only 177 nodes, but it also has 2,543 thread prefixes and 2,952 gallery categories!

What's more our current intention is to start using "albums within a category" to store batches of uploads (typically up to 100 photos at a time from a specific event) and we expect hundreds of albums to be created per year - so it wouldn't surprise me if we hit 5,000+ albums/categories before too long.

I suspect I'm going to need some careful performance tuning / debugging to get that to perform well.
 
  • Like
Reactions: Xon
Top Bottom