Authenticated Users - Recommendations?

Events happening in the community are now at Drupal community events on www.drupal.org.
regi.bradley's picture

I wanted to see if anyone has some recommendations on how to best improve response times for a multi-site installation with several sites serving content to mostly authenticated users. None of our sites are very big - I estimate that we will have about 75-100 authenticated users at any given time between the sites that I'm running. Right now, we have about 10-15 authenticated users and performance is not terrible but I would like to get faster response times and make sure that we're ready for the additional load.

Server Specs:
Dual Core Conroe 3040
4GB RAM
Apache 2.2.11
MySQL 5.0.90 - query_cache_size = 256M (let me know if the entire config would be helpful)
PHP 5.2.8

Here's a sample benchmark taken via ab (over the Internet - I can't run it on my server. NOTE: Drupal's built-in cache is disabled on the site that I tested, thinking that this would give me a better estimate for authenticated users):

Server Software: Apache/2.2.11
Server Hostname:
Server Port: 80

Document Path: /
Document Length: 35619 bytes

Concurrency Level: 5
Time taken for tests: 436.801 seconds
Complete requests: 500
Failed requests: 0
Write errors: 0
Total transferred: 18116000 bytes
HTML transferred: 17809500 bytes
Requests per second: 1.14 [#/sec] (mean)
Time per request: 4368.007 [ms] (mean)
Time per request: 873.601 [ms] (mean, across all concurrent requests)
Transfer rate: 40.50 [Kbytes/sec] received

Connection Times (ms)
min mean[+/-sd] median max
Connect: 38 39 0.4 39 44
Processing: 1706 4323 785.1 4348 7078
Waiting: 1589 4072 747.1 4092 6774
Total: 1744 4362 785.1 4387 7116

Percentage of the requests served within a certain time (ms)
50% 4387
66% 4577
75% 4747
80% 4928
90% 5449
95% 5712
98% 6079
99% 6278
100% 7116 (longest request)

I'm concerned that as we add more users into the equation that we may see slower response times. I'm considering adding APC & Authcache but we need to modify our code slightly before being able to deploy Authcache. Does this seem like a good idea? Or should I go a different route? Thanks for any thoughts!

Comments

Generally speaking, yes, you

Garrett Albright's picture

Generally speaking, yes, you should always have some sort of opcode cache installed.

Your response times seem large, but without knowing what your front page looks like, it's tough to make any value judgments. Also, since it's a multisite installation, we can assume that some sites will be more taxing on the system than others, yes? This can complicate things - optimizations which work well for one site can totally break another - but given your hardware, just taking care of the easy stuff - an opcode cache, a static cache for anonymous users and static files, switching away from Apache to Lighty or Nginx - should be enough to keep you in business.

Thanks, I think I will add

regi.bradley's picture

Thanks, I think I will add APC then. Most of our sites in the multi-site installation are going to be fairly similar in terms of the modules installed but there are definitely some sites that will get more traffic than others. The majority of traffic will probably come from four sites which actually share the users tables. The stats that I included above are from [removed URL], which will be in the group of sites that will get the most traffic.

How many user roles do you

djudd's picture

How many user roles do you use? If your authenticated users are all members of the same role, you may want to consider Authcache.

I just have a handful of

regi.bradley's picture

I just have a handful of roles so I have actually been thinking about Authcache. We do have some user-customized content so we need to modify our code to work with Authcache. Do you possibly know whether Authcache and OG play nicely together?

I used Authcache for many

djudd's picture

I used Authcache for many months along side OG, and never had a problem.

The problem I did have is that Authcache splits each user role into a different cache. I have a user role which pays for additional access to my site, and there's only about 400 of those folks. Authcache actually slowed them down compared to other users. Not good for PR if ya dig me.

The other problem is Boost. Boost is so blazingly fast that anonymous users we zipping along, and then people would log in and slow down. Again, not good for the PR.

So I removed Authcache and installed APC and Memcache. Much better now.

Interesting issue with boost

mikeytown2's picture

One way to "solve" that: have javascript run client side to slow them down. This is a good problem to have (too much speed).

You can use hook_boost_preprocess() to edit the html & inject some slowdown logic before the html file gets saved.

<?php
/**
* Edit document before it is put into the boost cache.
*
* This hook is run at right before the page is cached by boost.
*
* $GLOBALS['_boost_cache_this'] and $GLOBALS['_boost_router_item'] are useful.
* set $GLOBALS['_boost_cache_this'] = FALSE if you wish to not cache this page.
*
* @param $path
*   URL path of the document
* @param $data
*   String containing the data
* @param $extension
*   file extension type. Use to detect what type of document your operating on.
* @return
*   $data string containing the document
*/
function hook_boost_preprocess($path, $data, $extension) {
  return
$data;
}
?>

I can't even imagine trying

djudd's picture

I can't even imagine trying to "fix" a problem this nice, but thanks for the tip.

You're right, it's a great problem to have.

Hi Djudd -- can you clarify a

mrwhizkid's picture

Hi Djudd -- can you clarify a couple of things?

  1. In my setup, OG doesn't seem to play too nice with authcache. If one authenticated user views a group page of which he is a member and then another authenticated user who is not a member comes across that same page, then he will also be able to view that page, even though he is not a member. This has been my experience. For example, the frontpage of the groups will show up incorrectly for non-members because they have been viewed by members of the same role.

  2. You said you removed authcache and installed APC and Memcache. Can I ask what you were using authcache with before if you didn't have APC and memcached installed?

And why did you remove authcache? Doesn't this mean that you are effectively removing full page caching for logged in users?

I am using Authcache with cacherouter/memcached and APC as the opcode and it seems to work pretty well. I am also using ajaxify regions.

But is there a reason not to use authcache with these two? Thanks for your time.

For #1 Just synchronize

Drupa1ish's picture

For #1 Just synchronize drupal user roles with OG groups. Make sure a OG non member doens't have the same drupal user role with a member

High performance

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: