Closed (fixed)
Project:
Pathauto
Version:
7.x-1.x-dev
Component:
Documentation
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
19 Dec 2007 at 13:11 UTC
Updated:
28 Jun 2011 at 23:21 UTC
Will using pathauto slow down my site node loads?
Comments
Comment #1
gregglesThe answer is both yes and no.
Pathauto will slow down the creation and editing of most objects (users, nodes, taxonomy) on your site because it does it's work of creating aliases during the creation/editing of those objects. Most people don't edit objects very often compared to how often a page is viewed so this is not a problem. This problem can be amplified if you have a lot of modules that provide a very large number of tokens or tokens which are expensive to calculate (see this issue where calculating a single alias takes 2,167 queries!).
The other place where Pathauto will slow down a site is when admins have a large number of objects on their site and configure Pathauto create aliases for every single object on a site (this is made worse when they also create feed aliases for every object). The reason this slows down a site is that for every page load, all links that Drupal creates are checked against an alias table. For example, at the top of this page are the node tabs for view, edit, and outline (depending on your permissions). When they are displayed, all of those links are checked against the url_alias table to see if there is an alias for them. When your site gets more and more entries in the url_alias table this query will take longer and longer. While it may be fast on it's own (fractions of a second) if you have a page that shows lots of links that are passed through l/url functions then having hundreds of those queries will add up to serious time.
So, in general Pathauto on its own will not slow down a site. But it certainly can make a site slow under certain circumstances.
Comment #2
gregglesAlso, I've been meaning to do some benchmarking to determine best practices here, so I'm going to turn this into an issue for that.
If anyone else wants to do that, it would be awesome :)
Comment #3
Freso commentedThis should probably be for 6.x-1.1/5.x-2.3 by now. If it's something we still wants to have done? (Seeing as it's been open for over 6 months without any activity, perhaps we should simply "won't fix" it?)
Comment #4
gregglesYes, I'd still like to do this...
Comment #5
mikeytown2 commentedline 360 - pathauto_taxonomy()
This was taking 20 seconds for SQL and about the same in PHP time; for each term added... and I don't have any aliases for taxonomy defined. I recommend adding in some sanity checks before running
taxonomy_get_tree(), because that can be very expensive on large databases.#572046: Each node takes longer to do. SQL Issue. Recommend disabling pathauto.module
Comment #6
gregglesWhat kind of sanity check do you suggest?
Comment #7
mikeytown2 commentedCheck if "Taxonomy term path settings" is completely blank; if so don't run.
Comment #8
mikeytown2 commentedSo if the Default path pattern is blank and that vocab is blank, don't run.
Comment #9
gregglesSeems like a great idea: #572604: If there is no taxonomy pattern, don't do any work.
But it's unrelated to the purpose of this issue.
Comment #10
dave reidDo we need this issue open? This could be documented at any time under http://drupal.org/handbook/modules/pathauto.
Comment #11
gregglesWell, it's a matter of finding them first and then documenting them. New title to reflect that.
Comment #12
dave reidAnyone can edit documentation at any time. There's no need to keep an issue 'open' for it.