following on from here, now that d.o. has memcached, and the most recent forum posts block has been identified as a mysql-killer, perhaps we should put that block into memcached with a 90 second (or something similar) expiry time?
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | forum.memcached.patch | 1.38 KB | Anonymous (not verified) |
Comments
Comment #1
Anonymous (not verified) commentedfrom the "Improvements to the Drupal.org infrastructure" page:
how is d.o. configured re. the memcache module?
i'm up to step 9. in the installation of the memcached module:
and i'm wondering if i should use memcache.inc or memcache.db.inc so i have as close as possible to d.o.?
Comment #2
Anonymous (not verified) commentedeeep.
node_title_list expects a db resource, not an array of nodes, so this patch will have to do one of:
- not use node_title_list, and generate the list via a copy of the functionality of node_title_list
- change node_title_list to work with either and array of node objects or a db resource
the first option is hacky, but keeps changes out of node.module, the second is possibly cleaner, but means changing node.module.
suggestions?
Comment #3
Anonymous (not verified) commentedor, just cache the html, which is what i do in the attached patch against DRUPAL-5-2 - not sure if that matches what's running on d.o.
this patch assumes that the Drupal memcache module is installed.
Comment #4
Anonymous (not verified) commentedComment #5
moshe weitzman commentedyou should add a check to see if any node access module is active. if yes, do per user caching, or none at all. here is the code:
Comment #6
pwolanin commentedfor now, how about a custom PHP block (or theme function) that caches the result for the desired time - no need to even hack core...
Comment #7
moshe weitzman commentedyou should add a check to see if any node access module is active. if yes, do per user caching, or none at all. here is the code:
Comment #8
kbahey commented@justinrandell, just FYI, caching is a general Drupal API, not memcache specific.
So if you use cache_set() and cache_get(), it should work with the database cache, memcached, and flat file cache.
Just do a cache_set on the HTML of the final block, and retrieve it the same way.
If you look at the affiliates module, it does exactly that http://drupal.org/project/affiliates.
The permissions thing that moshe mentioned does not apply to Drupal.org, since we don't have private forums or private forum posts, but it is a good thing to have as a general feature for the forum module.
Another option is the block cache module too http://drupal.org/project/blockcache.
Comment #9
dries commentedThat patch looks OK for drupal.org. It's not something that could be committed to CVS HEAD as is, but it should work in the drupal.org use case. We don't use any node access modules on drupal.org so no need to worry aboutt hat.
For CVS HEAD, Gerhard proposed a more generic solution: http://drupal.org/node/80951 ... as we will upgrade drupal.org to CVS HEAD before the final Drupal 6 release, it might be worth putting some time and effort into issue #80951.
In other words: this patch should get the job done (short term solution), but let's focus on polishing #80951 (medium + long term solution).
Comment #10
Anonymous (not verified) commentedis there anything else i need to change re. this patch for the short term fix for drupal.org?
will take a look at this on the weekend.
Comment #11
Anonymous (not verified) commented