4

I sometimes need to run very long computations on my computer (usually using code I wrote myself, sometimes compiled, sometimes interpreted), which can take minutes, hours, or even days to complete. OS X Mavericks incorporates several features that are designed to minimize energy usage, such as App Nap and timer coalescing. If I were designing such a feature, I would be skeptical of a process that was still requesting maximum CPU usage after running for days; even if this process was started by a user action, that action was days ago. But as a user, I actually do want such computations to run to completion with high priority, even though they are usually running in the background.

Is there any possibility that my extended computations would be slowed down by the power-saving features of Mavericks?

4 Answers 4

2

According to the Apple Developer documentation (and Core Technologies Overview for Mavericks), App Nap can be opted out by either an Application developer or a user, but by default are active.

For a GUI application, the user can opt an application out of App Nap manually with a checkbox in the Finder “Get Info...” pane.

Timer Coalescing only becomes active when on battery power, so it should not affect your long running background processes.

Finally, you can check on the status of App Nap in the Activity Monitor. On the Energy Tab, there is a column describing App Nap status for each application, so if policies change, you can check actual status here.

enter image description here

2
  • Thanks for this informative and useful response. I note that in this screenshot, the Activity monitor is discussing "Applications" rather than "Processes." Is this just a different word for the same thing, or will I be unable to view processes like java or python? Nov 9, 2013 at 14:40
  • 1
    Java and python scripts should show up in the Energy tab, though you may need to dig down into the terminal Application to see these processes. For the purposes of the Activity Monitor, Applications can have multiple processes running within (e.g. BBEdit, Dropbox, Evernote & Forklift in the image above). You can view the processes of any of these applications by clicking the triangle to the left of the Application icon...
    – Scot
    Nov 11, 2013 at 5:32
2

Mavericks (10.9.2) interfers heavily with the on-going processes. Because it is designed for the average user, and not for the engineer running days long analyses.

I am a Matlab user, and using a MBP beast to analyze data on a daily basis. Sometimes these may take as long as few days. My experiences are as follows:

1/ App Nap doesn't interfere with my running analyses.

2/ Switching user accounts and then coming back to the account where the analyses are running heavily interferes with the processes. For example, when I have 5 Matlabs open and running analyses, switching to another user account leaving these analyses on the background has an impact on the performance. More interestingly, when I come back to the account where these analyses are running, the processes lose their priority. And using the "renice -20 PID" command cannot bring these processes to a higher priority level.

3/ I also observed that the lock screen also interferes with the running analyses. In such a way that after unlocking the screen I realized tgat the process priorities were different.

Best Practice so far:

When starting an analysis, never ever interrupt it until it finishes.

Proposed Solution:

Maverick Server, which is designed to run simultaneous processes in parallel, might be much better suited for such computational heavy user profiles. It is unfortunately not free...

0

Both technologies you list - App Nap and Timer Coalescing are basically opt-in features that need to be baked into an app.

Since you are crafting your own programs, at worst you'll have to make sure your framework and code doesn't enable these features. At best, nothing will change and you can expect the computations to run on a system that's intentionally throttling programs that have volunteered for less CPU when they are idle and see a speedup without needing to change anything.

4
  • bmike - as I understand it, both App Nap and Timer Coalescing are default behaviors. You can deactivate App Nap in the About Box for a GUI app, and it is inactive for a command-line application. Timer Coalescing is only active when on battery power. Do you have a reference for the opt-in nature you describe above?
    – Scot
    Nov 8, 2013 at 23:12
  • The trouble here is that I'm not actually designing my own apps; I'm writing code that is run from inside other applications, like Eclipse or Aquamacs. Sometimes I call the code from the command line, but it's always prefaced by the actual executable, which is something like java or Python. Nov 9, 2013 at 1:19
  • @CharlesStaats since you didn't put any of that detail in the question why not let this question be about high level how the features work. Then if you have a specific script and specific program (python version x.y.z) you could ask that as well as a separate question. You could also edit this question with those details
    – bmike
    Nov 9, 2013 at 14:12
  • I'm not asking about specific scripts--most of the languages I use are quite domain-specific (e.g., Macaulay2, which is for computations in commutative algebra), and I suspect will have few if any other users here. A rule of thumb is that all the code I write would work just as well under Linux; if your experience is with Apple-specific code, it's probably not relevant. Nov 9, 2013 at 14:35
0

Yes. To my experience it does!!

I have as well long computations that may last hours or days. If I switch user accounts, while one of the accounts has, say 5 processes that are doing analyses in parallel, their priority gets demoted.

More importantly, when I come back to the analysis account where these 5 processes are running, I can never get them back to full power again.

This is highly annoying.

See for example the figure, 5 analysis-related processes are using only 27% of the CPU, whereas before I loged out to another account, they were using nearly 90% (the other figure)... I cannot promote them to higher priority and I this costs me a lot of time of course.

enter image description here

enter image description here

After this logout/login cycle I am not able to bring these 5 processes to the same level of resource consumption. (renice'ing has no effect whatsoever).

This is independent than App Nap as it is turned off.

4
  • This isn't an answer, is it?
    – Rob
    Apr 1, 2014 at 12:27
  • admittedly this is not a solid scientific answer... I show that I am observing the same symptoms, and present the results of my tests, which are somehow answering the question stated on the last sentence without giving any mechanistic explanation, which Charles is not asking for anyway...
    – bonobo
    Apr 1, 2014 at 16:06
  • and honestly it's much more relevant than the other "answers"...
    – bonobo
    Apr 1, 2014 at 16:48
  • helpful discussion: discussions.apple.com/thread/6050740?start=0&tstart=0
    – bonobo
    Apr 2, 2014 at 16:01

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .