Manual:$wgMaxPPNodeCount

Details
A complexity limit on template expansion.