Merging best practices together - need insight / advice

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

first of all, thanks for putting together this group, it has definitely opened my eyes to some great methods for squeezing the most performance out of a Drupal site... :)

im at the tail end of a 12 month development cycle, and have finally gotten around to setting up my hosting environment... ive taken the plunge, and after more research than i care to recall, have decided on creating and managing my own setup with Linode.com...

here's my quandry: im no linux admin, but i am technically savvy (im just wading in the wrong end of the technology pool)... ive spent weeks looking for tutorials on setting up the environment (ubuntu and more recently debian), and the tutorials from linode.com themselves have been great! but they just dont go that "extra step", showing you how to fully configure your server for Drupal (you know, tweaking that nginx.conf file to account for imagecache, clean urls, etc.)

is it too much to ask someone who may have already treaded these waters to give me some sage advice, and or more focused direction? im making great progress (ive setup a Debian environment, with fastcgi and APC), but its been through cobbling together tutorials from all sorts of sites... nothing that has walked me from A to Z (so im sure things are not optimized, let alone installed correctly)...

does anyone know of (or have access to) a concrete set of steps that will take someone in a freshly installed linux environment all the way to a server that is optimized for high traffic drupal content? and belive me, ive googled till my eyes bled... ;) im really hoping for some recent (and thorough implementation guides)...

the setting i was going far consisted of the following pieces (hopefully all meshed together nicely):

basics
- debian and/or ubuntu
- mysql
- nginx (this has been the source of most of my frustration - optimizing this for Drupal)
- php

optimizations
- php-fastcgi
- memcache
- apc

any and all advice is most appreciated!!! :)

Comments

Hi, Take a look at

Milan0's picture

Hi,

Take a look at http://www.howtoforge.com/perfect-server-ubuntu-9.10-ispconfig-3
Etc..
I'm runnig the latest Ubuntu, but im sure they also have one for Debian.

there are alot of different for each O.S.

Like you after alot of weighing out pro's and cons of hosting on maybe Amazon, i've decided against that, and also set up a Lineode.
Took me about an half hour to set up the LAMP stack. I'm a web programmer, but in no way Linux savy. I mean i know maybe like 20 commands.

But these perfect server tutorials should help you out nicely. you can ofcourse always later take out some components out of the php installation you wont be needing etc, and recompile php, but i think its pretty basic as it is these tutorials, and they will also help you out with postfix mail, maybe a control panel (ispconfig).

I would suggest if you're going to use ispconfig, to follow the tutorials on howtoforge EXACTLY, because ISPConfig is going to install some stuff, but it also neds some stuff installed already.

I'm a bit confusing atm because i'm in a hurry but wanted to send this reply out, hope it helps :)
bye!

Also to add: i think APC is a

Milan0's picture

Also to add: i think APC is a great idea. I've decided against memcached, like APC its also an opcode cacher, meaning it caches instructions for the CPU, so it can be used later, but memcache is more for a multi-server environment, where other servers will be acess memcached data.
Memcache consumes alot of resources.

I'm still heavily in development phase myself, but decided to port to Pressflow drupal when i moved to my linode + APC.
Still need to config cacherouter though, haven't got to that.
I'm setting up a coaching/player community site with (hopefully;;)) alot of user generated video content, so i will be moving all my media to Amazon S3, so i don't have to worry about that scaling part.
When traffic increases and so does server load, i can just upgrade my linode to a new plan, or buy more cpu or ram.

excellent advice mate...

steveadamo's picture

excellent advice mate... thanks!

ive decided to first go down the "traditional" LAMP path, and depending on the results, dig deeper into the alternatice server options... :)

It also worth to watch "Best

wik's picture

It also worth to watch "Best Practices for Building a High Performance and Scalable Drupal Site" recorded webinar by Kieran Lal from Acquia
http://acquia.com/community/resources/acquia-tv/best-practices-building-...

An update !

Milan0's picture

Hi Steve,

I've just gone through 48 hours of pain, trying to set up FastCGI.
When i finally got there, i was serving 3 requests/s and apachebench was timing out with the most meager benchmarks there are.

sigh ended up being 2 configuration values which solved everything.

The setup is quite specific though, but not depending on the Linux distro used.

Linode 540 + additional 270MB Ram, (total 810)
Changed swapdisk from 256mb to 1gb, but found after i was running smooth the additional overhead was not needed anymore.
Still i'm keeping 1gb for additional overhead when i got Varnish serving more static content in the future.

Currently set up:
- Ubuntu 9.10 latest
- Apache2
- PHP5
- Mysql
- FastCGI
- APC
- Apache Solr
- Tomcat6
- Varnish

I also did some tweaking of MySQL, upping max concurrent queries, and pushing the cache from 16mb to 32mb.

And ofcourse my Drupal ported to Pressflow 6 with Cacherouter configured like descibed in the step-by step for Mercury

APC+FastCGI+Suexec wrapper for fastcgi is quite specific since you will also need the apache_mm_worker

But here we got, ab -c 1000 -n 10000 on my homepage

This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking www.mypokercoaching.com (be patient)

Server Software: Apache/2.2.12
Server Hostname: localhost
Server Port: 80

Document Path: /dev/index.php
Document Length: 1038 bytes

Concurrency Level: 1000
Time taken for tests: 6.508 seconds
Complete requests: 10000
Failed requests: 0
Write errors: 0
Non-2xx responses: 10000
Total transferred: 13350000 bytes
HTML transferred: 10380000 bytes
Requests per second: 1536.63 [#/sec] (mean)
Time per request: 650.776 [ms] (mean)
Time per request: 0.651 [ms] (mean, across all concurrent requests)
Transfer rate: 2003.32 [Kbytes/sec] received

Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 29 260.6 0 3001
Processing: 1 522 1187.3 214 6417
Waiting: 0 522 1187.3 214 6417
Total: 80 551 1224.4 215 6477

Percentage of the requests served within a certain time (ms)
50% 215
66% 224
75% 230
80% 237
90% 1088
95% 1912
98% 6394
99% 6437
100% 6477 (longest request)

While running, my pressflow is still loading lightning fast, although its quite (needingly) bloated with loads of modules.

Still going to do some more benchmarking with httperf and siege, but i think my results look quite good considering the amount of mysql queries that have to be run.
Being generous in giving mysql room to cache is essential here i guess.

I'm pushing to 600mb RAM used, which still leaves alot of room, and my server load dus not top 0.16!!

I'm so new to this all, i'm pretty shocked i managed this on my own, with alot of help from tutorials and posts here ofcourse :)
But soo stoked right now!

If you need some help on specifics, i'm more than happy to help ofcourse!

wow Milan0... thats

steveadamo's picture

wow Milan0... thats impressive!! congrats!! :)

i actually just completed the guide here: http://groups.drupal.org/node/25425 (just yesterday)

i still need to port over my site contents and do some testing, but so far, so good... :)

im running just a linode 360, so my system specs are no where near as robust as yours, but i expect good results from the configuration... crosses his fingers

im actually going to suggest a few changes to the guide, as there were some "issues" along the way, which im sure others might stumble with as well... and i would definitely like to hear how you approached your setup... seems like you added quite a few more optimizations... how closely would you say your setup resembles the mercury tutorial?

High performance

Group notifications

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