This paper presents a model to explain the stylized fact that many countries have a low ratio of migrants in their population while some countries have a high ratio of migrants. Immigration improves the income of the domestic residents, but migrants also increase the congestion of public services. If migrants are unskilled and therefore pay low taxes, and the government does not limit access to these services, then the welfare of the domestic residents decreases with the number of migrants. Visa auctions can lower the cost of immigration control and substitute legal migrants for illegal migrants. If the government decides to limit the access of migrants to public services, immigration control becomes unnecessary and the optimal number of migrants can be very large.