The Situation
I have multiple different "search" and "browse" pages on my site using Apache Solr. On some of these pages I want certain facet blocks to show up, and on other pages I want different facet blocks to show; on some of the pages I want the facet blocks to show in the left sidebar of my site, and on other pages I want the facet blocks to show in the right sidebar.

The Solution
As far as I know, the only way to accomplish what I want is to create multiple Apache Solr search environments, since each environment can define its own set of facet blocks, which can then be placed in separate regions of my site. So I have cloned my default environment, and now have three Solr search environments, which are the same, except for having different active facet blocks.

My Question(s)
1. Does having multiple Apache Solr search environments (all based on the same Solr server) in and of itself have any kind of negative impact on my site's performance?

2. Tons of active blocks
Because I now have three Solr environments, each with an average of 10 facet blocks, Solr has added 30 active blocks to my theme. Obviously, these are set to display on different pages, etc., but my question is, will all these blocks have a negative impact on my site's performance, even if they are not displaying on every page? I'm not that familiar with Drupal's bootstrap process, but I assume that when rendering a page Drupal has to iterate through all active blocks to see which ones should show up on the page being rendered? If that's the case, it seems like having an extra 30 active blocks could have quite a blow on performance... but maybe I'm wrong?

Thanks a lot to anyone who is able to help answer these questions!

Comments

nick_vh’s picture

1) Multiple environments do not impact the speed
2) Drupal loads all blocks by default so naturally this is a *huge* performance impact. I suggest you use a module such as context to make a smarter choice how it loads the blocks.

Does that answer your question?

pwolanin’s picture

Status: Active » Fixed

Well, the blocks are loaded, but the overhead is roughly a function call or two per block to get back the empty content.

I don't think it would be an issue. If it is an issue, you can set the block config so they are only loaded on the relevant page. Using something like "context" is probably slower than leaving it as-is.

jordanmagnuson’s picture

Thanks for the replies! pwolanin, are you saying that blocks with visibility settings that exclude a given page do not have any impact on page load for that page?

nick_vh’s picture

Status: Fixed » Closed (fixed)