diff options
author | Amy Fong <amy.fong@windriver.com> | 2014-03-28 15:58:45 -0400 |
---|---|---|
committer | Bruce Ashfield <bruce.ashfield@windriver.com> | 2014-03-31 13:14:49 -0400 |
commit | 02f129b1bb1fc17f17b2fbca43bd997aa8b28d09 (patch) | |
tree | a125ec774f2054684ddd364aeb6caceb8c1bf637 /meta-openstack/recipes-devtools/python/python-ceilometer | |
parent | 984c2d69f51824a4c1e7b3a448fe24759e594026 (diff) | |
download | meta-cloud-services-02f129b1bb1fc17f17b2fbca43bd997aa8b28d09.tar.gz |
Memory leak from timings
Memory leak happens when the dynamic list times grows without anything to
reset it.
In ceilometer and cinder configuration files, the new option is created:
[nova_client]
max_timing_buffer=<value>
In all clients found that uses extends the HTTPClient and uses the times
list, we limit the size of the list by popping off the oldest item in the
list to maintain a maximum size. A default size of 200 is chosen,
configurable by the above configuration option.
Signed-off-by: Amy Fong <amy.fong@windriver.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Diffstat (limited to 'meta-openstack/recipes-devtools/python/python-ceilometer')
-rw-r--r-- | meta-openstack/recipes-devtools/python/python-ceilometer/ceilometer.conf | 3 | ||||
-rw-r--r-- | meta-openstack/recipes-devtools/python/python-ceilometer/fix_ceilometer_memory_leak.patch | 27 |
2 files changed, 29 insertions, 1 deletions
diff --git a/meta-openstack/recipes-devtools/python/python-ceilometer/ceilometer.conf b/meta-openstack/recipes-devtools/python/python-ceilometer/ceilometer.conf index 4632f40..6340a15 100644 --- a/meta-openstack/recipes-devtools/python/python-ceilometer/ceilometer.conf +++ b/meta-openstack/recipes-devtools/python/python-ceilometer/ceilometer.conf | |||
@@ -868,4 +868,5 @@ admin_tenant_name=%SERVICE_TENANT_NAME% | |||
868 | # Password for Redis server. (optional) (string value) | 868 | # Password for Redis server. (optional) (string value) |
869 | #password=<None> | 869 | #password=<None> |
870 | 870 | ||
871 | 871 | # [nova_client] | |
872 | # max_timing_buffer=100 | ||
diff --git a/meta-openstack/recipes-devtools/python/python-ceilometer/fix_ceilometer_memory_leak.patch b/meta-openstack/recipes-devtools/python/python-ceilometer/fix_ceilometer_memory_leak.patch new file mode 100644 index 0000000..bdc1bf7 --- /dev/null +++ b/meta-openstack/recipes-devtools/python/python-ceilometer/fix_ceilometer_memory_leak.patch | |||
@@ -0,0 +1,27 @@ | |||
1 | --- | ||
2 | ceilometer/nova_client.py | 7 +++++++ | ||
3 | 1 file changed, 7 insertions(+) | ||
4 | |||
5 | --- a/ceilometer/nova_client.py | ||
6 | +++ b/ceilometer/nova_client.py | ||
7 | @@ -26,6 +26,12 @@ | ||
8 | |||
9 | LOG = log.getLogger(__name__) | ||
10 | |||
11 | +nova_client_opts = [ | ||
12 | + cfg.IntOpt('max_timing_buffer', | ||
13 | + default=200, | ||
14 | + help='The max number of the timing objects to keep'), | ||
15 | +] | ||
16 | +cfg.CONF.register_opts(nova_client_opts, group="nova_client") | ||
17 | |||
18 | def logged(func): | ||
19 | |||
20 | @@ -56,6 +62,7 @@ | ||
21 | endpoint_type=conf.os_endpoint_type, | ||
22 | cacert=conf.os_cacert, | ||
23 | no_cache=True) | ||
24 | + self.nova_client.set_timings_max_len(cfg.CONF.nova_client.max_timing_buffer) | ||
25 | |||
26 | def _with_flavor_and_image(self, instances): | ||
27 | for instance in instances: | ||