On Tue, Oct 27, 2020 at 8:42 AM Paul Gilmartin < [email protected]> wrote:
> On Tue, 27 Oct 2020 21:39:11 +1100, Andrew Rowley wrote: > > > >OMVS can produce a lot of SMF records. I did some testing on a short > >shell script, and 1000 iterations of a loop produced about 28,000 type > >30 records - around 200 records/second. The good news is that the > >records are likely small with very similar data, so the facilities to > >compress SMF data should handle it nicely. > > > >I wrote up the testing here, and it gives some idea of when separate > >address spaces are used and SMF records written: > > > https://www.blackhillsoftware.com/news/2019/08/27/comparing-bash-and-bin-sh-on-z-os/ > > > Interesting. > > But since OMVS manages address spaces by highwater mark, calling BPXAS > only when the level rises and reaping after 30 seconds (is this > configurable?) > I'd expect orders of magnitude fewer SMF 30 than you observed. > > Perhaps /bin/sh has more builtins than bash, and is otherwise tuned to > z/OS. > > It would be interesting to measure the effect of _BPX_SHAREAS. > > _BPX_SHAREAS won't have any effect on bash, since what _BPX_SHARE does is to tell spawn() to "local spawn" the new child process to the same address space. It doesn't change how fork() works, which is what bash uses. /bin/sh uses spawn() in some places instead of fork()/exec(), which is why _BPX_SHAREAS affects it. The impact of using local spawn() is more than just performance: local spawning child processes allows them to use DDs that are allocated in the parent. This is very nice if you are local-spawning /bin/sh in a batch job step, since the commands that you then run from the script can use the DDs allocated in the job step. The "set -o pipecurrent" setting in /bin/sh extends the cases where spawn is used and can assist with this. There's nothing to how spawn() and _BPX_SHAREAS work that isn't documented fully by IBM, except for exactly all the rules for when /bin/sh does a spawn(). bash should be changed to use spawn, but since the semantics are much different than fork()/exec(), this would be very difficult. This is a pity, since otherwise I would really like to use it with our Co:Z Unix/batch integration tools. PS> There's nothing wrong with using bash as your interactive shell and /bin/sh as a magic line in selected scripts and in batch. Kirk Wolf Dovetailed Technologies http://dovetail.com ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [email protected] with the message: INFO IBM-MAIN
