`
Hangdong.Zhang
  • 浏览: 15299 次
  • 性别: Icon_minigender_1
  • 来自: 西安
社区版块
存档分类
最新评论

对OpenStack内存使用情况的分析

阅读更多

对OpenStack内存使用情况的分析

作者:张航东

版本:Kilo

 

1. How many processes OpenStack hold?

In this chapter, the specs of OpenStack were 4U, 16G, just for example.


1.1 How to check the process number
At first, let’s use nova-api as an example, to explain how to check the process number.

nova-api has 1 main process, and 12 child processes. We can see them by the command:
[root@osc~]# ps -eo pid,ppid,uid,vsz,rss,args | grep nova

 
We can find out its starting function by the following steps. (So do other services)


 

In /nova/cmd/api.py

 
There are 3 parts in above codes.
1) “for” each “api” in CONF.enabled_apis. We can see there are 3 apis in the field in nova.conf, this mean all nova-api processes include 3 types of api (ec2, osapi_compute, metadata)

 
2) Server = service.WSGIService() initialize the server, and set workers which will define the number of each api. In nova/service.py:

 
The “worker” comes from “%s_workers” (ec2, osapi_compute, metadata) field in nova.conf. The value is as same as the number of CPUs available, and set by packstack when install OpenStack.


3) Launcher.launch_service(server, workers) start the child processes for each api, and the number of the processes are determined by the number of worker. In nova\openstack\common\service.py:

 

According to above analysis, we can summarize that:
nova-api process number = 1 (main process) + 4 (the number of CPUs) * ec2 api service + 4 * osapi service + 4 * metadata service = 13.

 

1.2     Controller
1.2.1     Nova


The formula of total processes is: 6 + 4 * CPUs

1.2.2     Neutron

 

 
The formula of total processes is: 1 + 2 * CPUs


1.2.3     Cinder


 
The formula of total processes is: 3 + 1 * CPUs + backend num


1.2.4     Keystone


 

PS: no child process when both of public_workers and admin_workers are 1, because of the following restraint: (In /keystone/server/eventlet.py)


The formula of total processes is: 1 + 2 * CPUs


1.2.5     Glance



The formula of total processes is: 2 + 2 * CPUs


1.2.6     Ceilometer



The formula of total processes is: 6 + 2 * CPUs (>1)


1.2.7     Httpd


Only 3 processes belong to OpenStack, and we can change it in “/etc/httpd/conf.d/15-horizon_vhost.conf”:

 
1.2.8     Others
And, there is only 1 process for each other backend services (mariadb, mongod, rabbitmq, redis, memcached).

1.3     Compute



In every compute node, each OpenStack service only holds 1 process.

 

2.     How much memory OpenStack consume?
According to the above analysis, we known the number of processes of each OpenStack service are decided by CPUs number in default.

So, this chapter, we will see the memroy consumption from each of them to all of controller.


2.1     Pre-testing
First of all, I wrote a script to get the maximum memory consumption while install OpenStack, and made some practices and get some conclusions.


Below show the point when most memeory consumed while install.


2.1.1     Case 1 - diff cpu, same memory
Installed 6 OpenStack environments with different CPU specs (4u/8u/16u/24u/36u/48u), and same memory specs (16g) . Then, got following datas from controller: 


Assumption 1: Memory consumption on controller will conspicuously increase with CPU number.

And, after installed, when I keep running “free” command on controller, I found the memory consumption would keep raising.


Assumption 2: Controller may need more memroy for running than installing

2.1.2     Case 2 - same cpu, diff memory
Installed 4 OpenStack environments with same CPU specs (16u), and different memory specs (8g/16g/32g/64g). Then, got following datas from controller:

 
Assumption 3: Memory consumption on controller will increase with memory too, but inconspicuously.


Assumption 4: If reinstall OpenStack after destroy, while install, it will need less memory than the first time.

2.1.3     Case 3 - diff number of compute nodes
Installed 5 OpenStack environments with same CPU specs (16u), same memory specs (16g), but different number of compute nodes (1/2/4/8/16).  Then, got following datas from controller:

 

Assumption 5: Memory consumption on controller will increase with the number of compute nodes.

2.1.4     Case 4 - diff capacities of compute nodes


 
Assumption 6: the memory consumption on compute are different under different capacities. and much less than total memory.

2.2     Consumption of each process
For the memory consumption of each process, does it affected by CPUs number or memory?
According to my verification. The answer is No.
 
2.2.1     Controller
The following table show the average memory consumption of each type of process.

 

 

 

 

 


The memory consumption of other services (httpd, mariadb, mongod, rabbitmq, redis, memcached) has less difference (<50M in total) between different VCUs number.

2.2.2     Compute

 


2.3     Consumption in theory (controller)
According to above datas. We can see, in different CPUs number, the difference of memory consumption is main decided by OpenStack processes (mark with green shade).
To summarize them, we can get a formula:
The difference of memory consumption (RSS) / CPU =
    (69180 + 123624 + 89988 + 83380) + (59652 + 56136) + (57648) + (77188 + 79476) + (60920 + 60432)
                            Nova                                    neutron            cinder           keystone                  glance
    ≈ 818 MB
This mean, if we install Opentack on the Host/VM which has one more CPU than another, in theory, it will consume more 818 MB memory.

But, in deed, the value in actual environment is much lesser than it.

2.4     Consumption in deed (controller)
I built an environment (16u/16u, 1 compute) and manually changed the “workers” in conf file to simulate different CPU number. And got the following “used” memeory 1 hour after restarted OpenStack service:


Then, we can see a smooth increasing line. And summarize:

 
The difference of memory consumption / CPU
    = ((13564544 - 12907380) + (12907380 - 12573920) + (12573920 - 11927552) + …… + (32315602432376)) / (2 * 23)
               48U            46U                46U             44U               44U             42U                            4U             2U
    = ((13564544 - 2432376) / (2 * 23)
                48U          2U
    ≈ 242 MB

  • 大小: 160.1 KB
  • 大小: 36.8 KB
  • 大小: 23.9 KB
  • 大小: 74.9 KB
  • 大小: 160.1 KB
  • 大小: 61.3 KB
  • 大小: 26.1 KB
  • 大小: 16.1 KB
  • 大小: 172.9 KB
  • 大小: 23.7 KB
  • 大小: 9.9 KB
  • 大小: 215.7 KB
  • 大小: 17.7 KB
  • 大小: 111.1 KB
  • 大小: 68.2 KB
  • 大小: 9.1 KB
  • 大小: 51.7 KB
  • 大小: 82.4 KB
  • 大小: 16 KB
  • 大小: 75.2 KB
  • 大小: 33.9 KB
  • 大小: 77.2 KB
  • 大小: 35.4 KB
  • 大小: 23 KB
  • 大小: 116.2 KB
  • 大小: 11.3 KB
  • 大小: 170 KB
  • 大小: 6.8 KB
  • 大小: 10.6 KB
  • 大小: 11 KB
  • 大小: 18.3 KB
  • 大小: 52.2 KB
  • 大小: 23.4 KB
  • 大小: 8.8 KB
  • 大小: 13.8 KB
  • 大小: 9.3 KB
  • 大小: 10.7 KB
  • 大小: 20.3 KB
  • 大小: 11.7 KB
  • 大小: 12.4 KB
  • 大小: 23.5 KB
分享到:
评论

相关推荐

    openstack nova源码分析

    在进行OpenStack Nova源码分析时,我们需要深入了解其架构、核心模块以及关键流程。 首先,Nova的整体架构基于服务模型,包括以下主要服务: 1. **nova-api**:API服务,对外提供RESTful API接口,用于与其他...

    OpenStack环境搭建ELK日志分析系统.zip

    在OpenStack环境中,Kibana可以帮助管理员监控整个平台的状态,快速识别异常行为,或者生成报告来理解服务的使用情况和性能指标。 搭建ELK日志分析系统在OpenStack中的步骤大致如下: 1. **安装和配置Elastic...

    用于监控OpenStack虚拟机,提供监测CPU、内存,使用flask和ajax和boostrap构建实时监控.zip

    首先,该项目的核心功能是监控OpenStack虚拟机的资源使用情况,包括CPU利用率、内存占用、网络接口流量以及磁盘I/O。这些指标对于评估虚拟机性能和健康状况至关重要。通过监控这些参数,管理员可以识别潜在的性能...

    Docker与OpenStack应用场景分析.docx

    Docker 依赖于 Linux 自带的 LXC(Linux Containers)技术,利用 Linux 可以对进程做内存、CPU、网络隔离的特性。Docker 镜像不需要新启动一个操作系统,因此提供了一种轻量级的打包和运行程序的方式。 OpenStack ...

    openstack动态迁移分析

    其中,虚拟机动态迁移是OpenStack的一个核心功能之一,它允许在不中断用户服务的情况下将运行中的虚拟机从一个物理主机迁移到另一个物理主机。 #### 二、动态迁移的重要性及应用场景 1. **提高资源利用率**:通过...

    OpenStack-原文.pdf

    OpenStack架构设计指南是针对那些希望充分利用OpenStack云平台优势的用户而编写的...这不仅是技术上的指导,也是对OpenStack生态系统和最佳实践的深入了解,对于任何计划使用OpenStack的人来说都是一份宝贵的参考资料。

    OpenStack之KVM优化经验实战

    本系列文章主要聚焦于如何对OpenStack上的KVM进行优化,以提升其运行效率和用户体验。我们将探讨三个关键主题:KVM的基础优化、KVM的性能优化以及KVM的网络优化。 首先,OpenStack之KVM优化(一)着重介绍基础优化...

    openstack Train 安装手册.rar

    OpenStack Train是...在使用OpenStack Train安装手册时,务必仔细阅读每个步骤,确保每一步都按照指南进行,以确保成功部署和运行OpenStack云环境。同时,保持与OpenStack社区的联系,获取最新的资讯和技术支持。

    基于OpenStack的分布式虚拟路由流量统计设计研究.pdf

    它提供了一个统一的数据收集和测量平台,可以捕获来自不同OpenStack服务和项目的度量数据,包括但不限于CPU、内存、网络流量和存储使用情况。 7. 浮动IP(Floating IP):浮动IP是云计算中一个重要的网络概念,它...

    OPENSTACK 计算 (Compute) - Nova源码

    通过阅读和分析这些源码,开发者可以了解到OpenStack Nova如何处理请求、如何与数据库交互、如何进行资源调度,以及如何与底层虚拟化技术对接。这有助于理解OpenStack的分布式架构,以及如何扩展和定制Nova以满足...

    openStack学习文档

    #### 二、OpenStack Compute 架构分析 **架构组成:** - **Cloud Controller:** 负责整个系统的状态管理以及与外部接口的交互。 - **Compute Controller:** 负责提供计算资源,如 CPU、内存等。 - **Object Store ...

    openstack自动化部署脚本T版本centos7官方镜像

    2. **硬件和网络规划**:确保你的硬件资源和网络配置符合OpenStack的需求,例如足够的内存、CPU和磁盘空间,以及合理的网络布局。 3. **备份和恢复策略**:在执行自动化部署前,确保数据安全,考虑备份现有系统,并...

    基于OpenStack架构的金融云实践.pdf

    - 控制节点:包括API接口、消息队列(MQ)、内存缓存(Memcached)、MariaDB数据库、虚拟机跟踪服务(VTS)和负载均衡器(HAProxy),它们共同构成了OpenStack的核心管理组件。 - 计算节点:涉及Nova计算服务、...

    详解VMware接入Openstack—使用Openstack创建vCenter虚拟机

    本篇内容将详细介绍如何通过Openstack来创建和管理VMware vCenter环境下的虚拟机,并深入分析了两种不同的接入方式。 首先,我们来看vSphere和vCenter的概念。vSphere是VMware推出的企业级虚拟化解决方案,它由多个...

    Openstack云资源管理平台-POC测试方案.docx

    同时,本测试方案也将对 OpenStack 云资源管理平台的实际应用场景进行研究和分析,为云计算环境的优化和改进提供重要的参考依据。 结论 OpenStack 云资源管理平台是一个功能强大且可靠的云计算平台,本测试方案的...

    基于Openstack部署云计算管理平台.pdf

    搭建Openstack管理平台对硬件有较高的要求,需要配置足够的CPU、内存、网卡和硬盘空间。Controller节点和compute节点的硬件配置各有不同,但都必须满足最低要求才能保证安装和运行的流畅性。 在系统实现上,安装...

    OpenStack Compute Administration Manual

    通过以上对 OpenStack Compute Administration Manual 的分析,我们可以看出该手册不仅详细介绍了 OpenStack Compute 的安装、管理和配置方法,还提供了大量的配置细节和推荐设置。这对于希望利用 OpenStack 构建云...

Global site tag (gtag.js) - Google Analytics