Bug 1591647

Summary: Increase WSGI worker process count
Product: Red Hat Enterprise Linux 7 Reporter: Petr Vobornik <pvoborni>
Component: ipaAssignee: IPA Maintainers <ipa-maint>
Status: CLOSED ERRATA QA Contact: ipa-qe <ipa-qe>
Severity: high Docs Contact:
Priority: high    
Version: 7.4CC: cheimes, ksiddiqu, myusuf, ndehadra, pasik, pvoborni, rcritten, tbordaz, tdudlak, tscherf
Target Milestone: rcKeywords: ZStream
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: ipa-4.6.4-5.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1623680 (view as bug list) Environment:
Last Closed: 2018-10-30 10:58:39 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1623680    

Description Petr Vobornik 2018-06-15 08:18:30 UTC
Cloned from upstream: https://pagure.io/freeipa/issue/7587

WSGI daemon process count is currently limited to two single-threaded processes. IPA requires single threaded WSGI workers, because IPA uses GSSAPI authentication. Two daemon processes means that the IPA RCP can only handle two requests at a time. This can be too low for a busy server.

On a 64bit system with Python 3.6, each WSGI worker process consumes about 100-110 MB resident memory. Since ``mod_wsgi`` preforks the workers, about 30-35 MB memory of the 110 MB RSS are shared across workers. Increasing the worker count from 2 to 5 means, IPA RPC consumes about 200 to 250 MB additional memory.

Comment 2 Petr Vobornik 2018-06-15 08:20:00 UTC
Upstream ticket:
https://pagure.io/freeipa/issue/7587

Comment 9 Petr Vobornik 2018-06-22 12:22:16 UTC
fixed upstream.

master:
    f1d5ab3 Increase WSGI process count to 5 on 64bit
ipa-4-6:
    db8e0e6 Increase WSGI process count to 5 on 64bit

4.5 backport is still in-progress: https://github.com/freeipa/freeipa/pull/2030

Comment 11 Christian Heimes 2018-06-26 06:12:29 UTC
4.5 backport has landed in 4.5.

I decided to decrease to 4 WSGI workers again. Our CI infrastructure has limited RAM. Sometimes the increased worker count triggered OOM killer. 4 workers are fine.

Comment 14 Mohammad Rizwan 2018-07-20 09:57:02 UTC
version:
ipa-server-common-4.6.4-2.el7.noarch
ipa-server-4.6.4-2.el7.x86_64
ipa-server-dns-4.6.4-2.el7.noarch

Actual result:
[root@master ~]# cat /etc/httpd/conf.d/ipa.conf | grep processes
WSGIDaemonProcess ipa processes=5 threads=1 maximum-requests=500 \

[root@master ~]# ps ax | grep wsgi:ipa | grep -v grep | wc -l
5

According to comment#13 and [1] it should be 4. Changes not seems to be reflected properly (i.e from 5 WSGI workers to 4 WSGI workers).

Hence based on above observation, making the state of bug to assigned.

[1] https://pagure.io/freeipa/issue/7587#comment-518367

Comment 15 Rob Crittenden 2018-07-26 02:00:42 UTC
An additional upstream patch is needed to set the number of processes to 4:

ipa-4-6: f98b6e18ebcfe9edd475833d636600fc1758fda3

Comment 17 Mohammad Rizwan 2018-08-13 12:52:50 UTC
version:
ipa-server-4.6.4-5.el7.x86_64

Actual result:
[root@master ~]#  cat /etc/httpd/conf.d/ipa.conf | grep processes
WSGIDaemonProcess ipa processes=4 threads=1 maximum-requests=500 \
[root@master ~]# 
[root@master ~]# ps ax | grep wsgi:ipa | grep -v grep | wc -l
4


Based in observations, marking the bug verified.

Comment 22 errata-xmlrpc 2018-10-30 10:58:39 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2018:3187