{"id":13500065,"url":"https://github.com/mopemope/meinheld","last_synced_at":"2025-10-06T13:34:10.591Z","repository":{"id":44811610,"uuid":"806604","full_name":"mopemope/meinheld","owner":"mopemope","description":"Meinheld is a high performance asynchronous WSGI Web Server (based on picoev)","archived":false,"fork":false,"pushed_at":"2021-05-08T08:18:11.000Z","size":4156,"stargazers_count":1462,"open_issues_count":32,"forks_count":102,"subscribers_count":45,"default_branch":"master","last_synced_at":"2025-04-10T03:46:45.948Z","etag":null,"topics":["async","http-server","python","python3","wsgi-server"],"latest_commit_sha":null,"homepage":"http://meinheld.org","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mopemope.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGES.rst","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2010-07-30T01:38:27.000Z","updated_at":"2025-03-27T04:35:58.000Z","dependencies_parsed_at":"2022-09-02T08:50:20.756Z","dependency_job_id":null,"html_url":"https://github.com/mopemope/meinheld","commit_stats":null,"previous_names":[],"tags_count":36,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mopemope%2Fmeinheld","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mopemope%2Fmeinheld/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mopemope%2Fmeinheld/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mopemope%2Fmeinheld/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mopemope","download_url":"https://codeload.github.com/mopemope/meinheld/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254092798,"owners_count":22013292,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["async","http-server","python","python3","wsgi-server"],"created_at":"2024-07-31T22:00:50.685Z","updated_at":"2025-10-06T13:34:05.528Z","avatar_url":"https://github.com/mopemope.png","language":"C","readme":"What's this\n---------------------------------\n\n.. image:: https://travis-ci.org/mopemope/meinheld.svg\n    :target: https://travis-ci.org/mopemope/meinheld\n\nThis is a high performance python wsgi web server.\n\nAnd Meinheld is a WSGI compliant web server. (PEP333 and PEP3333 supported)\n\nYou can also join us in `meinheld mailing list`_.\n\nRequirements\n---------------------------------\n\nMeinheld requires **Python 2.x \u003e= 2.6** or **Python 3.x \u003e= 3.5** . and **greenlet \u003e= 0.4.5**.\n\nMeinheld supports Linux, FreeBSD, and macOS.\n\nInstallation\n---------------------------------\n\nInstall from pypi::\n\n  $ pip install -U meinheld\n\nInstall from source::\n\n  $ python setup.py install\n\nMeinheld also supports working as a gunicorn worker.\n\nTo install gunicorn::\n\n  $ pip install -U gunicorn\n\n\nBasic Usage\n---------------------------------\n\nsimple wsgi app:\n\n.. code:: python\n\n    from meinheld import server\n\n    def hello_world(environ, start_response):\n        status = b'200 OK'\n        res = b\"Hello world!\"\n        response_headers = [('Content-type', 'text/plain'), ('Content-Length', str(len(res)))]\n        start_response(status, response_headers)\n        return [res]\n\n    server.listen((\"0.0.0.0\", 8000))\n    server.run(hello_world)\n\n\nwith gunicorn. user worker class \"egg:meinheld#gunicorn_worker\" or \"meinheld.gmeinheld.MeinheldWorker\"::\n\n    $ gunicorn --workers=2 --worker-class=\"egg:meinheld#gunicorn_worker\" gunicorn_test:app\n\nContinuation\n---------------------------------\n\n**NOTE: This feature is deprecated and will be removed in 2.0**\n\nMeinheld provides a simple continuation API (based on greenlet).\n\nTo enable continuations, use ContinuationMiddleware. get Continuation from wsgi environ.\n\nContinuation objects have two very interesting methods, `suspend` and `resume`.\n\nFor example:\n\n.. code:: python\n\n    from meinheld import server\n    from meinheld import middleware\n\n    def app(environ, start_response):\n        ...\n\n        #get Continuation\n        c = environ.get(middleware.CONTINUATION_KEY, None)\n\n        ...\n\n        if condtion:\n            waiters.append(c)\n            #suspend\n            c.suspend()\n        else:\n            for c in waiters:\n                # resume suspend function\n                c.resume()\n\n        ...\n\n\n    server.listen((\"0.0.0.0\", 8000))\n    server.run(middleware.ContinuationMiddleware(hello_world))\n\nFor more info see http://github.com/mopemope/meinheld/tree/master/example/chat/\n\nWebsocket\n---------------------------------\n\n**NOTE: This feature is deprecated and will be removed in 2.0**\n\nMeinheld support Websockets. use WebSocketMiddleware.\n\nFor example:\n\n.. code:: python\n\n    from flask import Flask, render_template, request\n    from meinheld import server, middleware\n\n    SECRET_KEY = 'development key'\n    DEBUG=True\n\n    app = Flask(__name__)\n    app.config.from_object(__name__)\n\n\n    participants = set()\n\n\n    @app.route('/')\n    def index():\n        return render_template('websocket_chat.html')\n\n    @app.route('/chat')\n    def chat():\n        print request.environ\n        ws = request.environ.get('wsgi.websocket')\n        participants.add(ws)\n        try:\n            while True:\n                print \"ws.wait()...\"\n                m = ws.wait()\n                print \"recv msg %s\" % m\n                if m is None:\n                    break\n                for p in participants:\n                    print \"send message %s\" % m\n                    p.send(m)\n        finally:\n            participants.remove(ws)\n        return \"\"\n\n\n    if __name__ == \"__main__\":\n        server.listen((\"0.0.0.0\", 8000))\n        server.run(middleware.WebSocketMiddleware(app))\n\n\nPatching\n---------------------------------\n\n**NOTE: This feature is deprecated and will be removed in 2.0**\n\nMeinheld provides a few monkeypatches.\n\nSocket\n==========================================\n\nThis patch replaces the standard socket module.\n\nFor Example:\n\n.. code:: python\n\n    from meinheld import patch\n    patch.patch_all()\n\nFor more info see http://github.com/mopemope/meinheld/tree/master/example/patch/\n\n\nPerformance\n------------------------------\n\nFor parsing HTTP requests, Meinheld uses Ryan Dahl's http-parser library.\n\n(see https://github.com/joyent/http-parser)\n\nIt is built around the high performance event library picoev.\n\n(see http://developer.cybozu.co.jp/kazuho/2009/08/picoev-a-tiny-e.html)\n\nSendfile\n===========================\n\nMeinheld uses sendfile(2), over wgsi.file_wrapper.\n\n.. _meinheld mailing list: http://groups.google.com/group/meinheld\n","funding_links":[],"categories":["C"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmopemope%2Fmeinheld","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmopemope%2Fmeinheld","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmopemope%2Fmeinheld/lists"}