Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

I'm looking to temporarily reduce the amount of cores and RAM available to my system, as well as the processing power.

I've written a server that uses epoll (Linux) and I want to get a rough comparison of it's performance to a server I've witten using kqueue (BSD/Darwin).

My Mac Book Pro is way more powerful than the Linux machine I'll be using, so I want to reign it in a bit.

I was thinking about creating a virtual machine and giving it the resources that I don't want available to OSX, but I'm not certain about how resource sharing works with the VM, and if this will be a reliable way of hamstringing my system. Also, this will just reduce the number of cores, not alter the performance of the CPU.

Is there an easier and possibly more reliable way to do this? Please note that I'm a bit thick when it comes to hardware.

share|improve this question
add comment

2 Answers 2

up vote 4 down vote accepted

Pulling the RAM seems a reliable way to constrain that resource.

Running in virtualization should help if you can tell your preferred stack to allocate less threads or cores, but I would question your main assumption that these are the critical bottlenecks for making your simulations valuable.

Why not let the simulations run full speed and just measure where the bottlenecks on the Mac arise. You can measure VM paging, IO statistics and time to run each job on your mac and then run a similar test on the production hardware.

If the code is 2 to 1 faster on the Mac and you don't have paging or IO contention, that should scale quite well to the measurements on the Linux hardware. I totally get the wish to control this and eliminate variables, but since systems need to be balanced everywhere - what is a bottleneck on one system / architecture is often not the same bottleneck on another.

share|improve this answer
2  
(and yes - if I figure out a way to change CPU speeds or knock out a CPU entirely, I'll update - anyone is free to edit away if they have any ideas for that sort of thing that more directly answers that aspect of the question.) Just wanted to say I wasn't withholding the goods on that front. –  bmike Mar 2 '12 at 20:41
    
A surprisingly satisfying answer, considering it didn't technically answer the question. I think I'll take your advice, and disable the cores (re: Scot's answer) if I want to get more fiddly after seeing the results. –  Dean Mar 3 '12 at 2:55
add comment

Within the Instruments application (part of Apple's Xcode developer tools), you can adjust the number of active processor cores, and/or turn off Hardware Multi-Threading.

Not sure how to best adjust the actual speed of the CPU...

share|improve this answer
    
Can you run a quota system deep down within the unix hood somewhere? I forget how it was done on Solaris, but you could set user quotas for memory, processes etc. –  stuffe Mar 2 '12 at 22:50
    
how can you disable a core via instruments? i couldn't find it after like 5 mins of messing with it lol –  XAleXOwnZX Mar 2 '12 at 23:11
1  
Also by opening /Developer/Extras/PreferencePanes/Processor.prefpane you can add a menu item to turn on/off CPUs. –  user588 Mar 3 '12 at 2:42
    
@XAlexOwnZX Preferences -> General -> Active Processor Cores –  Dean Mar 3 '12 at 2:50
    
oh lol i looked everywhere but the prefs :P –  XAleXOwnZX Mar 3 '12 at 18:09
add comment

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.