Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
MarvinM-TK opened this issue Jan 27, 2023 · 0 comments
Open

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

MarvinM-TK opened this issue Jan 27, 2023 · 0 comments

Comments

@MarvinM-TK
Copy link

MarvinM-TK commented Jan 27, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant