Closed (fixed)
Project:
Drupal core
Version:
7.x-dev
Component:
path.module
Priority:
Normal
Category:
Task
Assigned:
Reporter:
Created:
28 Jul 2006 at 04:01 UTC
Updated:
7 Apr 2008 at 14:02 UTC
Jump to comment: Most recent file
On the developer list, we've been discussing ways to reduce the number of drupal_get_path() queries run during page load.
One option is to allow site admins to throttle path lookups based on some (sane) rules. For example, in 95% of cases, 'admin' paths do not need aliasing.
This task is one attempt to correct this issue.
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | benchmark.txt | 12.98 KB | agentrickard |
| #7 | path_new_0.patch | 3.94 KB | agentrickard |
| #6 | path_new.patch | 3.94 KB | agentrickard |
| #5 | path_allowed_alias_2.patch | 3.02 KB | agentrickard |
| #4 | path_allowed_alias_1.patch | 3.02 KB | agentrickard |
Comments
Comment #1
agentrickardMore accurate title
Comment #2
agentrickardPatch to show how the disable lookup works.
No admin settings yet.
Comment #3
agentrickardI have rolled the admin interface patch.
The attached is the revised patch. It affects common.inc and path.module.
A thought. The items in path.module might have to go into system.module, since path lookups operate independent of path.module being activated.
Comment #4
agentrickardMinor correction to address how variables are saved when using a checkbox.
Comment #5
agentrickardCorrection to the last correction. Mixed variable array behaves as a string!
Comment #6
agentrickardAnother fix. The path module uses nodeapi to do lookups directly. New patch accounts for this behavior.
Testing the patch very quickly on a local machine with zero traffic, it is clear that it can cut SQL queries drastically.
The question is whether it speeds performance or just shifts the burden.
Comment #7
agentrickardLast fix to patch, correcting a typo.
Comment #8
agentrickardTest results.
I ran Apache Benchmark tests on two pages /blog and /forum/22 from 12 noon to 12:45 pm.
Attached are the full reports. Summary below:
While the number of database queries drops substantially, the actual processing time goes up, as both Requests per Second and Transfer Rate drop after the patch is applied.
This may be due to the placement of variable_get() in the patch, but more likely, it seems that using the PHP-based check (which requires array handling) just shifts the load from the database to memory.
I'd be interested to see other (more technically expert) people try this patch and test it to see if the results are the same.
Comment #9
alex_b commentedHi agentrickard,
Your patch and tests look interesting. I stumbled across them actually looking for something a lot more basic: I want to avoid DB hits on url_alias table when path.module is actually _turned_off_ . I got a website with lots and lots of links on a single page, each link causing a hit to url_alias through drupal_lookup_path() even though path.module is off.
I couldn t find the discussion you are referring to, so I hope I don't come up with old questions...
How about turning off looking up paths in url_alias, when path.module is not present?
I couldn't try your patch so far, but looking at your code: did you try caching results in a static variable in drupal_alias_allowed ? This could speed things up.
Alex
Comment #10
L4san commentedHow's this task progress?
Moving to cvs.
Comment #11
agentrickardI dropped it, since the AB tests showed no improvement.
I believe there are other solutions in the works now.