Project

General

Profile

Actions

Feature #13471

closed

zoneadmd should infer zone.max-processes

Added by Andy Fiddaman 11 months ago. Updated 10 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
zones
Start date:
Due date:
% Done:

100%

Estimated time:
Difficulty:
Bite-size
Tags:
Gerrit CR:

Description

This is an upstream of https://smartos.org/bugview/OS-5292, work by Jerry Jelinek

Presently, if zone.max-processes is set but zone.max-lwps isn't, zoneadmd will calculate a "reasonable" default foe zone.max-lwps. The reverse should be done when max-lwps is set and max-processes is not. This would prevent certain negative behaviors such as a broken app accumulating thousands (perhaps millions) unreaped zombies.
Actions #1

Updated by Electric Monk 10 months ago

  • Gerrit CR set to 1183
Actions #2

Updated by Andy Fiddaman 10 months ago

Tested by build and onu, then setting various resource controls on a zone, booting it and checking the output from prctl:

Setting max-process to 123456 causes max-lwps to be set to 1234560 (10x):

bloody# zadm show test max-processes
"123456" 
bloody# zadm boot test
bloody# prctl -n zone.max-processes `pgrep -n sshd`
process: 1606: /usr/sbin/sshd -D
NAME    PRIVILEGE       VALUE    FLAG   ACTION                       RECIPIENT
zone.max-processes
        usage              12
        privileged       123K       -   deny                                 -
        system          2.15G     max   deny                                 -
bloody# prctl -n zone.max-lwps `pgrep -n sshd`
process: 1606: /usr/sbin/sshd -D
NAME    PRIVILEGE       VALUE    FLAG   ACTION                       RECIPIENT
zone.max-lwps
        usage              12
        privileged      1.23M       -   deny                                 -
        system          2.15G     max   deny                                 -
bloody# zadm shutdown test

Setting max-lwps to 65536 causes max-processes to be set to the same:

bloody# zadm show test max-lwps
"65536" 
bloody# zadm boot test
bloody# prctl -n zone.max-processes `pgrep -n sshd`
process: 2051: /usr/sbin/sshd -D
NAME    PRIVILEGE       VALUE    FLAG   ACTION                       RECIPIENT
zone.max-processes
        usage               8
        privileged      65.5K       -   deny                                 -
        system          2.15G     max   deny                                 -
bloody# prctl -n zone.max-lwps `pgrep -n sshd`
process: 2051: /usr/sbin/sshd -D
NAME    PRIVILEGE       VALUE    FLAG   ACTION                       RECIPIENT
zone.max-lwps
        usage              11
        privileged      65.5K       -   deny                                 -
        system          2.15G     max   deny                                 -

Setting both works as expected:

bloody# zadm show test max-processes
"123456" 
bloody# zadm show test max-lwps
"65536" 
bloody# zadm boot test
bloody# prctl -n zone.max-processes `pgrep -n sshd`
process: 2401: /usr/sbin/sshd -D
NAME    PRIVILEGE       VALUE    FLAG   ACTION                       RECIPIENT
zone.max-processes
        usage               8
        privileged       123K       -   deny                                 -
        system          2.15G     max   deny                                 -
bloody# prctl -n zone.max-lwps `pgrep -n sshd`
process: 2401: /usr/sbin/sshd -D
NAME    PRIVILEGE       VALUE    FLAG   ACTION                       RECIPIENT
zone.max-lwps
        usage              11
        privileged      65.5K       -   deny                                 -
        system          2.15G     max   deny                                 -

Actions #3

Updated by Electric Monk 10 months ago

  • Status changed from In Progress to Closed
  • % Done changed from 0 to 100

git commit 3c2328bf3bf6527c6b28445336d32183a277b1e1

commit  3c2328bf3bf6527c6b28445336d32183a277b1e1
Author: Jerry Jelinek <jerry.jelinek@joyent.com>
Date:   2021-02-04T22:05:39.000Z

    13471 zoneadmd should infer zone.max-processes
    13472 Man pages missing the max-processes resource control
    Portions contributed by: Andy Fiddaman <andy@omnios.org>
    Reviewed by: C Fraire <cfraire@me.com>
    Reviewed by: Toomas Soome <tsoome@me.com>
    Approved by: Robert Mustacchi <rm@fingolfin.org>

Actions

Also available in: Atom PDF