easytarget / SBCEye

Lightweight SBC monitoring
GNU General Public License v3.0
4 stars 1 forks source link

Web server slows up when system busy etc.. #20

Closed easytarget closed 2 years ago

easytarget commented 2 years ago

Display animations etc remain fast.. appears to be the basic http server being horribly 'one connection', one thread, slow.. Maybe try: https://docs.gunicorn.org/en/stable/

easytarget commented 2 years ago

Or: https://www.tornadoweb.org/en/stable/

easytarget commented 2 years ago

Humm. Turns out all I reaaly needed was the ThreadedBaseHTTPServer. But that opened up a can of mutex-locking worms, python-rrdtool does not play well with threading. I used the threading modules Lock class to solve the issues and only render one graph at a time, and the server is faster and now handles multiple connections without a problem.