Posted by mmilano on September 7, 2008 at 5:24pm
I'm getting ready to deploy a 1 server Drupal site with a Dual Xeon 2.8 and 4GB of memory. I've been reading a lot on tuning and I'm finding it's often recommended you make some configurations based on a percentage of memory you have allocated to either Apache or MySQL.
With a 4GB system, how much memory should I allocate to Apache and MySQL? or is there another way to look at this?
The server will also be running Cent5, PHP 5.2, Apache 2.2, MySQL5, Memcached 1.2

Comments
Depends
As always, the answer is : it depends.
Depends mainly on how many modules you have enabled. Also, on whether most of the visitors are anonymous or logged in.
Start by reading the server indigestion: the Drupal contributed modules open buffet binge syndrome.
If you are on Drupal 5, you can check what the Performance logging and monitoring module, providing performance statistics for Drupal says.
You can also check our article on measuring memory consumption by Drupal bootstrap and modules.
You cannot "allocate" memory for Apache. You have to know what each process uses after you use all the modules you want, then tune the Apache Maxclients parameter accordingly so that you don't overflow memory.
You also need to allocated enough memory for Memcached using at least 3 bins. Read the configuring Drupal with multiple bins for memcached
All in all, a 4GB system should not be that bad, and should have enough room for most sites.
Drupal performance tuning, development, customization and consulting: 2bits.com, Inc..
Personal blog: Baheyeldin.com.
Drupal performance tuning, development, customization and consulting: 2bits.com, Inc..
Personal blog: Baheyeldin.com.
I should have noted that
I should have noted that this is a Drupal 5 site. There's 60-70 modules enabled. It's a new launch, so most users are currently logged out, but the goal is for that to change. Also, I was probably using the term 'Allocate' wrong. I'm just estimating how much Apache will use vs the database and anything else, but like you say, that's going to then depend on my modules.
In my research over the last couple days, I have read and bookmarked a few articles/slideshow published by 2bits. That information has been extremely valuable, so thanks so much for putting it out there. I don't think I have seen some of these you posted here though so this will keep my night busy :)
Thanks for this carefully written reply.
Mike Milano
Everything is setup and I am
Everything is setup and I am now testing performance with memcached+advanced cache.
System Info:
- 2x dual xeon 2.8
- 8GB memory
- CentOS 5
- Drupal 5.7
- Op-code Cache: APC
I'm getting lower requests per second with memcached/advanced cache enabled. I've setup memcached processes and verified through memcached admin that they are being recognized and used.
i'm using ab to test with cookie information to simulate logged in users.
i have 2 virtual hosts running the same code, modules, and db, except one has advanced cache and memcached applied/installed. i did not patch the advanced cache patches marked 'broken'.
testing a node view with: ab -c 50 -n 200 -C abc=123 http://example.com/content/foo
6.65 requests per second with memcached + advanced cache
8.92 without either
All my memcached processes have plenty of room, yet are being used, according to memcached admin.
I do have a lot of memory configured for MySQL, so is it possible that MySQL caching is just performing better than memcached in this case? or is there something else I need to tune for memcache?
Mike Milano
How exactly does your
How exactly does your install look like? what's the number of nodes/users you've generated? do you have any views on frontpage?
It was a small DB, only 700
It was a small DB, only 700 users, 500 nodes. I was testing a node view although even the home page, which is a custom module page with a bunch of queries, gave similar results.
Good point though, I'm going to move my large test db over to that server and run some tests against that.
Thanks
Mike Milano