Bug 1372821

Summary: Gnocchi API processes tuned to 1 with cpu_count for threads out of box
Product: Red Hat OpenStack Reporter: Alex Krzos <akrzos>
Component: openstack-puppet-modulesAssignee: Pradeep Kilambi <pkilambi>
Status: CLOSED ERRATA QA Contact: Mehdi ABAAKOUK <mabaakou>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 10.0 (Newton)CC: dnavale, fbaudin, mabaakou, mburns, rhel-osp-director-maint, srevivo
Target Milestone: rcKeywords: Triaged
Target Release: 10.0 (Newton)   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: openstack-puppet-modules-9.0.0-0.20160915155755.8c758d6.el7ost Doc Type: Bug Fix
Doc Text:
Previously, the Time Series Database-as-a-Service (gnocchi) API workers were configured to be deployed be default with a single process and logical cpu_core count for threads, resulting in the gnocchi API running in httpd to be deployed with a single process. As a best practice, gnocchi recommends the number of process and threads to be 1.5 * cpu_count. With this update, the worker count is max(($::processorcount + 0)/4, 2) and threads to 1. As a result, the gnocchi API workers run with the right number of workers and threads for better performance.
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-12-14 15:56:34 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Alex Krzos 2016-09-02 19:09:38 UTC
Description of problem:
Deployed OSP10 from OSPd 10 and Gnocchi api workers running in httpd are deployed with a single process and logical cpu_core count for threads.

Gnocchi best practices in Gnocchi documentation recommends number of processes and threads to be 1.5 x cpu_core count - http://gnocchi.xyz/running.html?highlight=api

Analyzing high instance count environments with Gnocchi has shown the Gnocchi-api httpd process consumes only a single core.

Version-Release number of selected component (if applicable):
Builds 2016-08-30.1


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

[root@overcloud-controller-0 ~]# ps afx -F | grep "[Gg]nocchi"
gnocchi  10163 10160  0 625576 80700 15 18:16 ?        Sl     0:01  \_ /usr/sbin/httpd -DFOREGROUND
[root@overcloud-controller-0 ~]# cat /proc/10163/status | grep "Threads"
Threads:        35 
[root@overcloud-controller-0 ~]# grep "thread" /etc/httpd/conf.d/10-gnocchi_wsgi.conf 
  WSGIDaemonProcess gnocchi group=gnocchi processes=1 threads=24 user=gnocchi


While we are at it, can we name the processes with "display-name=gnocchi-api", similar to how Keystone's processes for main/admin api are?

Aodh also runs in mod_wsgi and is configured the same as Gnocchi, this may also require tuning for environments that rely heavily on the Aodh api.

Lastly, we should take into account the number of additional database connections Gnocchi will consume as we now have another service connecting to mysql.

Comment 4 Mehdi ABAAKOUK 2016-10-20 08:19:57 UTC
On fresh install, the configuration have indead changed.

# grep WSGIDaemonProcess /etc/httpd/conf.d/10-gnocchi_wsgi.conf
  WSGIDaemonProcess gnocchi group=gnocchi processes=2 threads=1 user=gnocchi

# ps afx -F | grep "[Gg]nocchi" | grep httpd
gnocchi   9367  9358  0 232249 101156 0 07:51 ?        Sl     0:03  \_ /usr/sbin/httpd -DFOREGROUND
gnocchi   9368  9358  0 232249 100376 0 07:51 ?        Sl     0:03  \_ /usr/sbin/httpd -DFOREGROUND
# cat /proc/9367/status | grep "Threads"
Threads:	5
# cat /proc/9368/status | grep "Threads"
Threads:	5

The new number of threads is OK

Comment 6 errata-xmlrpc 2016-12-14 15:56:34 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://rhn.redhat.com/errata/RHEA-2016-2948.html