19

I'm looking for a way to throttle up a macOS application or a process, specifically photoanalysisd. Ideally a Terminal command that would enable it to use all resources to the point, where any other app opened would slow down to a crawl.

Is that at all possible?

2

2 Answers 2

19

Possible duplicate to this superuser question.

However, you may want to read this article.

Here is the gist you really need to do:

  1. Make sure that no malware is running / slowing down your mac.
  2. In Terminal, identify running processes: ps -ef
  3. Make sure to close any unneeded resource intensive applications and processes, e.g. check the CPU, Memory, Disk usage at least with Activity Monitor.
  4. nice (if just launching) or renice (if already running) the desired app, e.g. 'photoanalysisd' to maximum. In Terminal: renice -n "-20" -p (put PID of 'photoanalysisd' here)
  5. renice everything else you still need to be running to minimum. In Terminal: renice -n "20" -p (put PID of process you need to de-prioritize here)

NOTE that the:

  • Max (Requested) Priority = -20 (Minimal value)
  • Min (Requested) Priority = +20 (Maximal value)

that may be a bit confusing.


If all of above fails to produce enough improvement, the following upgrades may be a cost effective solution, if available for your mac:

1) Switch your HDD or slower SSD to an SSD with the the maximum Link Speed that your mac system supports. (Prior to this, if possible, add a fastest available interface to your system.) The current numbers can be viewed in the System Information app's Hardware > PCI | SATA/SATA Express tabs, as well as other tabs relevant interfaces your system actually has installed. The supported speeds may be available on your system's Apple support page, although they may be lower than the factual, since Apple may not update support pages when, for example, a firmware update adds support for a faster interface that was not supported by the original.

2) Max out your RAM. Again, the supported RAM amount may be available on your system's Apple System's support page, although it may be lower than the factual, since Apple is known to me to not update these when for example a larger single RAM unit becomes available than at inception. For example a 2010 Mac Mini supports 16 GB of RAM (2 x 8 GB), while according to the Apple support page it only supports 8 GB total. I would suggest you research this further on user forums for your system.

Apple systems, other than notebooks, tend to be sold with a big upgrade-ability. So if you max out the above two factors, you may increase the responsiveness of your system from crawl to excellent easily. (e.g.: RAM 2 GB -> 16 GB + SATA HDD -> SATA 2 SSD = 2nd life)

(For the few Apple systems that allow GPU upgrades, proceed similar to item 1) above)

2
  • Not sure how the second part of your answer relates to the question?
    – nohillside
    Commented Sep 19, 2019 at 18:30
  • 2
    the correct answer is to use renice, everything else is not relevant to the question
    – Fnord
    Commented Jan 29, 2021 at 2:56
7

A very easy way to change the priority is via htop. It provides the [F7]Nice - and [F8]Nice + commands at the bottom of the Terminal.app window. The buttons can be accessed either via Mouse or via Function-Keys.

It also shows a column NI with the current nice-value.

Running sudo htop may be required in order to be able to change the nice-value.

As mentioned by @jksoegaard, htop is not part of the standard installation, but if you happen to have it installed, it also helps with changing priorities! To install, i suggest homebrew via brew install htop. Note that homebrew is also not part of the standard installation, but can easily be installed via http://brew.sh)

3
  • You should probably mention that htop is not a program that comes with macOS, but has to installed from a third-party.
    – jksoegaard
    Commented Apr 7, 2022 at 15:19
  • 1
    the htop task-manager (CLI+TUI based) tool can also be loaded with MacPorts package-manager in macOS, via: sudo port install htop
    – atErik
    Commented Jan 28, 2023 at 0:36
  • Similar to MacPorts, htop is also available via Homebrew
    – Ed Mechem
    Commented Aug 10, 2023 at 7:39

You must log in to answer this question.

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