On my server, I have several PHP scripts running simultaneously that should use the same interface. They call the interface randomly.
That interface has limited "buses" it uses for the call. What I want to do is to add a round robin arbiter, that will direct each subsequent call to the next "bus".
I can do it with php and mysql. I can write a small program that stores the current round robin position, and when there is an interface call, it outputs that position, and increment the position in the database.
Since there are quite a lot of calls to that interface, I am thinking whether it is the most efficient way to do it. I feel that there must be a way to keep the program always running in the background in-memory, with the round robin as a variable. Mysql feels like an inefficient over kill. I might be wrong.
Some other options that I was thinking about are using java for the program and sockets to communicate with php, or using node.js
What do you think will be the most efficient solution for this arbiter?