At Sat, 09 Dec 2006 12:52:41 +0000 Andy <andy-(E-Mail Removed)> wrote:
>
> G'day folks
> I must stress from the outset, my networking and linux knowledge is all
> from books, and my real-world experience amounts to 3months in total in
> my new job. I should also note that nothing will change, this is all out
> of my own curiosity.
>
> The servers we use are each fully independent.
> They each hold over 1000 customer websites and each run their own ftp,
> apache, qmail, mysql and dns (primary and secondary as eth0 aliases).
>
> It all sounds very cheeky but I can assure you, it works well!
>
> I want to find out if my concerns are even warranted over these servers
> being "jacks-of-all-trades". - Damn - a leading question if ever there
> was one!
> My concerns are just gut-reaction-by-analogy:
> If every cafe employee has to cook, serve and wash-up, a lot of time is
> wasted in changing clothes,washing hands etc. .. but if each has their
> own job, more customers get fed.
>
> Is there any problem with the machine's function changing continuously?
> Is there a noticeable overhead in making memory room for a new set of
> libraries to service one mysql request and then swapping them out again
> to be a dns server and then swapping again to scan for a virus in an
> incoming email etc. ?
No. Unlike your cafe analogy, the different services (functions) use
different resources. Also none are 'continious'. The computer is like
a person with multiple sets of hands, etc.: one pair up to it elbows in
dishwater, another pair working at the stove, and a third pair (with its
own pair of feet) out in the dining area serving food.
Note that under linux, shared code really is shared. And common file
accesses end up in memory-resident cache. Linux does not 'swap' at all
unless the machines are severerly memory starved.
>
> These machines are rapidly being upgraded from 512Mb to 1Gb memory, they
512Mb (on a *server*) is a long way from memory starved. 1Gb is a huge
amount of RAM for what you are doing. Apache, bind, and sendmail
will do thier thing quite happily in 256meg (all together) They can . MySql
*might* use more if the databases are large or complex:
sauron.deepsoft.com% ps aux | grep httpd
root 3427 0.0 2.8 18352 7356 ? Ss Dec01 0:17 /usr/sbin/httpd
apache 8791 0.0 1.5 18512 3908 ? S Dec03 0:00 /usr/sbin/httpd
apache 8792 0.0 1.5 18488 3888 ? S Dec03 0:00 /usr/sbin/httpd
apache 8793 0.0 1.4 18512 3828 ? S Dec03 0:00 /usr/sbin/httpd
apache 8794 0.0 1.5 18492 3876 ? S Dec03 0:00 /usr/sbin/httpd
apache 8795 0.0 1.5 18488 3880 ? S Dec03 0:00 /usr/sbin/httpd
apache 8796 0.0 1.5 18492 3876 ? S Dec03 0:00 /usr/sbin/httpd
apache 8797 0.0 1.5 18492 3872 ? S Dec03 0:00 /usr/sbin/httpd
apache 8798 0.0 1.5 18492 3880 ? S Dec03 0:00 /usr/sbin/httpd
sauron.deepsoft.com% echo '9*18.5'|bc
166.5
sauron.deepsoft.com% echo '(8*4)+7.3' | bc
39.3
All Apache (2.0.52): 166.5M virt, 40M resident
sauron.deepsoft.com% ps aux | grep sendmail
root 3275 0.0 0.8 7236 2064 ? Ss Dec01 0:01 sendmail: accepting connections
smmsp 3283 0.0 0.6 7680 1596 ? Ss Dec01 0:00 sendmail: Queue runner@01:00:00 for /var/spool/clientmqueue
Sendmail: 15meg virt, 3.5meg resident
sauron.deepsoft.com% ps aux | grep named
named 3132 0.0 1.2 38296 3084 ? Ssl Dec01 1:34 /usr/sbin/named -u named -t /var/named/chroot
Named (bind): 40meg virt, 3meg resident
Totals: 221.5 Virt, 46.5Meg resident
(This is on a *desktop* machine that is also a server on a LAN, running
CentOS 4.4 on a K6-500 with 256Meg of RAM.)
This machine *also* runs *both* MySql (when I start it) AND PostgreSQL:
sauron.deepsoft.com% ps aux | grep -i sql
postgres 3238 0.0 0.7 20012 2020 ? S Dec01 0:03 /usr/bin/postmaster -p 5432 -D /var/lib/pgsql/data -i -h 127.0.0.1
root 4080 0.6 0.4 5280 1084 pts/1 S 18:22 0:00 /bin/sh /usr/bin/mysqld_safe --defaults-file=/etc/my.cnf --pid-file=/var/run/mysqld/mysqld.pid
mysql 4113 5.9 6.9 125456 17892 pts/1 Sl 18:22 0:00 /usr/libexec/mysqld --defaults-file=/etc/my.cnf --basedir=/usr --datadir=/var/lib/mysql --user=mysql --pid-file=/var/run/mysqld/mysqld.pid --skip-locking --socket=/var/lib/mysql/mysql.sock
(MySql is far more of a memory hog than postgresSQL!)
Note that even will all of this running the machine *could* have
*everything* memory resident, if it wanted to, with only 256meg of RAM.
(It does not need to most of the time.) If it had 512Meg of RAM it
could have everything memory resident AND have a large cache of file
data in memory as well. The machine could be doing things without
hardly *every* touching the disk drives at all most of the time. The
only real bottleneck would be network bandwidth.
Apache, Sendmail, and Bind use very little CPU time -- all are pretty
much I/O bound (Disk -> memory -> network). The database backends will
use most of the 'spare' CPU cycles (processing SQL statements), but will
also be somewhat dominated by I/O constraints (Disk -> memory -> network).
> are on a 2.2 kernel with no DMA.
No DMA?!? What sort of disk drives? Don't tell me plain IDE in PIO mode
(dumb for a server). You really ought to be using at least SCSI disks
for servers (all modern (read PCI) SCSI controllers use DMA transfers).
Or SATA on newer machines.
>
> I'm really interested in the facts and figures - but anecdotes are fun;-)
>
--
Robert Heller -- 978-544-6933
Deepwoods Software -- Linux Installation and Administration
http://www.deepsoft.com/ -- Web Hosting, with CGI and Database
(E-Mail Removed) -- Contract Programming: C/C++, Tcl/Tk