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.
| Comment | File | Size | Author |
|---|---|---|---|
| domain_alias_list-static-cache.patch | 1.43 KB | isampo |
Comments
Comment #1
agentrickardThanks/ I wonder if this is still true in 7.x?
Comment #2
isampo commentedNope, I think you fixed that for D7 at Query cache for domain_lookup().
Comment #3
agentrickardThanks.
Comment #4
agentrickardDelayed, but committed.