Good Hardware Configuration for a Web Server?

What would a good HW configuration be?

  • (2 Pages)
  • +
  • 1
  • 2

15 Replies - 13962 Views - Last Post: 10 December 2008 - 06:39 AM

#1 jens  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 67
  • View blog
  • Posts: 430
  • Joined: 09-May 08

Good Hardware Configuration for a Web Server?

Post icon  Posted 03 December 2008 - 08:37 AM

Hi!

I'm dreaming of my own site on the web. Since I want it to be snappy and secure I've been thinking about what hardware to use. Other considerations is that I want it to be scalable and fault tolerant. My budget is not huge but I don't have to use old second hand stuff either.

I've been thinking along these lines:
- The web server on a cheap core2duo server with maybe 2 GB memory.
- The web server with 2 NICs, one for the web and one for the database server.
- The data base server on a separate cheap core2duo server with raid 0 (raid 5 would be nice but too expensive) and maybe 2 GB memory
- Between these a 1 Gb/s ethernet and this is where I'd hook in my service PC too.
- Backups to an external USB drive

Do you think this would be good?
Would it be better to buy one really fast server with raid 5 and run the web server and the data base server on the same machine?

I plan to run this under Windows - at least the web server (since I program in ASP.NET and VB.NET). In case of two servers I'd consider running the database server with MySQL under Ubuntu.

Very open question, feel free to suggest somthing completely different that does not involve web hosting.

Regards
/Jens - today a dreamer... :)

Is This A Good Question/Topic? 1
  • +

Replies To: Good Hardware Configuration for a Web Server?

#2 jens  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 67
  • View blog
  • Posts: 430
  • Joined: 09-May 08

Re: Good Hardware Configuration for a Web Server?

Posted 03 December 2008 - 08:52 AM

Another question about the same subject:

If I can choose between 1 link to the net (100 Mb/s to me, 50 Mb/s from me) or 2 links where each has 100 Mb/s to me and 30 Mb/s from me only slightly more expensive. Which should I choose? I guess two would be better even if the total speed was the same since if one breaks I could use the other one.

In case of two links, can I somehow have 2 web servers and 1 database server and get the load to balance between the two web servers? How would this work pertaining to one www-address and two IP-numbers?

In case of two links and one web server... How would that work? Two NICs on the Internet side of the server?

/Jens - dreaming on... :rolleyes:
Was This Post Helpful? 0
  • +
  • -

#3 xerxes333  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 31
  • View blog
  • Posts: 504
  • Joined: 05-July 07

Re: Good Hardware Configuration for a Web Server?

Posted 03 December 2008 - 11:52 AM

Have you considered virtualization?
Was This Post Helpful? 0
  • +
  • -

#4 jens  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 67
  • View blog
  • Posts: 430
  • Joined: 09-May 08

Re: Good Hardware Configuration for a Web Server?

Posted 03 December 2008 - 12:03 PM

No, because I don't know it.

I guess it means that I have one PC and run instances of an operating system on it (under some other OS?) and run my servers in the OS instances. If this is what virtualization means I really don't understand the point of it if I have the option of a real PC for my servers.

Enlighten me... :)

Regards
/Jens
Was This Post Helpful? 0
  • +
  • -

#5 MorphiusFaydal  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 43
  • View blog
  • Posts: 1,376
  • Joined: 12-May 05

Re: Good Hardware Configuration for a Web Server?

Posted 03 December 2008 - 12:29 PM

Buy one more expensive and more powerful system, rather than buy two lower powered, individually cheaper, but together more expensive systems. Then run something like VMWare Server (which is free to download, if you don't need the tech support - and there's lots of free support for VMWare virtualization), and then yeah, just install two instances of whatever OS you decide to use, or install two different OS's and use it that way. With the right setup, each VM (virtual machine) has its' own IP address to the network. The host system also has an IP of its' own too. So you would in essence have three machines in one box.

Advantages:
* Less cost
* Lower power

Disadvantages:
* Requires to have more knowledge (not a bad thing, and could also be considered an advantage)
* Hardware failures on one machine affect more services. (Of course, in a situation like this, if one goes down, the other is essentially dead in the water.)

To answer your original question - How much load are you expecting to have on these servers? If it's a lot, then a beefier system would be good. But, if it's a lighter load, then you can get away with lower end hardware. I was running my personal website (apache2, PostgreSQL, PHP) on a 1.4 GHz Pentium-4 with 640MB of RAM and two 20 GB hard drives in RAID 0. Admittedly, I got next to no traffic to it, but when I did get people coming to it, that box held up like a trooper. The same box also acted as my network share and as a bittorrent box.

HTH,
Chris

This post has been edited by MorphiusFaydal: 03 December 2008 - 12:31 PM

Was This Post Helpful? 0
  • +
  • -

#6 jens  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 67
  • View blog
  • Posts: 430
  • Joined: 09-May 08

Re: Good Hardware Configuration for a Web Server?

Posted 03 December 2008 - 01:18 PM

I appreciate the input, unfortunately I don't understand why you argue against two cheaper PCs.

* Ok, together they might cost slightly more than one expensive box but I won't have the overhead of virtualization.
* I believe that the two boxes will be cheaper per system capacity than one advanced box with - or without - virtualization. I've found it generally cheaper to buy two (of many things, including PCs) of somthing and add their capacity rather than to buy one top-of-the-line of somthing to get the same capacity.

I will also have an easy way to increase capacity where it's needed with two boxes. E.g. if the load on the database server increases I can easily split the databases tables to two different databases, each running on its own machine.

Please do not think me obnoxious, I'm just one of those guys who gets an idea and have a hard time letting go.

About the load:
I don't really have a good answer. If things go verywell I guess I'll have 100 concurrent writers and 10 to 100 as many concurrent readers using 30+ complex tables (many-to-many-to-many-relations) 1.000.000 records per table but each record in average probably not exceeding 500 bytes (no images or weird BLOBs). If things go unbelievably extremely well I guess all numbers, except record size, will be multiplied by a factor 10 to 100.


But:
I would really like this to be an open discussion that covers HW demands and suggestions in general, not just my case.

In short: More thoughts on what's good or not so good in different setups.

Regards
/Jens
Was This Post Helpful? 0
  • +
  • -

#7 mocker  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 50
  • View blog
  • Posts: 466
  • Joined: 14-October 07

Re: Good Hardware Configuration for a Web Server?

Posted 03 December 2008 - 04:39 PM

vps's are good for testing software or running seperated sytems that you don't want to affect each other. It doesn't sound like this applies to you though.

The two server setup you are talking about sounds about right. You can scale either the database or the web server independently of each other, don't have to worry about one locking up and blocking the other (happens alot with pages that heavy db access).

The two resources that get eaten up quickly on webservers are RAM, and disk read/write speeds, for both the webserver and the db. If you have enough ram to cache most of your mysql and apache/IIS queries than you'll have significantly faster response times. Also make sure you partition your drives so the root system is on its own partition, seperate from website data, and temporary files which can and probably will fill up at some point when you aren't watching.

Load balancing isn't a very high issue on most webservers, and you have options as long as you keep webserver and databases on seperate machines, so I wouldn't worry about that. Running a slave db server to handle reads only for example takes almost no time to setup. For scaling web content either networked storage (which can run into disk access/network bottlenecks), or using a distributed content service, such as dream.in.code uses, that hosts all your static content for you

If you can do it, and plan on growing traffic then I'd suggest sticking with the two machine setup as its easier to scale and helps avoid some of the bottlenecks you run into first

This post has been edited by mocker: 03 December 2008 - 04:44 PM

Was This Post Helpful? 0
  • +
  • -

#8 xerxes333  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 31
  • View blog
  • Posts: 504
  • Joined: 05-July 07

Re: Good Hardware Configuration for a Web Server?

Posted 03 December 2008 - 05:52 PM

Personally I'm the same as you I think it makes more sense to have "real" machines rather than "virtual" machines. I've just noticed the trends right now are leaning to the virtualization side of things. I just through the idea out there for consideration.

As far as your HW specs most of the others have covered them well enough I think. I would just keep in mind that in adding more HW is cheap and easy, its the management of those resources that will consume most of your time.
Was This Post Helpful? 0
  • +
  • -

#9 jens  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 67
  • View blog
  • Posts: 430
  • Joined: 09-May 08

Re: Good Hardware Configuration for a Web Server?

Posted 04 December 2008 - 02:04 AM

Great feedback on the computers. I got some stuff to think about.

Any thoughts about the setup with one or two feeds to Internet?

The question was if it would be better to have two slower connections with approximately the same sum capacity as one faster or if one faster would be better, and why. Also, do you have any idea how that would work since two connections will have two IPs. I.e. is it possible to solve this in the DNSes; one address two IPs?

How would that work with two web servers running the same site? Or, should the two connections go to one serever with two NICs for internet access?

Regards
/Jens
Was This Post Helpful? 0
  • +
  • -

#10 no2pencil  Icon User is offline

  • Head MFIC
  • member icon

Reputation: 5067
  • View blog
  • Posts: 26,450
  • Joined: 10-May 07

Re: Good Hardware Configuration for a Web Server?

Posted 04 December 2008 - 04:14 AM

View Postjens, on 4 Dec, 2008 - 03:04 AM, said:

The question was if it would be better to have two slower connections

Assuming you are sharing this with the world, how fast of a connection are you going to get? Even with 10/100 you'll never pull that through the wall (from your ISP).

View Postjens, on 4 Dec, 2008 - 03:04 AM, said:

Also, do you have any idea how that would work since two connections will have two IPs.

You'll set Apache (or whatever server software you have) to listen to both addresses.

View Postjens, on 4 Dec, 2008 - 03:04 AM, said:

How would that work with two web servers running the same site?

Load Balancing
Was This Post Helpful? 0
  • +
  • -

#11 Trogdor  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 15
  • View blog
  • Posts: 627
  • Joined: 06-October 06

Re: Good Hardware Configuration for a Web Server?

Posted 04 December 2008 - 11:15 AM

For security's sake, keep your database away from the evil outside world.
If you need to access it, just SSH to your webserver or management machine, and then hop further to you DB.
This way you can also keep your database connection unencrypted (even completely without a password if your flavor of DB offers that) and thus faster.

As for discs: i have discovered again and again that a raid 0 set is indeed fast and a raid 1 is indeed secure, and a raid 10 (1+0) should indeed offer both, but if one drops out you are in trouble anyway. If you can not spare the cash for a decent scsi raid controller and IO is going to be an issue, perhaps a cluster of raptors would do the trick.
I assume you are talking 19 inch rackmounted pizzabox formfactor btw?

But there is nothing that beats the performance gains of:
- selecting the right database software, for example postgres does not fold when there are over 200 connections the way that mysql does (or at least did 3 years ago) and keeping it not just uptodate but also clean (so auto log rotation etc to keep having enough space)
- INDEXING!
- using fast, smart designs to minimise table access and overhead. This includes connection pooling and caching.

I have been amazed at the speed of a 2 server setup by the way. I bought a second hand IBM xserve last year, and even though several years old this box outperforms many other servers i maintain, just because of the fast discs and smart way it was setup. Even with just 1 GB of ram.

Your choice of a 2 server setup is a good one.
I can suggest you to use a crosscable to interconnect them (do not use a router) and give them fixed ip adresses on those nics on one of the private networkranges.
Virtualization is just another hype that adds more overhead. It works well if you have stocks in intel, but otherwise it is pretty bogus to use it in a production environment.

Oh, one more thing. Make sure your servers use ram with parity.
You REALY dont want your machine corrupting data because of 1 defect bit in one cheapskate dimm.
Was This Post Helpful? 0
  • +
  • -

#12 mocker  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 50
  • View blog
  • Posts: 466
  • Joined: 14-October 07

Re: Good Hardware Configuration for a Web Server?

Posted 04 December 2008 - 12:17 PM

Trogdor brings up a bunch of good suggestions. just a couple little things:

Quote

- selecting the right database software, for example postgres does not fold when there are over 200 connections the way that mysql does (or at least did 3 years ago)

This is not true and as far as I know, never was. Poor database management, no matter what your flavor, will cripple it. There is a reason why mysql is so widespread. I'm not saying its better but keep uninformed statements out of this

Also virtualization has its uses, which it is extremely useful for. It just isn't useful in this case. If you needed several isolated systems then it is very very useful.

The crosscable suggestion is a must with separated databases in order to serve high traffic sites.
Was This Post Helpful? 0
  • +
  • -

#13 Trogdor  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 15
  • View blog
  • Posts: 627
  • Joined: 06-October 06

Re: Good Hardware Configuration for a Web Server?

Posted 05 December 2008 - 06:35 AM

A very large dutch geek site, tweakers.net, migrated from mysql to postgres for exactly this reason.
They where developing database performance tests to test new server hardware in life-like situations (that is what that site is also about). Due to a readers initiative they tested not only on mysql but started to do the same tests on postgres, just out of curiosity.
What they found was stunning (to them anyway).
They themselves didnt think it could make a difference for stability, but it did.
Between 100 and 150 concurrent requests the performance of the mysql database dropped sharply, while the postgres setup kept serving data happily to 250 users and more.
This was the same test, with the same data.
Shortly after the whole site was migrated to postgres.

It is possible that the issues that where known at that time have been fixed now and it does not matter anymore what brand you use, but last time i checked it did, and very much so.
It is a good thing to profile your site, and guesstimate the expected traffic.
Those complex joins you expect, are they well indexable? then it should not be a problem.
Will there be thousands of users poking around all day, like on a web-game?
Will you need cronjobs that do heavy operations during which you can not guarantee snappy response? (perhaps you need to 'disable' the site during this.)

Sit down and put on paper what you expect. Talk it over with someone else. Then you can do some research on sot and hardware you need.

btw, if it is rackmounted hosting in a bunker somewhere that the boxes will be put into, dont focus so much on the best performance you can squeeze out of desktop grade hardware (like the coreDuo statement suggests) but on reliability.
If a Xeon can not handle the load, use 2 Xeons. If they can not handle the load either, and there is no optimization that can be done, wow, you are generating a lot of cpu use! Are the users paying for that?
Was This Post Helpful? 0
  • +
  • -

#14 mocker  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 50
  • View blog
  • Posts: 466
  • Joined: 14-October 07

Re: Good Hardware Configuration for a Web Server?

Posted 05 December 2008 - 03:14 PM

Quote

It is possible that the issues that where known at that time have been fixed now and it does not matter anymore what brand you use, but last time i checked it did, and very much so.


Do more research. If the dutch site had so many problems scaling mysql, they weren't doing it right. I can guarantee that there sites that do more db transactions than them without running into these performance issues. But if you'd rather ignore the very very large number of sites that use it and have tested it in all sorts of "life-like" situations go right ahead, just don't base advice to others on it.

http://www.mysql.com...sql/benchmarks/
http://www.mysql.com...t_pitfalls.html
http://2bits.com/art...-drupal-5x.html

The article you are basing your statement on -
http://tweakers.net/reviews/657/6
A 2006 test using a db from mysql 4.0, and using hyperthreading to test scaling (what?). The review was mainly aimed at comparing different hardware. They do not mention anywhere how they had the databases optimized, if at all. Knowing that their test visitors request a standard frontpage 34 times gives us absolutely no information to base anything on.

I actually had some trouble finding recent comprehensive benchmarks from unbiased 3rd parties, so would be interested in reading any if you see some. If they are the same quality as your previous research though I'll pass.

This post has been edited by mocker: 05 December 2008 - 03:17 PM

Was This Post Helpful? 0
  • +
  • -

#15 c0mrade  Icon User is offline

  • D.I.C Regular

Reputation: 20
  • View blog
  • Posts: 412
  • Joined: 16-November 07

Re: Good Hardware Configuration for a Web Server?

Posted 07 December 2008 - 06:42 PM

Quote

Virtualization is just another hype that adds more overhead. It works well if you have stocks in intel, but otherwise it is pretty bogus to use it in a production environment.


Bull. Virtualization is important because it allows separation of software and hardware, meaning you can more easily recover from hardware failure and more easily move across different platforms. I doubt these advantages would be relevant to the OP though.
Was This Post Helpful? 0
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2