Self-learning threshold-based load balancing