In principle, my dilemma is this. I have a list of x servers that store files. There is another server hosting the mysql db and application site. When a file is downloaded (to an external server), the application checks which server has more free space on it and moves the file there. This works great if you started with 2+ empty servers with the same amount of free space. If you add another server to the mix at a later time ... which will have more free space than the current servers, this method is not so effective because all new files will be downloaded elusive to the new server, which will overload as it will handle most of the new traffic until it catches the rest of the boxes in terms of free space.
Therefore, I thought to introduce a weighing system that will help normalize the distribution of files. Therefore, if 3 servers are installed at 33%, and 1 server has significantly more free space, it will receive more downloads than other servers (although it has the same weight), but the load will be distributed across all servers.
Can anyone suggest a good php-only implementation?
user15063
source
share