Dealing with load spikes and resource optimization in the cloud