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.

Can a Multi core CPU server be configured to allow the OS to see all the cores as a single CPU and there by allowing the processor to function as a single CPU?

A lot of modern day servers are multicore CPUs. Are they ways for all the CPU cores to report as 1 CPU to the OS? This would be handy to run applications was designed for a single CPU.

share|improve this question
    
If we could do that, what would the point of multi-core CPUs be? –  David Schwartz Aug 28 '11 at 4:51

9 Answers 9

up vote 22 down vote accepted

What you're asking is

"Can I run a single threaded application on a multi-core machine and take full advantage of all the cores?"

The answer is : no

A single threaded application can only run on one core and will never be able to use more resources than that single core can provide.

share|improve this answer
4  
If you find a way to do this, then you'll be able to retire and live on a beach somewhere :) –  Rory Jan 14 '10 at 15:00

Are you saying that with say a 4 core 3Ghz CPU you want the OS to see it as a single core 12Ghz CPU? If that's the case, then no, you can't do that.

Unless the application is specifically written to require access to CPU0 (and I'm not even sure if that's a possibility) it shouldn't matter.

Toms hardware has a utility for having an application have affinity for a specific CPU when launched. I haven't tried it so take it for what you will. It can be found here

share|improve this answer

as i understand you wish to transform dual core cpu to one cpu that would be [ from perspective of single threaded application ] twice as fast as each of cores. unfortunately this cannot be done. closest to it is idea implemented in intel's i7 cpus which can smartly overclock one of cores if they see it's mostly loaded while oder cores are idle.

share|improve this answer

If an app can only use one CPU, it will anyway. It does not matter how many are present.

The OS will see all enabled CPUs but should be able to separate core vs socket for example (eg SQL Server affinity). But no, you can't make a 4 cores appear as one to OS thats I know of.

share|improve this answer

Depending on the BIOS, you might be able to disable all but one of the cores, but you're going to lose a large part of the performance. You can also set programs to run on a single core.

Creating a virtual machine with a single core would also provide a solution.

share|improve this answer
    
If Virtualization is used, can the VM use the physical multicore effectively while offering a single processor to the application? Would the performance be better than the application directly using a single physical core? –  L. DPenha Jun 1 '09 at 20:06
1  
No, the fastest single CPU you can add to the guest is the speed of the host CPU, minus a bit for overhead. –  Dentrasi Jun 1 '09 at 21:09
    
No. On VMware (for example), a single virtual CPU can use as much CPU in Mhz as a single core. This is, in essence, no different than your original situation because adding a second virtual CPU will not benefit a single threaded application. –  Kevin Kuphal Jun 1 '09 at 21:47

Regarding using VM's to solve this problem: The point would be to use as many single-core VM's as there are physical cores in the system. Then run a single instance of the app on each VM. This will actually result in each individual instance running slightly slower than if run by itself on the host OS; however, it will allow for much more parallelization of the workload.

This is all assuming that your environment and code will allow multiple instances of this app and that you could break the workload into chunks for the instances.

Granted, the best way of doing this would be to re-write the app to be multithreaded; however, many times that can be impractical in terms of developer man hours.

share|improve this answer

AMD REVERSE HYPER-THREADING!

http://www.theinquirer.net/inquirer/news/1005560/amd-socket-am2-has-a-secret-weapon


(Spoiler: it does not exist.)

share|improve this answer
    
I do wonder about that, a 4 or more HT core, with prioritization so one thread can grab all available resources, and let the other threads take what it leaves, as a way to get better single threaded performance (for the app that can handle running that wide, such as scientific computing, or likely gaming), while still offering good utilization via HT for normal workloads vs 2 cores with two threads each. –  Ronald Pottol Sep 13 '09 at 20:43

As was asked in a comment by the OP, what about running the OS and application in a VM? Would that essentially be the same as faking a single faster CPU?

In short, no. Virtulization is able to work quickly only when it can execute the OS and applications instructions on the CPU natively. In theory, one possibly could rewrite incomming instructions to better utilitize multiple CPU's, but that would likely fail on all but very simple tasks. How do you know that you are not executing the insturctions to send data, but the calculations on that data are not finnised yet?

This is one reason applications have to be written and compiled specificly for multithreaded operation.

share|improve this answer

As Sage said, if you want to see one big cpu instead of multiple cores, then no. At least, not that I know of.

In Linux however, you can temporary disable a core like so:

echo 0 >> /sys/devices/system/cpu/cpu1/online

Your performance will suffer though, because now everything running on the system will be running on whatever cores are left.

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.