By ksoonson on
Hi, I have migrated phpbb to drupal 4.6.5. I am using two P4 3.0Ghz with 2G RAM. (One for mysql 4.1, one for apache(php 5.1.2))
The average number of concurrent users are about 50(registered user) / 900(anonymous).
The problem is... drupal is too slow compared to phpbb. I have enabled cache but still too slow.
Here are the list of modules that I have enabled(some of them are contributed modules):
adminblock, adsense, aggregator, bbcode, blog, blogapi, comment, contact, forum, locale, menu, node, notify, page, path, poll, profile, smileys, statistics, story, superteaser, taxomony, trackback, tracker, upload
Can you share your experience on speeding up drupal site?
Thanks very much.
Comments
Well
This is a can of worms.
Are you on shared hosting? That could be the major problem, a new site has just moved onboard and is taking all your CPU.
Where's your database hosted? On the same host? Have you optimised the DB tables?
Do you have hundreds of node aliases? There's a problem with Drupal 4.6.x where the more aliases you add, the slower the site gets. There's a nice patch that fixes this.
If you're not on shared hosting, have you enabled gzip compression of webpages? Have you also installed a PHP Cache like EAccelerator? The "Free" Zend Optimizer is, in my opinion, totally useless. My tests show it slows the site down rather than speeds it up. A PHP OpCode cache (such as EAccelerator) can make a huge different to site speed.
In short, with the limited information you've given it's hard to say where the problem is.
I have the same feeling. My
I have the same feeling. My Drupalpage take more time to load than my old html css -page. On the same host. But I accept it. This is my first databasepage so I do not know if that it what makes the difference.
Where do I find that patch tjharman?
If you don't want to dig
If you don't want to dig through this very confusing thread
http://drupal.org/node/43712
You can go here also which is less confusing but requires registration.
http://www.hiveminds.co.uk/drupal-4-6-updated-path-alias-files
I you ask me this is a real mess with 4.6.5. You can't get better performance without this patch and upgrading to beta 4.7 is not an option for a live site. This is something that the core developers should take a careful look at and break conventional methods and fix this.
I wouldn't say it's a mess,
I wouldn't say it's a mess, but I must admit I was a little amazed that this patch didn't make it into 4.6.6. I guess because it requires a database change (even though a simple one) it was decided not to include it.
It's only a problem for people with a *lot* of aliases though, I guess that must be considered not the majority of people.
But what is a lot? 100?
But what is a lot? 100? 1000? 10,000 Everyone starts with just one. I noticed an improvement with just 230 aliases on my PC.
By breaking conventional methods I mean unfreezing 4.6. This patch probably did not make it in because it is not a security fix and 4.6 is frozen.
Thank you very much for your
Thank you very much for your reply.
The servers are not shared by others and only for drupal: one for mysql and one for apache. The db & web server is on the same network. We have only 3 url aliases. We use EAccelerator but do not use mod_gzip currently.
MySQL query caching turned on?
- Robert Douglass
-----
My Drupal book: Building Online Communities with Drupal, phpBB and WordPress
yes, we use mysql query
yes, we use mysql query cache... :-)
some other pointers
what is your php memory limit?
how many apache threads have you enabled? what is their timeout setting?
what operating system are you running, and are you running a graphical desktop on it while serving the website? (I sure hope not, but it helps to check the obvious sometimes)
what is the speed of your network uplink?
with apache and mysql on one of your servers you should be able to run drupal reasonably fast...
graphical desktop
If he's running Windows, he might be forced to be running a graphical desktop. Not all server OS are created equal. Some even run OpenGL screensavers (don't laugh, I've seen this on more windows "servers'" than I care to remember).
But then most of my work is replacing Windows with OSS so I might be a bit biased. :)
OTOH Windows is fine for running stuff like Battlefield 2, at least that's what I use it for at home. Works fine (apart from the "the antivirus has been updated" thing popping up in the middle of games bit). ;)
of course we don't use
of course we don't use graphical stuff at all. we use text-only linux.
php memory limit is 8M and apache thread/timeout...etc were okay when we were using phpbb.
the issue is drupal requires too many sql queries for each pages and some of the queries take too much time to execute. one of our staff member said that phpbb used about 25 sql queries on the average for displaying one thread but drupal requires at least more than 70 queries. (I checked two nodes - displaying forum node: 83, displaying blog node: 98) and whenever 'join' operation is required, then the execution time is much longer.
the actual number of sql queries will sure depend on the number of enabled modules.
what I really would like to know is... how some of well-known drupal reference sites which seems to be using many many modules can handle the workload fast.
I wonder they use some kind of web cache like squid or db cache engine which requires source code modification.
And I wonder if this situation(many sql queries) will be changed with 4.7 release also.
Some improvements in 4.7
There have been numerous performance improvements in 4.7, among them reduced queries. You still won't see anything in the 25 query range, though.
- Robert Douglass
-----
My Drupal book: Building Online Communities with Drupal, phpBB and WordPress
8M memory limit is a bit low
8M memory limit is a bit low (for drupal) but you don't have that many modules enabled, so that should not really be a problem yet..
In a test install the number of queries is not really much higher than phpbb... but keep in mind that every block you enable increases the number of queries that are run. maybe some of the blocks are not really efficient. the Devel module might help you see wich queries are called most often... and help you determine what modules use them.
You also should check if the builtin drupal cache is turned on and works correctly
Regarding the memory limit
I remember having had to increase that limit (to 20megs) on my admittedly very modest web server (a few virtual servers with little traffic). Unfortunately I can't remember if it was because if it was because of Drupal or Gallery2, those being the two most likely candidates.
The machine is my LANs gateway and DNS, processes mail and serves web pages (it's an Athlon 750 with 128 Megs of RAM running Debian and it seems to be doing OK so far).
Of course this might not be relevant to a busy site...
Good Topic for discussion
I too have noticed a performance hit when the site grows. This is on my "List of things to do". This post has been very informative. I recently built a site with a CSS rollover menu, "Eric Meyer version", and had to scrap it because the text would load ahead of the CSS in IE6. Thus the user would see the text unformatted first, then the CSS would kick in. It was just too much all at one time. This is mostly due to the way I wrote it though, since the rollover menu was created on a standard Drupal Page. (it did work fine on a standard .html page) But anyway, thanks again Drupal for this fantastic forum and for all of your help.
Slow page loads...browser??
I am running a small drupal site with about 250 nodes and only a few installed modules. It often takes 10-45 seconds to load a page. I installed the devel module and got the following results from a page load which took 20 seconds...
Executed 33 queries in 39.35 microseconds. Queries taking longer than 5 ms, and queries executed more than once, are highlighted. Page execution time was 437.15 ms.
...so it appears that the database queries (although not exactly 'snappy'), are not the problem. What else could it be? I have the same problem with Firefox and IE6.
SLOW Browser
I installed the lori (life-of-request-info) extension for Firefox and determined that for a typical page load on my site:
* TTFB: how long it took to see the first byte from remote server (from click to first byte received). This value gives a rough estimate on when the browser can start laying out the content.
* TTC: how long it took to display the page (from click to complete drawing of the page)
* Page size (number of bytes used to display the page): this value includes both bytes fetched from network and bytes fetched from the browser's cache.
* Number of requests: number of requests used to fetch the page's content (images, style-sheet, javascript ....). Again, this value include both network requests and cache requests.
TTFB: 30s 375ms
TTC: 34s 953ms
Page size: 479Kb
Number of request: 2/2
and here's the info from the devel module:
Executed 26 queries in 83.84 microseconds. Queries taking longer than 5 ms, and queries executed more than once, are highlighted. Page execution time was 742.91 ms.
ms # query
0.43 1 SELECT * FROM url_alias
0.38 1 SELECT name, filename, throttle, bootstrap FROM system WHERE type = 'module' AND status = 1
3.23 1 SELECT data, created, headers FROM cache WHERE cid = 'menu:1:en'
0.39 1 SELECT COUNT(*) FROM node_access WHERE nid = 0 AND CONCAT(realm, gid) IN ('all0','node_privacy_byrole_role2','node_privacy_byrole_user1') AND grant_view = 1
13.71 1 SELECT n.*, u.uid, u.name, u.picture, u.data FROM node n INNER JOIN users u ON u.uid = n.uid WHERE n.nid = '154'
0.53 1 SELECT * FROM flexinode_type WHERE ctype_id = 3
0.32 1 SELECT * FROM flexinode_field WHERE ctype_id = 3 ORDER BY weight ASC, label ASC
16.85 1 SELECT flexinode_2.textual_data AS flexinode_2, flexinode_2.numeric_data AS flexinode_2_format FROM node n LEFT JOIN flexinode_data flexinode_2 ON n.nid = flexinode_2.nid AND flexinode_2.field_id = 2 WHERE n.nid = 154
0.5 1 SELECT last_comment_timestamp, last_comment_name, comment_count FROM node_comment_statistics WHERE nid = 154
0.27 2 SELECT * FROM role ORDER BY name
0.24 1 SELECT * FROM taxonomy_assoc WHERE nid = 154
0.23 1 SELECT * FROM files WHERE nid = 154
30.12 1 SELECT data, created, headers FROM cache WHERE cid = 'filter:4:58359e6385f076f82a05450784836a76'
0.57 1 SELECT * FROM system WHERE type = 'theme' ORDER BY name
0.57 2 SELECT * FROM role ORDER BY name
0.41 1 SELECT t.* FROM term_data t, term_node r WHERE r.tid = t.tid AND r.nid = 154 ORDER BY weight, name
0.33 1 SELECT * FROM flexinode_type
0.48 1 SELECT minimum FROM moderation_filters WHERE fid = 0
0.25 1 SELECT COUNT(*) FROM comments WHERE status = 0 AND nid = 154
10.76 1 SELECT c.cid as cid, c.pid, c.nid, c.subject, c.comment, c.format, c.timestamp, c.name , c.mail, c.homepage, u.uid, u.name AS registered_name, u.picture, u.data, c.score, c.users, c.thread FROM comments c INNER JOIN users u ON c.uid = u.uid WHERE c.nid = 154 AND c.status = 0 GROUP BY c.cid, c.pid, c.nid, c.subject, c.comment, c.format, c.timestamp, c.name, c.mail, u.picture, c.homepage, u.uid, u.name, u.picture, u.data, c.score, c.users, c.thread ORDER BY c.thread DESC LIMIT 0, 50
0.27 1 SELECT comment FROM node WHERE nid = 154
0.86 1 SELECT timestamp FROM history WHERE uid = '1' AND nid = 154
0.71 1 UPDATE history SET timestamp = 1143634114 WHERE uid = 1 AND nid = 154
0.55 1 SELECT * FROM blocks WHERE status = 1 AND region IN (0) ORDER BY weight, module
0.43 1 SELECT DISTINCT(c.nid), c.* FROM comments c WHERE c.status = 0 ORDER BY c.timestamp DESC LIMIT 0, 10
0.44 1 SELECT * FROM blocks WHERE status = 1 AND region IN (1) ORDER BY weight, module
...so apparently it's not the database but my browser? Does this mean that PHP is not processing data quickly enough? I doubt that there is a PHP accelerator installed as it's just the local university server running a few tiny mySQL database-driven sites besides my drupal site.
Suggestions anyone?
Turning caching OFF
After turning caching OFF within drupal...the pages load in 1-2 sec max with no problems.
???????????????????
Turning Drupal's cache off
Turning Drupal's cache off or is there a php cache on the site? Caching can be at many level's. Also you mihgt want to install the devel module to gather other stats on page generation times, etc.
-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide -|- Black Mountain
-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide
so there's probably something wrong with caching
so there's probably something wrong with caching on your server/configuration
it seems that there's something hanging in the caching process until the php timeout (30 seconds on your server is my guess) .. and then your page is sent to the client anyway
On one of my sites,
On one of my sites, http://merlib.org which is a bit heavy, I sometimes surf using Opera since it renders it much faster than Firefox. Firefox2 is getting there though...
i have this problem too. my
i have this problem too. my site loads very slow after only three month of growing in number of nodes. on the same server i have installed two other drupal sites which do not have so many nodes and they are working just fine, so i don't think the problem is in the server configurations. i wonder is slowliness of my site caused by too many url alias, because every single of around 2000 nodes on my site has its url alias?
does this mean that drupal's default unclean urls would work better, quicker? or does this mean that even after activating clean urls, it is good idea not to use url aliases very often?
What version of Drupal are
What version of Drupal are you using?
There's an issue in 4.6 that causes slowless with a large number of aliases (nothing to do with short_urls, don't confuse the two) - A discussion of the problem and a fix is available here
If you're using 4.7 this issue has been fixed, so something else might be causing the problem.
I was using 4.7, recently I
I was using 4.7, recently I have upgraded to 4.7.3. Another interesting moment I have noted that for normal users it works much faster than for admins.
Caching?
Do you have caching turned on?
yep, for an hour.
yep, for an hour.
Could anybody help me with bad caching?
Coudl enybody help me with bad caching in my web-site?
I'm user of cvs version of Drupal (i installed cvs version few weeks before 4.7. version). I can't upgrade now, because I maked many changes.
Problem: my site is running very very slow. I have about 5000 IPs per day, about 5000 nodes, 5000 registered users and about 30 registered users in one time.
My site is VERY slow. When I turn-on caching I have big problems in Internen Explorer. When I go to any page I see 2 - 3 reloading the same page with few second delay between itselfs and then page is generated but the right menu is not loaded fully. Sometime more sometime less, sometime all. But most of all the code is cutted and unfinished. However, even When I turn this crazy cache, site is slow :(
I'm very frustraded - I tried all any ideas. And now I'm very very frustrated. Could anybody help me?
Server: 2GB RAM, DB size about 120 MB.
Thank you for any clue.
Please start a new topic
Please start a new forum topic for this, makes it easier for people to find your question and help you solve your problem
--
I work for Ontwerpwerk
This is normal, caching
This is normal, caching works best for normal users (all anonymous users get the same pages, so caching has the most effect), admins get mostly uncached pages
--
I work for Ontwerpwerk