Optimal Resource Configuration of Complex Services in the Cloud