-1

I am using gevent workers with gunicorn for my flask application. I am facing issues where my greenlets are getting blocked for long periods. gevent provides monitoring via monitor threads. Is it possible to setup this monitor thread when using gevent workers with gunicorn. If yes , can someone share a possible example. I have looked up multiple example but none of them are working. versions being used in my application

python==3.8
gevent==21.1.2
gunicorn==20.1.0
ravi katiyar
  • 11
  • 1
  • 7

2 Answers2

0

To enable this we have to set the environment variable GEVENT_MONITOR_THREAD_ENABLE and that enables the monitor. For more configuration we can refer the doc here

ravi katiyar
  • 11
  • 1
  • 7
0

Seems like hub does not get switched to so the monitor thread not started, you can enable monitor thread manually using

hub = gevent.get_hub()
hub.start_periodic_monitoring_thread()

But there is a problem with event gevent monitoring which is spamming issue https://github.com/gevent/gevent/issues/1665