Multi-server "load balancing" issue

Forum for questions and support relating to the 1.29.x releases only.
Locked
vertigeaux
Posts: 6
Joined: Mon Jun 20, 2016 6:50 pm

Multi-server "load balancing" issue

Post by vertigeaux »

As an experiment that may end up permanent, I'm running multi-server ZM on several Raspberry Pi3's. It is actually running quite well, with each Pi able to monitor 2 or 3 cameras at 5fps 1280x720.

The main issue I'm having is when I re-assign a camera from one server to another, the new server does begin monitoring the camera, but the server that was monitoring it before continues to monitor that same camera also. Possibly related, if I am managing the servers from server1 and add a new camera to server2, both server1 and server2 begin monitoring that camera.

This problem is "fixed" by simply restarting the zoneminder service on the server that should not be monitoring a particular camera. This isn't too terrible a solution, but it does result in about 30 seconds of missing video. Considering the fact that my reason for moving a camera from one server to another is usually due to high activity causing high cpu load, I usually don't want to miss 30 seconds of video at this time.

I was hoping to automate this poor man's load balancing solution, which should be pretty simple. I just have to write a script to check loads periodically, and then update the database entry to move a given camera to a different server. I have tested this part by manually changing ServerId in the Monitors table, and ZM seems to check the database pretty often to see which cameras it should be watching. I'm just wondering why it doesn't check to see which cameras it should no longer be watching.

Is this behavior intended, or am I missing something?
User avatar
iconnor
Posts: 3197
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

Re: Multi-server "load balancing" issue

Post by iconnor »

Better support for multi-server will be coming in 1.31.

I was only able to get very basic support in for 1.29.
vertigeaux
Posts: 6
Joined: Mon Jun 20, 2016 6:50 pm

Re: Multi-server "load balancing" issue

Post by vertigeaux »

Ah, nice!

Do you have plans to add load-balancing options? Or is this not feasible, and a task better left to external scripts?


I'm not really sure if I'm getting good value with the RPi's as far as dollars of hardware per monitored camera, but I really like the flexibility. It is very quick and easy to commission additional hardware when required.
Locked