Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

The server hosting market is separated into single, double, qual, etc., processors, where each processor has several cores, or CPUs.

My company will offer a Linux-based web application that relies on an Apache web server and a middle tier for business logic. The middle tier is used to crunch math, and return result to a client. Many clients may access the application simultaneously. The company will start with one processor having 4 cores. I'm trying to understand how the app uses the cores and then how to scale the application as business grows, in terms of servers/processors/cores.

For example, I'd assume initially one core would be used for Apache, and the other 3 used to process client's requests for math crunching...

Question 1: does that mean, with the 3 cores available, I can handle 3 separate client requests simultaneously (e.g. 1 for each of 3 cores)? I mean, except for the shared RAM, is this effectively like having 3 individual machines (from pt of view or processing client requests simulaneously)? Or, only one client's request may be processed at any one time, but that client's request is divided up into up to 3 cores depending on the type of process running that does the math crunching and whether or not it can take advantage of multi threading (so the # of cores impacts how fast any one client request completes)? I'm confused about what the cores mean to the application here.

Question 2: As the business grows and more client requests need to be processed, should the server be upgraded to (A) a new machine with more cores, (B) a new machine with two processors, 4 cores each, or (C) keep the original server and add another server with a single processor? Which route provides the most efficient way to scale the application, in terms of processing more client requests per time interval? Is the choice, for example, limited by RAM (when you need more RAM than box can handle it's time to add another server), or something else?

Question 3: Is the total number of client requests processed simultaneously equal to the number of cores times the number of servers (minus the one core for Apache)?

share|improve this question
    
Read up on en.wikipedia.org/wiki/Computer_multitasking. If your application is limited by user mode CPU time, throw more CPUs at it. If it is limited by other things, throw more other things at it. It sounds like you need to hire a consultant. Also, operating systems rarely assign a process to be tied to a processor full-time without intervention by the user (en.wikipedia.org/wiki/Processor_affinity). –  Jeff Ferland Nov 30 '11 at 16:56
    
By CPU, do you mean cores or processors? –  gkdsp Nov 30 '11 at 16:58
    
Would the consultant be, for example, the developer writing the middle tier code, or a Linux administator, or other? (what keywords to use to search?) –  gkdsp Nov 30 '11 at 17:00
    
A 4-core processor is basically equivalent to 4 single-core processors. There are some differences, but they usually are minute besides the fact that a 4-core processor costs less. You should have somebody with Linux system administration background who is familiar with load testing and benchmarking. Being able to understand the code is also a bonus. If you're looking for a consultant who can walk you through the process, I might be able to work with you. My email is jeff@(domain from my user profile). –  Jeff Ferland Nov 30 '11 at 17:07
    
Thanks so much Jeff! –  gkdsp Nov 30 '11 at 17:15

2 Answers 2

up vote 3 down vote accepted

This totally depends on the application architecture and how the application itself is written.

BTW, there really is not much difference between 1 quad-core processor and 2 dual-core ones; what effectively counts is the total number of cores.

share|improve this answer
1  
Would this fall in the capabilities of the middle-tier (java?) developer? Thanks for the info about 1 proc w/ 4 cores = 2 proc w/ 2 cores (so total # cores is what's important in rough analysis). –  gkdsp Nov 30 '11 at 17:02

You have misunderstanding of concept and architecture.

Your assumption - "I'd assume initially one core would be used for Apache, and the other 3 used to process client's requests for math crunching..." in general wrong. No direct relation betwen numbrt of cores and number of simulaneous processed requests.

Question 2 hard depend on architecture details of service. Using memory, shared database, disk IO (crunching math can use array of constants in many Gb)

Look at timeline of servicing user request.

In draft:

apache getting user request -> middle tier crunching math -> apache sending results to user

Better look at working system. What is a bottleneck? Disk IO, RAM usage or CPU load?

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.