Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I miss path caching :(
Here's a couple of patches that are doing the trick for me, been running in production for a week or so on a 2M+ pageview/month site. It's nice to see those drupal_lookup_path's disappear from the devel query logs again. The path.inc.no_serialize.patch is for memcached users.
Comment | File | Size | Author |
---|---|---|---|
#13 | d6-6.path_.patch | 2.84 KB | mikejoconnor |
#6 | path.inc.patch | 2.63 KB | tomchuk |
#6 | path.inc_no_serialize.patch | 2.58 KB | tomchuk |
path.inc_no_serialize.patch | 2.44 KB | tomchuk | |
path.inc.patch | 2.49 KB | tomchuk |
Comments
Comment #1
tomchuk CreditAttribution: tomchuk commentedForgot to mention, path.inc patches are against Drupal 5.9
Comment #2
firebus CreditAttribution: firebus commentedtomchuck, do these patches resolve the issues raised in http://drupal.org/node/220983? if so, how?
Comment #3
firebus CreditAttribution: firebus commentedalso, please make sure to apply jeremy's change from http://drupal.org/node/230235
Comment #4
tomchuk CreditAttribution: tomchuk commentedWhen imagecache handles a request it calls
file_transfer()
at the end of its menu callback forfile_directory_path() .'/imagecache'
(theimagecache_cache
function).file_transfer()
callsexit()
after sending the image, which means thathook_exit
is never called. Because the caching is done inhook_exit
(see advcache.patch), the no_src and map are never cached for imagecache requests. I have confirmed this with watchdogs inadvcache_exit
and with my own cache_path hit rate (low 80s) on a highly trafficed site with very heavy use of imagecache (30+ presets and 10k+ images)Regarding the count query, I didn't think it appropriate to make any more changes than necessary from core. With my path.inc patch applied, the query remains the same as the one in core. If there are dramatic gains to be had by tweaking the query, I think it should be submitted as a core patch, not addressed in a contrib module. Just my $0.02.
Comment #5
tomchuk CreditAttribution: tomchuk commentedI should also note that the above is for imagecache-5.x-1.5. I have downloaded 1.6 and the code is the same, but ads another call to
exit()
afterfile_transfer()
. Imagecache 2.1 changes its behavior quite a bit, but every path out of_imagecache_cache
that I can see ends in a call toexit()
, which means that this patch should work fine with all 5.x releases of imagecache.Comment #6
tomchuk CreditAttribution: tomchuk commentedHere's the above patches with jeremy's modified count query.
Comment #7
tomchuk CreditAttribution: tomchuk commentedWow that does make a difference on InnoDB, with no real difference on MyISAM.
Execution times for 1000 queries with no query caching, average of 3 runs on url_alias table with 160155 entries.
SELECT COUNT(*) FROM url_alias;
- MyISAM: 0.071s | InnoDB: 57.13sSELECT COUNT(pid) FROM url_alias;
- MyISAM: 0.081s | InnoDB: 59.39sSELECT pid FROM url_alias LIMIT 1;
- MyISAM: 0.078s | InnoDB: 0.094sComment #8
tomchuk CreditAttribution: tomchuk commentedRunning imagecache 2.1 now in production, and things are still working great.
Comment #9
iKillBill2 CreditAttribution: iKillBill2 commentedwill this work on drupal 5.12?
Comment #10
tomchuk CreditAttribution: tomchuk commentedYes, path.inc and advcache.module patches apply with a little fuzz on Drupal 5.12 and Advcache 1.9.
Comment #11
Petrica CreditAttribution: Petrica commentedI'm using it on a Drupal 5.12 production site and it looks OK. No problems reported.
Thx for the patches.
Comment #12
mikejoconnor CreditAttribution: mikejoconnor commentedI've been running this on a site with 5m page views/month, with 1.2 million url aliases. Its made a HUGE difference. What further testing do we need to bring this back to the main advcache module?
Comment #13
mikejoconnor CreditAttribution: mikejoconnor commentedHere is a patch for this version of the path fix, for D6. For the rest of the d6 upgrade please see Issue 242121.
Seems to be working well for me.
Comment #14
mikejoconnor CreditAttribution: mikejoconnor commentedsorry, didn't mean to change the status earlier
Comment #15
Brumisek CreditAttribution: Brumisek commentedWhat about patch for memacache module? I also need path (url_alias) improved in this module :(:( Drupal 5.x