Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > uk.comp.sys.mac > #137087 > unrolled thread

Remote communications by programs that don't have focus

Started byTim Streater <timstreater@greenbee.net>
First post2019-11-13 10:34 +0000
Last post2019-11-13 23:45 +0000
Articles 11 — 4 participants

Back to article view | Back to uk.comp.sys.mac


Contents

  Remote communications by programs that don't have focus Tim Streater <timstreater@greenbee.net> - 2019-11-13 10:34 +0000
    Re: Remote communications by programs that don't have focus Jaimie Vandenbergh <jaimie@sometimes.sessile.org> - 2019-11-13 12:55 +0000
      Re: Remote communications by programs that don't have focus Jaimie Vandenbergh <jaimie@sometimes.sessile.org> - 2019-11-13 13:02 +0000
        Re: Remote communications by programs that don't have focus Tim Streater <timstreater@greenbee.net> - 2019-11-13 13:09 +0000
          Re: Remote communications by programs that don't have focus Jaimie Vandenbergh <jaimie@sometimes.sessile.org> - 2019-11-13 13:10 +0000
            Re: Remote communications by programs that don't have focus Tim Streater <timstreater@greenbee.net> - 2019-11-13 15:02 +0000
              Re: Remote communications by programs that don't have focus Jaimie Vandenbergh <jaimie@sometimes.sessile.org> - 2019-11-13 16:05 +0000
                Re: Remote communications by programs that don't have focus Barry Margolin <barmar@alum.mit.edu> - 2019-11-13 15:55 -0500
                  Re: Remote communications by programs that don't have focus Jaimie Vandenbergh <jaimie@sometimes.sessile.org> - 2019-11-13 21:44 +0000
      Re: Remote communications by programs that don't have focus Tim Streater <timstreater@greenbee.net> - 2019-11-13 13:08 +0000
    Re: Remote communications by programs that don't have focus Lewis <g.kreme@gmail.com.dontsendmecopies> - 2019-11-13 23:45 +0000

#137087 — Remote communications by programs that don't have focus

FromTim Streater <timstreater@greenbee.net>
Date2019-11-13 10:34 +0000
SubjectRemote communications by programs that don't have focus
Message-ID<131120191034137906%timstreater@greenbee.net>
Any piece of software that we use can be in various states as far as
the UI is concerned. Roughly:

1) It can have focus (i.e. is showing its menu bar at the moment)
2) It can have focus but the user has minimised it (its one window is
in the Dock)
3) It can still be showing a window but some other app has focus
4) As (3) but its window(s) are in the Dock
5) The user may have hidden it
6) It may be on a different Desktop entirely

What I'd like to know is whether an app in any state other than (1)
above has equal rights to resources for CPU and for doing I/O to remote
hosts. I'm wondering because I have some software that, when it is in
states (3), (4) and (6) (and possibly others, I'm still testing) seems
at a minimum to lose contact with remote hosts or its timers don't
work.

This is under Mojave 10.14.6, and I'm also wondering whether this
possible tendency seemingly to starve "background" apps of resources
has become stronger in more recent versions of macOS. I'm sure I didn't
see this under Mavericks.

This machine is very lightly loaded so it's not a general resource
issue.

Comments?

-- 
Tim.

[toc] | [next] | [standalone]


#137093

FromJaimie Vandenbergh <jaimie@sometimes.sessile.org>
Date2019-11-13 12:55 +0000
Message-ID<bsunse1jvktds7o7gc7lc6ils4it3jr47e@4ax.com>
In reply to#137087
On Wed, 13 Nov 2019 10:34:13 +0000, Tim Streater
<timstreater@greenbee.net> wrote:

>Any piece of software that we use can be in various states as far as
>the UI is concerned. Roughly:
>
>1) It can have focus (i.e. is showing its menu bar at the moment)
>2) It can have focus but the user has minimised it (its one window is
>in the Dock)
>3) It can still be showing a window but some other app has focus
>4) As (3) but its window(s) are in the Dock
>5) The user may have hidden it
>6) It may be on a different Desktop entirely
>
>What I'd like to know is whether an app in any state other than (1)
>above has equal rights to resources for CPU and for doing I/O to remote
>hosts. I'm wondering because I have some software that, when it is in
>states (3), (4) and (6) (and possibly others, I'm still testing) seems
>at a minimum to lose contact with remote hosts or its timers don't
>work.

AFAIK the only quiescing mechanism macOS would apply without
collaboration from the app is App Nap. You can see whether that state is
applying in Activity Monitor, Energy tab.

"By default, your app becomes eligible for App Nap if it’s not actively
engaged with the user and hasn’t updated a visible window for some
length of time." Overview at
https://developer.apple.com/library/archive/documentation/Performance/Conceptual/power_efficiency_guidelines_osx/AppNap.html#//apple_ref/doc/uid/TP40013929-CH2-SW1

Try disabling it and see if that helps - 
defaults write NSGlobalDomain NSAppSleepDisabled -bool YES
and a reboot. 

Apps can be written to not allow themselves to be Napped when performing
actions, so this may be a code fix needed. Some tips at 
https://developer.apple.com/library/archive/documentation/Performance/Conceptual/power_efficiency_guidelines_osx/PrioritizeWorkAtTheAppLevel.html#//apple_ref/doc/uid/TP40013929-CH36-SW1

	Cheers - Jaimie
-- 
Actually, the Singularity seems rather useful in the entire work avoidance
field. "I _could_ write up that report now but if I put it off, I may well 
become a weakly godlike entity, at which point not only will I be able to 
type faster but my comments will be more on-target."        - James Nicoll

[toc] | [prev] | [next] | [standalone]


#137095

FromJaimie Vandenbergh <jaimie@sometimes.sessile.org>
Date2019-11-13 13:02 +0000
Message-ID<ijvnse5rhhsbj0g85h00jf2h3g0sjfm1dq@4ax.com>
In reply to#137093
On Wed, 13 Nov 2019 12:55:42 +0000, Jaimie Vandenbergh
<jaimie@sometimes.sessile.org> wrote:

>On Wed, 13 Nov 2019 10:34:13 +0000, Tim Streater
><timstreater@greenbee.net> wrote:
>
>>Any piece of software that we use can be in various states as far as
>>the UI is concerned. Roughly:
>>
>>1) It can have focus (i.e. is showing its menu bar at the moment)
>>2) It can have focus but the user has minimised it (its one window is
>>in the Dock)
>>3) It can still be showing a window but some other app has focus
>>4) As (3) but its window(s) are in the Dock
>>5) The user may have hidden it
>>6) It may be on a different Desktop entirely
>>
>>What I'd like to know is whether an app in any state other than (1)
>>above has equal rights to resources for CPU and for doing I/O to remote
>>hosts. I'm wondering because I have some software that, when it is in
>>states (3), (4) and (6) (and possibly others, I'm still testing) seems
>>at a minimum to lose contact with remote hosts or its timers don't
>>work.
>
>AFAIK the only quiescing mechanism macOS would apply without
>collaboration from the app is App Nap. You can see whether that state is
>applying in Activity Monitor, Energy tab.
>
>"By default, your app becomes eligible for App Nap if it’s not actively
>engaged with the user and hasn’t updated a visible window for some
>length of time." Overview at
>https://developer.apple.com/library/archive/documentation/Performance/Conceptual/power_efficiency_guidelines_osx/AppNap.html#//apple_ref/doc/uid/TP40013929-CH2-SW1
>
>Try disabling it and see if that helps - 
>defaults write NSGlobalDomain NSAppSleepDisabled -bool YES
>and a reboot. 

Aha - you can disable for one app if you know its domain name, so: 
defaults write {app.domain.name} NSAppSleepDisabled -bool YES

(and then to remove your NSGlobal one from earlier if you did that,
defaults delete NSGlobalDomain NSAppSleepDisabled 
)

	Cheers - Jaimie
-- 
I was most impressed when I looked up into the London sky and saw 
a star through all the light pollution.  A few of us checked some 
astronomy references to try and identify it, and we're reasonably 
confident that it was Sol.                  -- Peter Corlett, asr

[toc] | [prev] | [next] | [standalone]


#137097

FromTim Streater <timstreater@greenbee.net>
Date2019-11-13 13:09 +0000
Message-ID<131120191309550150%timstreater@greenbee.net>
In reply to#137095
In article <ijvnse5rhhsbj0g85h00jf2h3g0sjfm1dq@4ax.com>, Jaimie
Vandenbergh <jaimie@sometimes.sessile.org> wrote:

>Aha - you can disable for one app if you know its domain name, so: 
>defaults write {app.domain.name} NSAppSleepDisabled -bool YES

Um, is this the same as its bundle identifier?

-- 
"The EU Customs Union is a racket that defends producers in rich countries
against producers in poor countries."

Jacob Rees-Mogg MP

[toc] | [prev] | [next] | [standalone]


#137098

FromJaimie Vandenbergh <jaimie@sometimes.sessile.org>
Date2019-11-13 13:10 +0000
Message-ID<v50ose5svq8ufm4pjl35e2869390bcl6ik@4ax.com>
In reply to#137097
On Wed, 13 Nov 2019 13:09:55 +0000, Tim Streater
<timstreater@greenbee.net> wrote:

>In article <ijvnse5rhhsbj0g85h00jf2h3g0sjfm1dq@4ax.com>, Jaimie
>Vandenbergh <jaimie@sometimes.sessile.org> wrote:
>
>>Aha - you can disable for one app if you know its domain name, so: 
>>defaults write {app.domain.name} NSAppSleepDisabled -bool YES
>
>Um, is this the same as its bundle identifier?

I think so - I'm well rusty on this stuff though, it was a decade ago
that I last played with it.

	Cheers - Jaimie
-- 
There's no place like 127.0.0.1

[toc] | [prev] | [next] | [standalone]


#137100

FromTim Streater <timstreater@greenbee.net>
Date2019-11-13 15:02 +0000
Message-ID<131120191502220918%timstreater@greenbee.net>
In reply to#137098
In article <v50ose5svq8ufm4pjl35e2869390bcl6ik@4ax.com>, Jaimie
Vandenbergh <jaimie@sometimes.sessile.org> wrote:

>On Wed, 13 Nov 2019 13:09:55 +0000, Tim Streater
><timstreater@greenbee.net> wrote:
>
>>In article <ijvnse5rhhsbj0g85h00jf2h3g0sjfm1dq@4ax.com>, Jaimie
>>Vandenbergh <jaimie@sometimes.sessile.org> wrote:
>>
>>>Aha - you can disable for one app if you know its domain name, so: 
>>>defaults write {app.domain.name} NSAppSleepDisabled -bool YES
>>
>>Um, is this the same as its bundle identifier?
>
>I think so - I'm well rusty on this stuff though, it was a decade ago
>that I last played with it.

Preventing app nap appears to help a lot.

And, even better, I found a class I can include in my app which, when
instantiated, will prevent app nap for the app (it can do a few other
things as well). It came with a test app that allowed me to verify that
it works (using Activity Monitor). This class is written by a guy who
has created an app which will allow one to code-sign and notarise
applications. Seriously useful.

Thanks for pointing me in the right direction.

-- 
The truth of the matter is that we Scots have always been more divided amongst
ourselves than pitted against the English. Scottish history before the Union of
Parliaments is a gloomy, violent tale of murders, feuds, and tribal revenge.
Only after the Act of Union did Highlanders and Lowlanders, Picts and Celts,
begin to recognise one another as fellow citizens.

Tam Dalyell

[toc] | [prev] | [next] | [standalone]


#137102

FromJaimie Vandenbergh <jaimie@sometimes.sessile.org>
Date2019-11-13 16:05 +0000
Message-ID<3eaose54hc0ml77j31a9ua0mqhnduiu2c6@4ax.com>
In reply to#137100
On Wed, 13 Nov 2019 15:02:22 +0000, Tim Streater
<timstreater@greenbee.net> wrote:

>In article <v50ose5svq8ufm4pjl35e2869390bcl6ik@4ax.com>, Jaimie
>Vandenbergh <jaimie@sometimes.sessile.org> wrote:
>
>>On Wed, 13 Nov 2019 13:09:55 +0000, Tim Streater
>><timstreater@greenbee.net> wrote:
>>
>>>In article <ijvnse5rhhsbj0g85h00jf2h3g0sjfm1dq@4ax.com>, Jaimie
>>>Vandenbergh <jaimie@sometimes.sessile.org> wrote:
>>>
>>>>Aha - you can disable for one app if you know its domain name, so: 
>>>>defaults write {app.domain.name} NSAppSleepDisabled -bool YES
>>>
>>>Um, is this the same as its bundle identifier?
>>
>>I think so - I'm well rusty on this stuff though, it was a decade ago
>>that I last played with it.
>
>Preventing app nap appears to help a lot.
>
>And, even better, I found a class I can include in my app which, when
>instantiated, will prevent app nap for the app (it can do a few other
>things as well). It came with a test app that allowed me to verify that
>it works (using Activity Monitor). This class is written by a guy who
>has created an app which will allow one to code-sign and notarise
>applications. Seriously useful.
>
>Thanks for pointing me in the right direction.

De nada. Have fun!

	Cheers - Jaimie
-- 
Cartography: 
The fine art of loading cars into ballistas and flinging them into walls
                                  -- http://www.bunny-comic.com/586.html

[toc] | [prev] | [next] | [standalone]


#137121

FromBarry Margolin <barmar@alum.mit.edu>
Date2019-11-13 15:55 -0500
Message-ID<barmar-FA9358.15551913112019@reader.eternal-september.org>
In reply to#137102
In article <3eaose54hc0ml77j31a9ua0mqhnduiu2c6@4ax.com>,
 Jaimie Vandenbergh <jaimie@sometimes.sessile.org> wrote:

> >Thanks for pointing me in the right direction.
> 
> De nada. Have fun!

Did I just wander into the Bizarro version of this newsgroup? Did we 
actually help someone without anyone hurling epithets along the way?

-- 
Barry Margolin
Arlington, MA

[toc] | [prev] | [next] | [standalone]


#137126

FromJaimie Vandenbergh <jaimie@sometimes.sessile.org>
Date2019-11-13 21:44 +0000
Message-ID<h9uoselap00kkll5tdep8b1c5vnk6249cm@4ax.com>
In reply to#137121
On Wed, 13 Nov 2019 15:55:19 -0500, Barry Margolin <barmar@alum.mit.edu>
wrote:

>In article <3eaose54hc0ml77j31a9ua0mqhnduiu2c6@4ax.com>,
> Jaimie Vandenbergh <jaimie@sometimes.sessile.org> wrote:
>
>> >Thanks for pointing me in the right direction.
>> 
>> De nada. Have fun!
>
>Did I just wander into the Bizarro version of this newsgroup? Did we 
>actually help someone without anyone hurling epithets along the way?

Yeah, sorry about that. We're from uk.comp.sys.mac, we do things
differently over here.

Um. Fuck?

	Cheers - Jaimie
-- 
Cartography: 
The fine art of loading cars into ballistas and flinging them into walls
                                  -- http://www.bunny-comic.com/586.html

[toc] | [prev] | [next] | [standalone]


#137096

FromTim Streater <timstreater@greenbee.net>
Date2019-11-13 13:08 +0000
Message-ID<131120191308093820%timstreater@greenbee.net>
In reply to#137093
In article <bsunse1jvktds7o7gc7lc6ils4it3jr47e@4ax.com>, Jaimie
Vandenbergh <jaimie@sometimes.sessile.org> wrote:

>>What I'd like to know is whether an app in any state other than (1)
>>above has equal rights to resources for CPU and for doing I/O to remote
>>hosts. I'm wondering because I have some software that, when it is in
>>states (3), (4) and (6) (and possibly others, I'm still testing) seems
>>at a minimum to lose contact with remote hosts or its timers don't
>>work.
>
>AFAIK the only quiescing mechanism macOS would apply without
>collaboration from the app is App Nap. You can see whether that state is
>applying in Activity Monitor, Energy tab.
>
>"By default, your app becomes eligible for App Nap if it’s not actively
>engaged with the user and hasn’t updated a visible window for some
>length of time." Overview at
>https://developer.apple.com/library/archive/documentation/Performance/Conceptua
>l/power_efficiency_guidelines_osx/AppNap.html#//apple_ref/doc/uid/TP40013929-CH
>2-SW1
>
>Try disabling it and see if that helps - 
>defaults write NSGlobalDomain NSAppSleepDisabled -bool YES
>and a reboot. 

Blimey - thanks. Testing now.

-- 
The truth of the matter is that we Scots have always been more divided amongst
ourselves than pitted against the English. Scottish history before the Union of
Parliaments is a gloomy, violent tale of murders, feuds, and tribal revenge.
Only after the Act of Union did Highlanders and Lowlanders, Picts and Celts,
begin to recognise one another as fellow citizens.

Tam Dalyell

[toc] | [prev] | [next] | [standalone]


#137140

FromLewis <g.kreme@gmail.com.dontsendmecopies>
Date2019-11-13 23:45 +0000
Message-ID<slrnqsp5d2.2vhl.g.kreme@ProMini.lan>
In reply to#137087
In message <131120191034137906%timstreater@greenbee.net> Tim Streater <timstreater@greenbee.net> wrote:
> Any piece of software that we use can be in various states as far as
> the UI is concerned. Roughly:

> 1) It can have focus (i.e. is showing its menu bar at the moment)
> 2) It can have focus but the user has minimised it (its one window is
> in the Dock)
> 3) It can still be showing a window but some other app has focus
> 4) As (3) but its window(s) are in the Dock
> 5) The user may have hidden it
> 6) It may be on a different Desktop entirely

> What I'd like to know is whether an app in any state other than (1)
> above has equal rights to resources for CPU and for doing I/O to remote
> hosts. I'm wondering because I have some software that, when it is in
> states (3), (4) and (6) (and possibly others, I'm still testing) seems
> at a minimum to lose contact with remote hosts or its timers don't
> work.

Terminal keeps my connections to my servers for weeks at a time.

When I use rsync in terminal to trasnfer files, it does not slow down in
the background.

I'd guess if apps are slowing down or disconnecting when they are not
front-most they are either doing something wrong, or intentionally
fucking with you (like how YouTube stops playing on iOS if you swiatch
away from it).

What apps?

-- 
In my world there are people in chains and you can ride them like ponies

[toc] | [prev] | [standalone]


Back to top | Article view | uk.comp.sys.mac


csiph-web