I spent two years developing a drupal application. However, I have got such a major performance issue that I can't even promote my application. I'm afraid of people visiting my site.
I have a dedicated server:
Intel® Celeron® 1.8 GHz, 1GB RAM
CentOS 5, Apache 2.2.3, MySQL 5, PHP 5.1.6
drupal 6.11 with a handful modules enabled
My site has moderate number of nodes (in the thousands).
The only enabled modules which are significant are "views" and CCK.
I have turned on caching. When I hit my site as visitors, I can see my CPU load stays at about 4%. However, if I hit the site as a logged in user (authenticated), a single hit will cause CPU to surge to 40~60% (combined httpd and mysqld CPU usage). If I hit the site with 3 or 4 authenticated users, CPU will peg over 90%. Requests take 4~8 seconds or longer to respond if they do not time out.
My fundamental question is: is this normal?
I have done a fair amount of search and tweaking. I found a close comparison: http://drupal.org/node/215516. If this kind of performance is expected, then what kind of server do I need so I can support roughly 5~10 concurrent authenticated users?
Does anyone know what kind of server drupal.org site uses? I think drupal.org has tens of thousands visitors on a regular basis.
The next level server upgrade would be Intel® Pentium®D Dual-Core Processor, 64bits, 1.6 GHz, 1GB Ram. That's going to be $90 per month. I cannot afford it. Even if I upgrade, can it support 10 (or more) concurrent authenticated users?
Does anyone have good benchmark information on Drupal performance (especially with authenticated users)?
Any insights are greatly appreciated. Thx!
Comments
When you say you've developed
When you say you've developed a "drupal application", did you create one or more custom modules that could be consuming a lot of processing?
What is your theme like? Is it heavy with images, flash, and so forth? Are you sizing the images for their display resolution, or using width and height attributes to display them at the resolution you want? Is the site heavy with complex views, requiring expensive hits to the database?
I ask these things because what you're describing is not normal. Granted, most of the sites I have first hand experience maintaining do not have thousands of nodes, but I know several people personally maintaining such sites, and they are not getting anything like the scaling issues you're describing. In fact, discussing site maintenance stories with them, performance and scaling to multiple users has never come up...
-Blake
www.BlakeSenftner.com www.3D-Avatar-Store.com
Does your application
Does your application (module(s)?) perform operations for authenticated users only? Without providing you any empirical benchmark numbers, I can say that I've developed several sites that have had many more concurrent authenticated users (orders of magnitude more) running on relatively underpowered virtual private servers, compared to the situation you describe.
I'm not aware of any general Drupal issues that would be related to the problems you describe, so my best suggestion would be examining your custom code. 2bits.com has a good listing of tools for Drupal debugging and profiling, here.
bsenftner and mitchmac,Thank
bsenftner and mitchmac,
Thank you both for the replies. I see you have some good tough questions. I am encouraged to hear what I experience is NOT normal, so I'm hopeful I can still find a solution.
This is what I plan to do. I'll install a vanilla 6.x with all default settings. I'll start my test from there. I'll post back if I get any interesting data.
====
I just installed a vanilla 6.14 (not a single configuration change) and ran some quick tests.
I got some consistent numbers. mysqld cpu usage is minimum, response time is ok (~1 second). Hit with 3 browsers (authenticated), reponse is ok. On the average, a page hit causes 16% CPU with httpd, any real operations (editing, login/logout) causes load go up (to 20~30%).
The good news is the load is significantly below 40~50% CPU load. However, this is a blank install, without a single customer node or anything. I am afraid that 16~30% load will shoot up quickly once I start add something. What are you guys opinion on these numbers?
Below are some details:
I'll going to enable some modules, and continue bench marking it.
It just occurred to me, and
It just occurred to me, and it sounds like you're already doing this, but just in case: are you doing your CPU load measurements with the apache host being a separate machine than the one your browser(s) are on? I ask because of the browser load and java script that runs locally could skew your CPU measurements.
Also, track your page swapping. Only having 1g of RAM seems low for modern situations...
-Blake
www.BlakeSenftner.com www.3D-Avatar-Store.com
I used "top" command in a
I used "top" command in a putty window. So the measurement is independent of my local computer or browser. Then I use browser to hit the server and observe the load change in the putty window.
When you say 1G RAM is low, that is precisely the concern I have. It implies the dedicated server I have may not be up to the job. That's why I was asking if the performance was normal. If that is the case, then I might be wasting my time trying to look for a tweak.
I still find it hard to swallow that a dedicated server cannot handle a handful concurrent users. I wonder what kind of hosting plans other Drupal sites use. I really hope there is more information on Drupal performance benchmark.