By andrew-leung on
I have inserted 20,000 glossary terms to the drupal database and then received error like this when access the glossary via the frontend.
Fatal error: Maximum execution time of 30 seconds exceeded in /home/mysite/public_html/modules/taxonomy.module on line 605
And the 605 line is actually as below
$tree = array_merge($tree, taxonomy_get_tree($vid, $child, $depth, $max_depth))
Any one have ideas on the root cause? I am thinking of too many entries that can't not be handled by drupal or mysql. Any one agree?
Andrew
Comments
I guess you are pushing the
I guess you are pushing the limit of what glossary was meant to be doing. :)
Increasing the script execution time might help, but I doubt it is a viable solution. There are plans to make the taxonomy module better performant. This will help you, I guess. Buying a faster computer would be a solution, too.
--
If you have troubles with a particular contrib project, please consider filing a support request. Thanks. And, by the way, Drupal 4.6 will support PHP 5.
--
Drupal services
My Drupal services
Could be
There are two function calls on this line, one is taxonomy_get_tree() and the other array_merge().
array_merge() is a PHP function, and does everything in memory (no disk access, unless you are swapping a lot).
taxonomy_get_tree is a Drupal function, and it calls itself recursively, as well as array_merge.
You can try the SQL in that function from the command line and see how much it takes. You can also install the devel module and see how many SQL calls are being done. You can also try to trim the glossary to a smaller size (say 1000) and see how it performs.
In all cases, you have reached the limits on what taxonomy can do with that large data set.
Consider modifying the glossary module or writing your own, which does not do taxonomy calls.
--
Consulting: 2bits.com
Personal: Baheyeldin.com
--
Drupal performance tuning and optimization, hosting, development, and consulting: 2bits.com, Inc. and Twitter at: @2bits
Personal blog: Ba
Glossary scaling problem
The way glossary module works is that it has to load in every defined term, then highlights each in the text. This is of course not good for huge glossaries. The alternative would be to split the text into words and query the database for each word (that would be slow too).
I guess in your case you'd have to look at a special glossary syntax (e.g. surround every word with [[ ]]) to make it fast.
--
If you have a problem, please search before posting a question.
glossary as nodes
You might have alok at the direction I took in http://cvs.drupal.org/viewcvs/drupal/contributions/sandbox/ber/standpunt...
It us old, so **it will not work**. But the idea is that I used nodes to store glossary terms instead of taxonomy terms. Taxo-terms are really not meant to store data.
In fact glossary really abuses taxonomy in a very bad way IMO.
---
If this solved you problem, please report back. This will help others whom are looking for the same solution.
Next time, please consider to file a support request.
[Bèr Kessels | Drupal services www.webschuur.com]
consider the whole feature set
I'm not opposed to glossary terms as nodes. In fact, I opened a feature request for it. But how would you deliver on the glossary features of synonyms and 'See also' links which are really 'related terms' in taxonomy? Those See also links appear while viewing the glossary.
Perhaps you don't think synonyms and 'see also' links are important in a glossary. I think they are a vital part of what distinguishes a glossary from a definition list.
Before you disparage glossary.module, perhaps you want to consider its full feature set. There are tradeoffs between each architectural decision.
Turns out the term_node
Turns out the term_node table needed some index. get yourself a patch here:
http://drupal.org/cvs?commit=14491
--
If you have troubles with a particular contrib project, please consider filing a support request. Thanks. And, by the way, Drupal 4.6 will support PHP 5.
--
Drupal services
My Drupal services
Problem with commit# 14491
This patch modifies the term_node table to make both tid and nid primary keys. That is,
However, I've got nodes (as referenced by nid) that have multiple taxonomy terms associated with them (as reference by tid). As such, the node_term table with have duplicate entries of nid, one for each term (tid) that the node is associated with. I don't believe you can make a column a primary key if the values are not unique can you?
-- timothy
pay attention to the error message
folks, just look at the error message that was posted here. it is a timeout in the taxonomy_get_tree() or array_merge(). this has nothing to do with glossary.module ... i have edited the title accordingly.
php.ini
Just set max_execution_time directive in /etc/php.ini to 0, this means unlimited time of execution of php scripts.