Chapter 10. Tuning the WSGI processes
If you are seeing request failures due to long-running API processes, tuning the number of Web Server Gateway Interface (WSGI) processes can improve performance and allow more concurrent requests.
By default, IdM allocates 4 WSGI processes for the API service on 64-bit systems. This default limitation is implemented for memory conservation purposes. Any of the longer-running API endpoints can benefit from tuning, particularly in environments with high-volume automated operations.
For example, an OpenStack installation consists of several controllers containing multiple services. Each service requests a certificate so that all internal communication occurs over Transport Layer Security (TLS). When installing or refreshing multiple controllers or compute nodes simultaneously, the volume of certificate requests can become considerable. In such scenarios, increasing the number of WSGI processes allows the installation to complete successfully.
10.1. Adjusting the WSGI process count Copy linkLink copied to clipboard!
Adjust the number of Web Server Gateway Interface (WSGI) processes to handle more concurrent API requests in your IdM environment. Increasing WSGI processes improves performance for high-volume operations like certificate issuance, at the cost of increased memory consumption.
Prerequisites
-
You have
rootaccess to the IdM server.
Procedure
Open the
/etc/httpd/conf.d/ipa.conffile and modify theprocessesvalue in theWSGIDaemonProcessdirective:WSGIDaemonProcess ipa processes=<value> threads=1 maximum-requests=500 \
WSGIDaemonProcess ipa processes=<value> threads=1 maximum-requests=500 \Copy to Clipboard Copied! Toggle word wrap Toggle overflow By default, IdM uses 4 processes. You can increase this to handle more concurrent requests. The recommended maximum is 16 processes.
NoteEach WSGI process consumes approximately 100-110 MB of resident memory. With 16 processes, total memory consumption is approximately 1.3 GB.
Restart the Apache HTTP server to apply the changes:
systemctl restart httpd
[root@server ~]# systemctl restart httpdCopy to Clipboard Copied! Toggle word wrap Toggle overflow
10.2. Optimizing CPU usage for improved IPA server performance Copy linkLink copied to clipboard!
When encountering performance limitations during high-volume certificate issuance tasks, tuning the CPU and Web Server Gateway Interface (WSGI) process counts can significantly enhance an IPA server’s capability to handle simultaneous requests.
With a server configured with 4 CPUs and 70 clients requesting 7 certificates each (490 certificates in total), server timeouts occured as the request volume exceeded the server’s processing capacity.
Increasing the CPU count to 8 and matching the WSGI process count to 8 raised the certificate handling capacity to 630 certificates, a 28% increase over the 4 CPU configuration, despite a 100% increase in CPU count. Further increasing the CPU count to 16 showed no additional performance gains with only 8 WSGI processes. However, by increasing the WSGI process count to 16, the server processed 770 certificates with 110 clients, reflecting a 22% improvement over the 8 CPU setup.
On average, doubling the number of CPUs resulted in a 25% increase in certificate issuance capacity, as long as the WSGI processes were tuned accordingly. This emphasizes the need to scale both CPU and WSGI processes together to prevent bottlenecks and optimize server performance.