Page 1 of 1
Building a new machine, dual or quad core?
Posted: Fri Feb 26, 2010 5:54 pm
by Merdini
My OS that I'm currently developing will just act as a webserver. I will be building my own FS and DB (for the sites).
I'll contain everything I need to run my websites properly.
I will also develop my own Software RAID, but it will be implemented directly in the OS. Kind of like RAID10 (RAID1 + RAID0) but with only 3 drives! But only 2 drives will be running at the same time, so there will always be a third one that can "rest", there will be a backup-routine that copies the data from the 2 active drives to the third resting drive. So whenever a drive breaks, the third one will go active and it'll give me time to hotswap the broken one.
Lets say my CPU only has one core but the OS is (of course) multitasking which jumps between the different tasks like writing/reading to the DB, ports and so on. This will make the CPU busy, right? Especially if there is a lot of users/connections writing and reading at the same time.
If the CPU has dual cores, I'll be easier to assign different tasks to each core and everything will run faster.
But isn't the CPU the fastest part in a computer?
If I have quad cores and assign different tasks to each core, wont there be a lot of "waiting time" for the CPU (nothing to do) when reading ports, waiting for connections? (The system bus / I/O devices / memory controller).
Will the system bus / IO devices / memory controller be the ones that holds me from running the server as fast as possible due to no use of all the fore cores to their 100% limits?
Everything here is theoretical, and please, correct each statement if I'm wrong.
My questing therefore is;
Is it worth it to get QUAD cores or is DUAL cores enough?
Should i rather look at a better motherboard that can interact with all the cores faster?
If so, what should I be certain of when buying a good motherboard?
Re: Building a new machine, dual or quad core?
Posted: Fri Feb 26, 2010 9:33 pm
by Lithorien
Kurdistan wrote:My questing therefore is;
Is it worth it to get QUAD cores or is DUAL cores enough?
Should i rather look at a better motherboard that can interact with all the cores faster?
If so, what should I be certain of when buying a good motherboard?
Multiple cores will always be more efficient than a single core in a multitasking system. Simply because you can run multiple tasks in parallel, and even if one core is blocking, other cores can continue working. In addition, the more cores, the more simultaneous tasks - so a quad-core beats a dual-core beats a single-core, just like a quad-processor setup beats a dual-processor setup beats a... you get the idea.
As for running as fast as possible: A system can only run as fast as the slowest component. Your server is running "as fast as possible" when the slowest component is running as fast as it can. Speed isn't just dependant on the CPU, but also on the remaining hardware, and even the efficiency of the code and scheduler. Try to optimize what you can, and plan for the future (handle more cores, really efficient scheduler, etc) and your server will handle anything that you throw at it.
Re: Building a new machine, dual or quad core?
Posted: Sat Feb 27, 2010 10:18 am
by earlz
I'd say if your interested in building a server, buy a dual-socket motherboard. They are more expensive, but they are completely magical for the extensibility they provide, in which case you could buy a dual core now and if it's determined you need more power, you can buy a quad core later and have 6 cores.
Re: Building a new machine, dual or quad core?
Posted: Sat Feb 27, 2010 3:59 pm
by Selenic
earlz wrote:I'd say if your interested in building a server, buy a dual-socket motherboard. They are more expensive, but they are completely magical for the extensibility they provide, in which case you could buy a dual core now and if it's determined you need more power, you can buy a quad core later and have 6 cores.
Or you can go crazy and get an 8x6-core AMD system (soon to be 8x8). Similar things exist from Intel, but I don't think they have any 6-core chips (they're going straight from 4 to 8, but have HT to make up for it a bit)
Re: Building a new machine, dual or quad core?
Posted: Sat Feb 27, 2010 5:07 pm
by JackScott
There is no such thing as too much processing power, but there is such a thing as too high a price.
Ergo, just buy as much as you can afford to spend now, keeping in mind the upgrade path. If I was in your position, I'd buy a quad core. Don't worry about 6 or 8 or more cores now, by the time you really need them they will be amazingly cheap.
Re: Building a new machine, dual or quad core?
Posted: Sat Feb 27, 2010 5:24 pm
by Merdini
Thanks for all the great answers!
This server will only be a testserver for the development. Not easy to develop a OS that requires 4 cores when my current machine only has 1.
Selenic: Both intel and amd has HEXACORE, 6 cores. The Intel Xeon.
Lithorien wrote:Kurdistan wrote:My questing therefore is;
Is it worth it to get QUAD cores or is DUAL cores enough?
Should i rather look at a better motherboard that can interact with all the cores faster?
If so, what should I be certain of when buying a good motherboard?
Multiple cores will always be more efficient than a single core in a multitasking system. Simply because you can run multiple tasks in parallel, and even if one core is blocking, other cores can continue working. In addition, the more cores, the more simultaneous tasks - so a quad-core beats a dual-core beats a single-core, just like a quad-processor setup beats a dual-processor setup beats a... you get the idea.
As for running as fast as possible: A system can only run as fast as the slowest component. Your server is running "as fast as possible" when the slowest component is running as fast as it can. Speed isn't just dependant on the CPU, but also on the remaining hardware, and even the efficiency of the code and scheduler. Try to optimize what you can, and plan for the future (handle more cores, really efficient scheduler, etc) and your server will handle anything that you throw at it.
Basically, one should have as many cores as tasks, right?
And what do you mean with "if one core is blocking"? How can it block and in which situations?
Lithorien wrote:Your server is running "as fast as possible" when the slowest component is running as fast as it can.
The slowest component would be the ones on the motherboard, I guess. Since the CPU is much faster. The only components that I would buy for the server would be a SATA controller and a network card. I can't change any other component after that, so everything else is up to the motherboard, like the systembus.
And how can I know which motherboard is better than the other? On the most PC online stores, they don't have the kind of specifications and information we need as OS developers when buying components. I don't trust the prices ether. Would never buy the most expensive motherboard thinking it's the best.
JackScott wrote:There is no such thing as too much processing power, but there is such a thing as too high a price.
I'd say there is. In my case, I don't want to buy a CPU with 24 CORES (lets say they exist) even if I afford it, when the other components and the OS are the slow parts, leaving me with the use of only a few cores.
Re: Building a new machine, dual or quad core?
Posted: Sun Feb 28, 2010 12:36 am
by Brendan
Hi,
Kurdistan wrote:The slowest component would be the ones on the motherboard, I guess.
For a web server, the slowest component is typically the internet connection. A second-hand "1 GHz Pentium III" with 100 Mb ethernet can usually saturate the internet link...
Cheers,
Brendan
Re: Building a new machine, dual or quad core?
Posted: Sun Feb 28, 2010 8:33 am
by Selenic
Kurdistan wrote:Selenic: Both intel and amd has HEXACORE, 6 cores. The Intel Xeon.
Fair enough, I just didn't remember seeing any.
Kurdistan wrote:JackScott wrote:There is no such thing as too much processing power, but there is such a thing as too high a price.
I'd say there is. In my case, I don't want to buy a CPU with 24 CORES (lets say they exist) even if I afford it, when the other components and the OS are the slow parts, leaving me with the use of only a few cores.
You can always use it as a computational server as well (think distcc, video encoding or things like that - they're very compute-heavy, as long as you have half-decent disk bandwidth)
Brendan wrote:For a web server, the slowest component is typically the internet connection. A second-hand "1 GHz Pentium III" with 100 Mb ethernet can usually saturate the internet link...
The main limiting factor for a web server wouldn't be ethernet, but the internet connection, surely?
For example, if it's serving a local network, you can grab a 4xgigabit card fairly easily (just need to implement load balancing and so on across it) or a 10 gigabit card (though you need 10 gigabit switches then as well) but I doubt four-gigabit *internet* connections are going to be particularly common...
Re: Building a new machine, dual or quad core?
Posted: Sun Feb 28, 2010 3:05 pm
by pcmattman
The main limiting factor for a web server wouldn't be ethernet, but the internet connection, surely?
Point is, if you generate 100 mb traffic, you're going to completely saturate your internet connection, but your ethernet link will be running at capacity.
Re: Building a new machine, dual or quad core?
Posted: Sun Feb 28, 2010 5:04 pm
by Merdini
Thanks once again for the answers.
You can't say that the slowest component is the internet connection.
One client can load the server more than others, which means, it depends on the number of requests and connections.
Let's say 1000 users/connections on a specific site writes to the db, and that takes, say 10 seconds total until the server is idle.
While another day, 1000 users/connections on a specific site reads a simple html page and that takes, say 3 seconds until the server is idle.
Meaning, it depends on what the users/connections are doing. How long it takes to respond to their requests. When the request is received, the server is responsible for the waiting time for the users/connections. With that said, the internet connection is not the slowest component. My server will not act as a file server, loading the internet connection to its maximum point.