This issue is related to the Domain User module is slow when having lots of domains so I'm not going to get much into details here.

Basically, when you have lots of domains (thousands) on your Drupal site, Domain Alias becomes kind of a query monster. It's because the domain_alias_list() function is called multiple times per page load (as many times as you have domains). It's being called by the domain_alias_domainload() when Domain Alias is adding the alias information into the domain array.

This can be solved with small static "caching". We load all Domain Alias records to a static variable at the first call to the domain_alias_list() function and use them from there in the later calls. Small patch attached.

CommentFileSizeAuthor
domain_alias_list-static-cache.patch1.43 KBisampo

Comments

agentrickard’s picture

Thanks/ I wonder if this is still true in 7.x?

isampo’s picture

Nope, I think you fixed that for D7 at Query cache for domain_lookup().

agentrickard’s picture

Thanks.

agentrickard’s picture

Status: Needs review » Fixed

Delayed, but committed.

   4a48ab6..356271f  6.x-2.x -> 6.x-2.x

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.