Skip to content

Running munin with gunicorn (or other WSGI server) #65

@MarvinM-TK

Description

@MarvinM-TK

Hi guys and gals,

I would like to use munin with a WSGI server in order to be able to serve more requests (the default setup gave me a HTTP error code 429 "Too Many Requests" when I tried to query it from my app). I tried several tutorials e.g. for gunicorn and they stated, that I should create a wsgi.py file with the following contents:

from munin import app

if _name_ == "_main_":
app.run()

However when I start gunicorn like so gunicorn -w 4 --bind 0.0.0.0:9090 'wsgi:app' it loads the workers but as soon as I make a request it trows the following error.
Traceback (most recent call last): File "/data/munin/lib/python3.9/site-packages/flask/app.py", line 2525, in wsgi_app response = self.full_dispatch_request() File "/data/munin/lib/python3.9/site-packages/flask/app.py", line 1822, in full_dispatch_request rv = self.handle_user_exception(e) File "/data/munin/lib/python3.9/site-packages/flask/app.py", line 1820, in full_dispatch_request rv = self.dispatch_request() File "/data/munin/lib/python3.9/site-packages/flask/app.py", line 1796, in dispatch_request return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) File "/data/munin/munin.py", line 1176, in lookup if inCache(hashVal): File "/data/munin/munin.py", line 1129, in inCache for c in cache: NameError: name 'cache' is not defined

I already tried to pass the filename of the cache file in different iterations e.g. gunicorn -w 4 --bind 0.0.0.0:9090 'wsgi:app(c="vt-hash-db.json")'.

Does anyone have an idea, how to fix this?
Thank you for your support
:-)

Best Regards
Marvin

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions