First I would like to say that I love drupal. Once you learn a bit you quickly realize that anything is possible with drupal. One characteristic of Drupal (and probably many other CMS's) is that it is pretty MySql intense. At my site I am running 33 modules. I have stripped modules such as book, page, story, category and others so that my site is mainly running from voting, CCK, Contemplates, Views, Pathauto and Taxonomy Modules. I probably started with about 65 modules and have decreased to 33 in an attempt to speed up my site because I am on a shared host and there isn't much more the host will do to help me out.

However, although it is stripped down quite a lot when I run the devel module my pages average about 374 queries each. Is this normal or is this an excessive number of queries?
By the way, most of these queries are drupal_lookup_path.

Comments

vm’s picture

if you have unenabled the modules. have you also removed them from the modules folder? have you also removed their presence from the database? have you enabled caching? have you tried the blockcache.module?

are there specific areas that are causing a spike? the fourms.module can create a fairly intensive query load. Depending heavily on how you've set them up.

orionvortex’s picture

I have deleted most of them from the modules folder and have deleted all of the tables for modules I'm not using. Cache is enabled. I'm not using the block.cache module because I figured that regular cache could do the job and i thought that block cache would just be one more module running. Also, I'm not running the forum module. Unfortunately, there are no specific areas causing the spike except for taxonomy and drupal_lookup_path.
http://chibabeat.com/test_site

catch’s picture

I'm not using the block.cache module because I figured that regular cache could do the job and i thought that block cache would just be one more module running.

I just installed blockcache module and in my experience it does a great job. If you're running a lot of views blocks - instead of doing the queries every page, you can set it to do it every minute/hour/day - just choose the number of seconds for each cached block etc.. It also allows for whole site, per page, and per user caching. If you're using panels with views blocks, you can use the cached blocks in those as well.

dries’s picture

374 queries is a lot. On drupal.org we have 100-120 queries for the main page. Maybe you are using the tagedelic module (tag cloud)?

Unfortunately, there is no quick solution. You can choose not to use path aliasing (it will eliminate the path lookup queries), or you can tune your main page to show less links. You could also install the devel.module to see if there are duplicate queries, and report these to the module maintainers. Enabling MySQL's query cache will speed up these look-up queries significantly.

We're thinking about improving the path alias look-up system but that won't make it for Drupal 5.0 ... if you want to help with that, just hop onto the development mailing list.

orionvortex’s picture

I turned on the devel module again and set permissions for anonymous users to be able to view. You can see examples of the queries now at http://chibabeat.com/. I really have no idea why there are so many queries and how other sites are able to run so few.