Closed (won't fix)
Project:
Drupal core
Version:
7.x-dev
Component:
base system
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
13 Nov 2009 at 00:53 UTC
Updated:
1 Mar 2010 at 08:19 UTC
Jump to comment: Most recent file
Comments
Comment #1
catchArgh, wrong patch.
Comment #2
yched commentedDoes this apply to _field_info_collate_fields() and _field_info_collate_types() as well ?
Comment #3
catchI think it does.
Comment #4
yched commentedand _field_info_collate_fields() ? ;-)
Comment #5
catchIf you insist :)
Comment #6
catchhttp://drupal.org/node/631420
Comment #7
dries commentedBut where do we draw the line? If it is called on almost every request, it might harm the requests it is not called on?
The name cache_boostrap suggests that it should be called as part of the bootstrap process?
Comment #8
catchI don't think we need to be so strict as to say you can only put thing in here which are 100% necessary to bootstrap Drupal to DRUPAL_BOOTSTRAP_FULL, or at least that wasn't my intention in the original patch. I originally wanted to call the bin cache_local, but that would've been too tied to using it with shared memory. However you can slightly stretch the definition of 'bootstrap' to include the bootstrapping of particular APIs when they're invoked - i.e. any request to the field API or entity API requires these specific caches.
We're never going to load stuff from cache_bootstrap that's not needed for a request, so the only implication for putting things in here which aren't 100% necessary for bootstrap is storage, and the additional impact of cache misses when that cache needs to be rebuilt per-web head. IMO the entity and field info caches are sufficiently low level, and infrequently rebuilt, that they're good candidates.
Either way this has to be done case by case - I think the menu router cache is also requested every request, but menu rebuilds and caching is quite expensive and frequent, so that might not be a good candidate.
Comment #9
yched commentedDries, it seems you committed the field.info.inc part of this along with http://drupal.org/cvs?commit=288558
Comment #10
yched commentedEr, which means HEAD is broken because the patch had
(instead of 'cache_bootstrap'), and cache_field_bootstrap table doesn't exist.
Comment #11
catchRollback
Comment #12
dries commentedRolled back. Thanks!
Comment #13
yched commentedThks :-). back to 'normal', then.
Comment #15
catchMinus typo this time.
Comment #17
yched commentedI'll add that it only makes sense to cache field meta data (set of available [field|widget|formatter] types, set of actual field and instance definitions) in a different table than the one used for field values cache.
Comment #18
catchNot my day today, field tests pass locally with this one.
Comment #19
chx commentedThere is indeed a balance to be made. The typical scenario is that you will have N webfrontends which will put cache_bootstrap in shared memory (apc/xcache variables, System V shm, black magic, whatever). Now, shared memory suffers from some problems: size as one segment is, by default is 32MB (on Linux and FreeBSD). Of course, you might have more than one segment but for some reason apc.shm_segments defaults to 1 so I have a bad suspicion that there are some (serious) disadvantage to several segments. As a working hypothesis, let's accept that 32MB is what we can work with. I will ask about the disadvantages of raising apc.shm_segments.
In that 32MB you need to stuff your op cache and cache_bootstrap. In other words, given the code size of Drupal, you better think twice when stuffing a complicated structure in cache_bootstrap. It's a great idea and very very useful but be careful. Menu was already raised and I would object that severely, for example. How big is this entity info your try to stuff in?
Comment #20
chx commentedNote that APC supports an MMAP mode where apc.shm_segments are disregarded and the shmmax is not in play at all so at least with APC the size is not a problem . However, explaining someone that in order to use cache_bootstrap efficiently, she might need to recompile APC with --enable-apc-mmap and change configuration to be able to raise the memory accessible to APC, that's fun.
Comment #21
catchEntity info is one array for each defined entity, I can't see it being more than 1k or so. For comparison, I have a D6 site with over 1200 entries in the variables table, and that whole table in memory is 100k.
Comment #22
chx commentedThen that's good. It was worth a few followups to show we thought of this.
Comment #23
yched commentedField types info amounts to 13k with core field types and widgets. This should reasonably reach at most 50k-100k with contrib field types.
Field definitions size growth is a little harder to predict. On my setup (9 fields, 15 instances), this amounts to 19k. At this rate, 100 fields and 200 instances would roughly raise to something like 250k.
Comment #24
R.Muilwijk commented+1 for me!
Attached is a new patch which applies. Alot of the previous touched files do not need any patch anymore because a function has been added to common.inc:6374 to clear the cache.
Comment #25
yched commentedrdf.test still has
Other than that, this can bet set back to RTBC, as per #21.
Comment #26
R.Muilwijk commentedHmmz that got in with a recent commit I guess... or just missed it. New patch attached.
Comment #27
yched commentedThx !
Comment #28
catchNow this is cached per language, I think this is won't fix.
Comment #29
R.Muilwijk commentedThe change catch mentioned can be found in http://drupal.org/node/503550. I still would like to have a look into this. cache_field is not likely to be cached in APC on every webnode. So it could still be a good change to move 'field_info_types' to a different bin then 'cache_field'.