This study proposes a novel efficient resource allocation mechanism for federated clouds, which takes the communication overhead into consideration, to improve system throughput and reduce resource repacking overhead in the auto-scaling mechanism. In general, when the amount of service requests increases, more and more resources are allocated to satisfy these requests. However, single cloud cannot provide unlimited services with limited physical resources; therefore, the federation of multiple clouds may be one possible solution. In the federated cloud environment, when the workload changes, the resource allocation mechanism could adopt vertical/horizontal scaling fashions to repack the required resource into virtual machines. In the vertical scaling approach, the resource allocation mechanism allocates more resources into virtual machines for improving virtual machine's capability. In the horizontal scaling approach, the resource allocation mechanism allocates more virtual machines for enhancing the virtual cluster's capability. However, frequent resource repacking may reduce the system performance. Therefore, in order to improve system throughput and reduce repacking overhead, the proposed mechanism captures the execution pattern of applications by the profiling system and the resource status by the monitoring system, and then allocates resources for configuring the virtual cluster. Performance for NAS Parallel Benchmarks is evaluated. Experimental results show that the authors' approach could reduce repacking overhead and improve system throughput by comparing two previous works.