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
  • 相关阅读:
    poj 1080 dp
    Codeforces Round #280 (Div. 2)
    Codeforces Round #279 (Div. 2)f
    Codeforces Round #278 (Div. 1)
    Codeforces Round #276 (Div. 1)
    搜索
    debug 心得
    ZOJ 1633
    DRF 一对多序列化与反序列化
    HTTP协议
  • 原文地址:https://www.cnblogs.com/allcloud/p/5404115.html
Copyright © 2011-2022 走看看