Adaptive Dispatching of Tasks in the Cloud