scalability

Install RabbitMQ on Debian Squeeze

Install prerequisites and latest Erlang

RabbitMQ can install Erlang for you, but it does not install latest Erlang/OTP, which can cause problems when you try to install Admin UI, so it's the best to just compile latest Erlang/OTP

$ sudo apt-get update
$ sudo apt-get install build-essential
$ sudo apt-get install libssl-dev zlib1g-dev lsb-base 
$ sudo apt-get install ncurses-dev libncurses-dev
$ sudo apt-get install libcurl4-dev libcurl4-openssl-dev 
$ cd /usr/local/src/
$ sudo wget http://www.erlang.org/download/otp_src_R14B03.tar.gz
$ sudo tar xzvf otp_src_R14B03.tar.gz 
$ cd otp_src_R14B03/
$ sudo ./configure 
$ sudo make && sudo make install

Erlang compilation will complain about jinterface, odbc, wx and xsltproc and fop. We do not need any of that for our purposes, so please feel free to ignore.

Install RabbitMQ from Repo

Add the following line to your /etc/apt/sources.list:
deb http://www.rabbitmq.com/debian/ testing main

Install Node.js and Express.js with Nginx on Debian Lenny

Following instructions were tested on a RackSpace Cloud Server. It should work for any other reasonably configured, mostly bare-bones Debian Lenny and latest Ubuntu (e.g. on other popular hosting options like: SliceHost, Linode etc.).

First, let's install some essentials:

$ sudo apt-get update
$ sudo apt-get upgrade
$ sudo apt-get install build-essential
$ gcc -v
$ make -v

$ sudo apt-get install python-software-properties
$ sudo apt-get install libssl-dev libreadline-dev
$ sudo apt-get install git-core curl

Now we can proceed with Node.js installation. There are two ways to install Node.js, directly (not recommended due to maintenance cost) or with a version manager like nvm (highly recommended in most cases):

Method 1: Installing Node.js with NVM

Attention: this is the recommended way.

$ git clone git://github.com/creationix/nvm.git ~/.nvm
$ . ~/.nvm/nvm.sh
$ nvm ls
$ nvm install v0.4.12
$ nvm alias default v0.4.12
$ nvm ls
$ nvm help

Please make sure to add following line to your (and by "your" we mean the user which node apps will be executed as) ~/.bashrc or ~/.profile:

 . ~/.nvm/nvm.sh

You may want to log out and log back in, to test that login scripts work.

Method 2: Compiling Node.js from sources yourself

Attention: this is NOT recommended. You should use NVM or Nave instead.

$ cd /usr/local/src/
$ sudo wget http://nodejs.org/dist/node-v0.4.8.tar.gz
$ sudo tar xzvf node-v0.4.8.tar.gz 
$ cd node-v0.4.8
$ sudo ./configure
$ sudo make
$ sudo make install
$ whereis node
$ node -v

Installing NPM Package Manager

LAMP Settings for a High-Performance Small Server.

With the VPS expansion you can now get a (very) small virtual private server (VPS) for a very affordable price. However, when you get a server with something like 256MB or 512MB RAM and a portion of CPU power, using default MySQL/PHP/Apache settings is a pretty bad idea.

Performance and scalability tuning of a server is more of an art than science, in the sense that there're no ready-to-use formulas. Optimal server settings depend on many unique factors: web-app code, traffic to the site, site's information architecture among other things. It's virtually impossible to really optimize server settings without thorough understanding of the web application and a lot of testing.

That said, you are not going to run newsweek.com or huffingtonpost.com on a 256MB slice. Also, the default settings are typically so off that it is possible to give you a much better starting point. I'd like to share with you some settings that have worked well for me. I am assuming you are running a small site or a blog, with the traffic of several thousand page-views/day, using Wordpress, Drupal or something of that kind. I highly recommend getting at least a 512MB VPS, but these settings are better than the default for a 256MB server, as well.

Following are some variables for various settings files that have been modified from their default values.

Twitter Spitting on Ruby On Rails Performance

Very interesting: Twitter is abandoning Ruby on Rails due to claimed scalability problems:
http://www.techcrunch.com/2008/05/01/twitter-said-to-be-abandoning-ruby-...

Syndicate content