Web server performance degradation in recent releases

Post Reply
ctzei
Posts: 2
Joined: Thu Apr 02, 2020 3:26 am

Web server performance degradation in recent releases

Post by ctzei »

Hi all,

Not sure if anyone has experienced this or has any clue if there is anything I can change on my side but since a recent update, couple weeks back (don't remember the version number, but I know it's the one that stated "Redesigned web server socket code (performance and reliability)"), I have noticed that using the endpoint that fetches static images (JPEGs) from live feeds now is not as smooth as before.

The endpoint I'm referring to is -> %bi-hostname%/image/%camera-name%/

The endpoint still works as expected, but once in a while takes several hundred milliseconds more than before, and I no longer can make multiple calls to the same endpoint (same endpoint but different cameras) at the same time. My use case is that every 1 second I call that same endpoint, but changing the %camera-name% for around 10 different cameras. In the past that used to work really well, getting all JPEGs in around ~50ms each (well, all at the same time), now it's not uncommon that one our couple of those requests go to 300+ms while the rest are still around the 50ms mark.

Is anyone aware if there is any sort of rate limiting recently added to the web server? If so, is there is any setting to disable it?

Thanks!
DarkStar
Posts: 3
Joined: Mon Sep 02, 2019 4:06 pm

Re: Web server performance degradation in recent releases

Post by DarkStar »

I suspect we may be suffering from the same issue. I have noted recent performance issues with fetching snapshots, however to date I still suspect ffmpeg as the primary culprit in my case due to other issues with ffmpeg. My configuration worked fine for about a year but as of last month Im having nothing but issues including no longer being able to stream live video.

In troubleshooting this I swapped Homebridge platforms from a RBP 3B+ to a RBP 4 and then to the Windows 10 server Blueiris runs on with no change in symptoms.

The only two things that helped regarding my snapshots were

1. Turning off "Log all connections" which helped reduce all the AuthFail log entries due to the way ffmpeg deals with basic authentication
2. Changed my snapshot call
from:
"stillImageSource": "-i http://username:password@192.168.X.X:80 ... ?q=50&s=80"
to:
"stillImageSource": "-f mjpeg -i http://username:password@192.168.X.X:80 ... video.mjpg"

Neither change should have had much of an effect but rule 25 says "never argue with success". I can now capture 10 snapshots every 10 seconds without any lag. Still cant stream video but one problem at time.
ctzei
Posts: 2
Joined: Thu Apr 02, 2020 3:26 am

Re: Web server performance degradation in recent releases

Post by ctzei »

Just to add a bit more info, I'm convinced that there was indeed some change made to the "login" mechanism, as I realized that on my side I was calling /login every-time I was fetching a new frame, which now seems to eventually "block" or rate-limit the requests. Now I changed the logic to cache the session for couple minutes and it's working as before. But as mentioned in the first comment, this logic was working as expected some weeks back (i.e. getting a new session every-time a new frame was requested).
Post Reply