A queueing theory approach to bags-of-data scheduling on clouds