Bug 52294 - Define __slots__ for state objects in UMC-Server components
Define __slots__ for state objects in UMC-Server components
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: UMC (Generic)
UCS 4.4
Other Linux
: P5 normal (vote)
: UCS 4.4-6-errata
Assigned To: Florian Best
Dirk Wiesenthal
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2020-11-02 12:53 CET by Florian Best
Modified: 2020-11-04 14:49 CET (History)
1 user (show)

See Also:
What kind of report is it?: Development Internal
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional): Large environments, UCS Performance
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Florian Best univentionstaff 2020-11-02 12:53:16 CET
As UMC might contain multiple thousands opened sessions we should increase the size of all objects stored in the session.

This can be achieved by adding __slots__ to those classes, which then doesn't store a dictionary per object.

See https://docs.python.org/2/reference/datamodel.html#slots.
Comment 1 Florian Best univentionstaff 2020-11-02 13:04:56 CET
__slots__ have been added in every relevant object we control.

univention-management-console.yaml
9adffdd185ab | YAML Bug #52294

univention-management-console (11.0.5-7)
893ba879b498 | Bug #52294: add __slots__ to session objects
Comment 2 Dirk Wiesenthal univentionstaff 2020-11-02 17:16:21 CET
OK

python-memory-profile:

86.9 MiB   	a = [State(None, None) for x in range(10000)]
vs
96.9 MiBa = [State(None, None) for x in range(10000)]
Comment 3 Dirk Wiesenthal univentionstaff 2020-11-02 17:17:44 CET
Sorry. Clicked too early.

YAML: OK
Code: OK (No attributes other than the __slots__ are accessed AFAICS)
Profile: Reduced (see comment above)