what is the fastest, stable vps configuration?

socialtalker's picture

hello. i have two linode accounts. the larger one will have aegir/barrucuda/octopus on it when i get it to working again. the Linode 512 vps account will have a detroit community site in drupal, it will be a large site with lots of features. i am using ubuntu 10.4, because i like the word ubuntu.
i will probably start with drupal 7 acquia, i have put two smaller sites like a radio station with voipdrupal on the account later, the linode 512 is too small for aegir, so i am looking for a good stackscript or manual nginx configuration. i am not a developer or web master, i just cant afford to hire one just now, so i have to do it myself. i am learning most
basically i am looking for the nginx configuration or stackscript that will give me the most bang with the least memory usage as of march 2012. i have come across a few stackscripts, including the ones on the home page of this group. the thing is i am not sure what if anything should be added to the scripts.
do i use
Varnish?
memchache?
apc?
boost?
what else?
do i use them all, or just two or three of them? which ones? which stackscript should i start with? if a stackscript has nginx and memcache, do i add varnish?
can i use them with a CDN?
i would like some thoughts/advice on what people are using. thanks.

Comments

My suggestions

perusio's picture

in the back of a napkin.

  1. Nginx with php-fpm.

  2. APC, using it also for drupal caching.

  3. Use the Nginx cache.

  4. No Memcache.

  5. No Varnish.

  6. Alternatively to the Nginx cache use Boost.

thanks so much. i hate when i

socialtalker's picture

thanks so much. i hate when i have too many choices, it really puts me in a tail spin!

Why nginx+php-fpm, not

chilic's picture

Why nginx+php-fpm, not nginx+apache+mod_php?

Because the OP

perusio's picture

requested the setup to be the leaner and meaner possible in resource usage. Apache doesn't qualify. Furthermore fpm has a much more features for managing the PHP processes than Apache.

apache doesn't qualify by

locuse's picture

apache doesn't qualify

by what subjective measure?

properly-configured (meaning, you tweak it system-wide for your particular usage, obviously) nginx/varnish3/apache24/mod_php/memcached/mysql/apc/drupal7 runs, in my case, on a linode 1024 without issue.

of course, less can run on less.

... fpm ... much more features ... processes

depends on what you're trying to tune, and whether you're looking at your system-wide resource utilization

e.g., apc opcode caching has great utility, particularly on low-resource sites.

using mod_php, a single apc opcode cache can be shared across all mod_php processes. using fcgid/fastcgi, apc is not shared across multiple processes -- there's one memory-using apc cache for each php/cgi process. if you tweak down to a single php process, then the mutli-process 'flexibility' is moot anyway.

php process tuning and process separation, in addition to separate apache process tuning, is certainly of value when there are multiple tenants on the webserver. but, that scenario shouldn't be on a low-resource VPS to begin with.

Not exactly so

perusio's picture

(...)
using mod_php, a single apc opcode cache can be shared across all mod_php processes. using fcgid/fastcgi, apc is not shared across multiple processes -- there's one memory-using apc cache for each php/cgi process. if you tweak down to a single php process, then the mutli-process 'flexibility' is moot anyway.

In fact php-fpm is completely compatible with an opcode cache and shared memory models.

php-fpm is compatible with

chilic's picture

php-fpm is compatible with shm model in APC only?
What about xcache and eAccelerator?

The same applies

perusio's picture

xcache and eAccelerator are both shared memory based too.

i thought nginx and apache

socialtalker's picture

i thought nginx and apache were the same thing?

now if we only had a good

gateway69's picture

now if we only had a good linode stack script for your kick ass drupal nginx setup :)

i am looking at this script

socialtalker's picture

http://vpsbible.com/vps-setup-guides/stackscripts/lemp-stack-ubuntu-32bi...
by the guv

its a memberships site. so you wont see the code in the windows..(NO that is not an affliate link) it cost 15 bucks a year, but it was soooooo worth it. let me tell you early last year i was so confused and lost on how this vps bash script, command line stuff worked, i felt like my brain was in pain. never in my life was i more confused. i felt like my ...anyway l , this site literally guided me by the hand how managing a vps works.
anyhoo i am familiar with this site, so i will try his script and incorporate Perusio's suggestions into the stackscript. mainly adding:
2.
APC, using it also for drupal caching.
3.
Use the Nginx cache.
although i have to confess i dont know how to do 2 or 3 to a script. .

Nginx + varnish

r.agabekov's picture

What do you think about using Nginx (for static) + varnish (for dynamic cache) instead Nginx cache?
Drupal has a module to integrate with varnish and we will get more usefull cache than nginx cache.

Can you elaborate and

perusio's picture

qualify the term useful in this context? Remember that the OP has a memory challenged VPS.

Useful - i mean if we will

r.agabekov's picture

Useful - i mean if we will use varnish and module varnish for drupal we can update cache on node change.
But i think you are right that in situation when we are limited in memory on VPS - nginx cache is the best solution.
Tell me, please, did you use boost on drupal 7 (version for 7 is only in dev) and what results if you use?

expire and purge

attiks's picture

For nginx you can use expire and purge to accomplish the same, still in dev but working pretty good for us.

Thanks for nginx and expire +

r.agabekov's picture

Thanks for nginx and expire + purge.
What do you think about performance this solution vs varnish?

no idea

attiks's picture

Last time i used varnish was ages ago, nginx cache responds in a ±100ms (including round trip time), so it's fast enough for me, I assume the performance will be comparable to varnish.

I haven't

perusio's picture

that much experience with Boost. I prefer to use a microcaching approach where I don't care about the expiration logic, but instead I just deploy a cache TTL that is in accordance with the rhythm of new/updated content in your site.

Also with the Nginx cache there's no need to purge anything you can force an update by bypassing it. See here.

You should not hate when you

joelwallis's picture

You should not hate when you have many choices, but when you have no one choice, socialtalker.

Joel Wallis.
http://joelwallis.net

that correct, but only if you

socialtalker's picture

that correct, but only if you know what you are doing!

High performance

Group events

Add to calendar

Group notifications

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