Posted by adamfranco on July 28, 2011 at 3:08pm
3 followers
| Project: | Nodewords: D6 Meta Tags |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (fixed) |
| Issue tags: | v6.x-1.12 blocker |
Issue Summary
Because _nodewords_detect_type_and_ids() makes a call to _nodewords_get_pages_data(), nodewords_load_tags() gets called for every single page in the nodewords_custom table. For a site with 1000 entries in the nodewords_custom table this results in an extra 1000 queries on every page load, just to find out if a path in nodewords_custom matches the current path.
Loading just the content of the nodewords_custom table when determining path matches will greatly cut down on unneeded queries.
Comments
#1
I'm attaching a patch with resolves this issue.
#2
I have done some load-testing with this patch on a site that has 1,194 rows in nodewords_custom and 114,293 rows in the nodewords table and the throughput on my site has jumped from an average of 9.7 requests/second to 21.2 requests/second.
#3
I think this should be included in the next release.
#4
#5
The last submitted patch, Issue-1232498.patch, failed testing.
#6
The current _nodewords_get_custom_pages_data() function includes static caching already, making this redundant. Thank you for the effort, though!
#7
Automatically closed -- issue fixed for 2 weeks with no activity.
#8
Hi Damien,
This issue still exists and is not solved by the static caching. The problem is very severe when a site has many entries in the
nodewords_customtable. Even with the caching changes, aSELECT * FROM nodewords WHERE type = 10 AND id = ?query gets run for every entry in nodewords_custom. Our site has about 2000 entries in nodewords_custom and this results in an extra [unnecessary] 2000 queries on every page load, enough to take down our database host._nodewords_detect_type_and_id()doesn't need all of the metadata for every custom path, just the paths and ids, and this patch allows_nodewords_detect_type_and_id()to access just the data it needs in a single query.I have recreated the patch against the 6.x-1.x HEAD (and hopefully formatted it correctly with git-format-patch).
Best,
Adam
#9
You've convinced me. Committed, it'll be in the next release.
#10
Automatically closed -- issue fixed for 2 weeks with no activity.