zoukankan      html  css  js  c++  java
  • aodh M版本新特性

    在 Kilo版本, API WSGI application 可以有以下2种部署方式:

    • As a Python command that runs a Werkzeug-based web server that is monkeypatched to use eventlet.
    • As a WSGI application hosted by any WSGI server, often Apache + mod wsgi.

    WSGI host好处是性能好,可扩展性高。

    Werkzeug + Eventlet 命令行好处是简单方便但性能差而且难以调试。

    Eventlet 会monkeypatches the socket module 来提供 non-blocking network I/O.

    Eventlet 还有一个问题就是当socker出现异常比如client频繁在没有读取完server发来的数据时的关闭导致问题难以debug。

    Aodh采用的是第三方werkzeug WSGI服务器,而该服务器支持多线程/进程,所以可以很方便的直接替换。

    http://werkzeug.pocoo.org/docs/0.11/

    所以修改后服务的的部署就变成了:

    1. werkzeug WSGI server without eventlet
    2. Apache + mod wsgi

     其中在Api/app中使用werkzeug 的代码为:

    from werkzeug import serving
    
        serving.run_simple(host, port,
                           app, processes=conf.api.workers)

    由于要在整个项目中剔除eventlet的使用,所以messaging中也需要从eventlet替换成多线程:

    --- a/aodh/messaging.py
    +++ b/aodh/messaging.py
    -                                         [endpoint], executor='eventlet',
    +                                         [endpoint], executor='threading',

    其他服务如aodh-listener,aodh-notifier ,aodh-evaluato,aodh-expire还是使用oslo_service.

     参考:

    1. https://github.com/openstack/telemetry-specs/blob/master/specs/liberty/remove-web-eventlet.rst
    2. http://docs.openstack.org/releasenotes/aodh/mitaka.html
  • 相关阅读:
    文件的权限
    正则表达式
    软硬链接的学习
    linux系统中的文件类型和扩展名
    把数组排成最小的数
    整数中1出现的次数(从1到n整数中1出现的次数)
    最小的K个数
    连续子数组的最大和
    数组中出现次数超过一半的数字
    字符串的排列
  • 原文地址:https://www.cnblogs.com/allcloud/p/5404115.html
Copyright © 2011-2022 走看看