My site on Dreamhost has been a dog lately, taking anywhere from 4-20 seconds to render a single page. I turned on the query log in the devel module and was astounded!
197 sql queries??? For a single page???? With only 6 nodes and 5 blocks????
I come from an old school. Learned Foxpro back in the DOS days when a single SQL query was hashed over and streamlined as much as possible.
Yes, computers have gotten faster, but 197 queries???? For a single page??? I fear programmers have gotten a bit lazy, with the speed of current computers and all.
The problem with Dreamhost is that their mysql performance is abysmal, so when you've got 197 queries on a page, their weakness is exposed.
I may have to change providers. I'm thinking Site5, because their mysql performance seems to be much faster, at least according to several posters here.
However, if the Drupal Core programmers want an ambitious goal for Drupal 6, they should look at ways to combine some of those queries together! Just perusing the list, it looks as if 70-80% of those queries are redundant. (at least redundant in the sense of the data they are extracting)
This explains to me why Drupal sites always seem to take several seconds to display the first page. All these queries must be initialized. After the first pass at a query, much of the query data is in the mysql cache, so subsequent queries run faster. Unless, of course, you are sharing your mysql server with many other clients, whose own pages keep flushing the queue.
ISP's these days are offering insane amounts of disk storage. It might be better for Drupal if the programmers would "un-normalize" some of the data, in order to reduce the number of queries, in exchange for the tables taking up more space. But space is cheap and static, and the needs for it don't change that much as the number of users goes up.
However, BANDWIDTH does matter, and that's what most shared clients end up getting charged for in the end. I say, sacrifice disk space to gain a reduction in bandwidth.
Just an old fogey's opinion........
Comments
It's worse than that...
...Bandwidth is pretty cheap these days, too, but I've been kicked off of shared servers for using too many clock cycles.
Drupal 5.x is way faster than earlier Drupals but I have over 3000 members and close to 5000 nodes with as many as 150 users on at peak times. It can get hairy. Speeds are still acceptable, 2.5 to 3.3 seconds per initial page and I have my own server now. But as my site gets more successful, I fear the load times will get slower -- they were 1.8 to 2.8 seconds only 1 month ago.
- Erin
I fear much of this comes from Drupal's modular design
Since so many functions in Drupal allow for hooks and other modular access, I assume queries must be split up into component parts, but it sure leads to tremendous waste and inefficiency during data extraction.
This is causing me serious concern about the scalability of my websites for the future. (Now that I've spent 4 months learning Drupal and developing the sites)
I'd love to get some feedback from some of the core developers on this issue.
catching a developer or two
catching a developer or two is a bit easier in the IRC channel.
I guess I should try to learn how to use that
I've just never used IRC before.
---
http://drupal.org/node/108355
Comparing to Joomla
I've noticed a good amount of queries also. Not sure what's typical these days, but it's more than in the "old days". I was curious how things compared to Joomla, which I have no experience at all with. Searching around their site I found this post about db queries. They mention 15-60 queries being typical, with some sites down to 25. Site with 400-600 have been heard of. Good caching is the key.
Looking at my site there's consistently more than 200 queries per page. Total query time is less then 100ms, with page exec time less than 1000ms. The VAST majority of queries are called from drupal_lookup_path for use with url aliasing. So if you're really worried about performance, that could be a place to start.
J
How can I find out how many
How can I find out how many queries Drupal is doing? Is there some setting deep down in the Admin. section which gives me that type of information, or how exactly?
Thanks,
Ludo (using Drupal 5.1)
install the devel.module it
install the devel.module it will provide you with all of this type of information.