Add a cache_bootstrap bin
| Project: | Drupal |
| Version: | 7.x-dev |
| Component: | base system |
| Category: | task |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
| Issue tags: | Performance |
A lot of high performance sites put the {cache} bin into shared memory (APC etc.) instead of memcache, because APC is faster than memcache, and having the cache bin local to the webserver saves sending big cache objects (variables etc.) across the network every request.
However, {cache} is a big dump of stuff from modules which are too lazy to make their own cache bin, and putting stuff into APC means that if you have have as many caches to maintain and rebuild as you do webheads - so a lot more cache misses.
So, this patch adds a {cache_bootstrap} table - to be used for things like variables, registry, module_implements(), entity info, locale cache which are required on every page request (and also happen to be fairly infrequently rebuilt). I'd originally thought of {cache_local} but Damien suggested cache_bootsrap in another issue, and that's more descriptive - although it's possible we'd want some things there which aren't technically required for a bootstrap.

#1
Here's a start on a patch.
While rolling this, I noticed that we appear to have an entire cache_registry bin, which only holds a single cache entry, so we might want to remove that one too - since that cache entry will want to go in cache_bootstrap too.
#2
The last submitted patch failed testing.
#3
Removed cache_registry. Drupal installs locally for me now.
#4
The last submitted patch failed testing.
#5
Incomplete find and replace, this should be a little better.
#6
grrr.
#7
#8
sorry - edited wrong issue.
#9
+++ includes/update.inc 9 Nov 2009 12:44:17 -0000@@ -286,6 +286,10 @@ function update_fix_d7_requirements() {
+ $schema['cache_bootstrap']['description'] = 'Cache table for the form system to store recently built forms and their storage data, to be used in subsequent page requests.';
This one doesn't look correct to me.
Also, it would be good to capture the APC-trick in documentation somewhere. It doesn't have to be a long description, but a one or two sentence explanation would be great. Not instructions on how to set it up (that would live on drupal.org), but just a small description as why we store things in a separate bin.
#10
Not sure if it's enough of a hint, but put the APC information in the schema description.
#11
That is sufficient for me, but not necessarily great. Can't think of a better place to document this though. I'll commit this patch later today unless someone has a better suggestion.
#12
I don't have a better suggestion. There are a lot of high performance tips and we can't possibly doc them all in the code.
Patch looks good to me too.
#13
Alright! Committed to CVS HEAD. Thanks.
#14
Automatically closed -- issue fixed for 2 weeks with no activity.
#15
I am seeing a fatal error when a D7 site first loads update.php with a D6 DB. we try to query cache_bootstrap during the variables stage of bootstrap but the table does not exist yet. We need to either create that table even earlier or we need to use a FakeCache during update.php