In the -2.x branch of node hierarchy, nodes are entered into the menu table to leverage the menu functionality for displaying breadcrumbs, etc. This seems a good idea, but when the number of nodes become large every page refresh forces drupal to check access for each and every menu item, even those not displayed (ie. hidden node hierarchy ones).
The few solutions I've seen to this involve hacking the core to remove a line from the menu code, which is not acceptable.
Setting the default node-hierarchy menu to a seperate menu that is not rendered on each page request seems to resolve the performance hit, but presumably the issue will still exist when acces to the hierarchy is required.

Comments

jlballes’s picture

+1

this_is_it’s picture

Yea, this's a tough problem. When there's hunders of thousands of nodes created, the 'menu_link' table will become very large, and if you wanna display whole hierarchies, you have to traverse this table recursively, leading to a poor performance.

Actually this module is great, but is not pure for managing node hierarchies, it leverages drupal's menu mechanism and provide options for menu entries which maybe is not what users want.

I think it would be better off having a relatively independent module just to manage 'node hierarchies' with functionalities such as displaying the whole structures, CRUD parent/children/ancestors/descendants/ nodes with a sounding performance, etc.

But doing is always harder than saying, just a few ideas for reference.

kirby14’s picture

I ran in to an issue with this. I actually had to up the limit for packet size in mysql just to not throw an error because of the size of the SQL query. It wasn't a performance or memory issue, the query was just too long because it was checking every single node.

this_is_it’s picture

Hi kirby14, how many nodes currently does your website have ?
Actually, Drupal's menu system makes use of 'Adjacency List Model' to handle tree designsing, which has performance issues when there're a large number of nodes, a more effective alternative implementation is to use 'Nested Set Model'.

kirby14’s picture

It started to blow up when I imported 800 new nodes.

this_is_it’s picture

I'm considering to build a module to handle node hierarchies with scale up to 1M nodes, any progress I'll post here.

rogerrogers’s picture

I can confirm this performance hit is significant. We imported 500 nodes to a hierarchy that goes up to 5 nodes deep, and performance has tanked. Oddly, some pages load quickly, others, even the same page at a different time, will take a long time, sometimes never load. I think node hierarchy works fine for smaller sites, but when you start managing even moderate amounts of nodes it becomes a problem.

It's a great module. Probably just needs some perf tuning.

kristen pol’s picture

Title: Large number of nodes causes performance issue when using node hierachy » Large number of nodes causes performance issue when using node hierarchy