Teamcity stop double building the same project

It is annoying when Teamcity builds the same project twice at the same time. Especially when some of the steps are to decomission old servers and deploy new ones and the two builds end up trampling all over each other.

The option to disable this is tricky to find. First go to your project build configuration. Then click on general settings on the left hand side. Then click the ‘show advanced options’ just above the save button in the main column. When you click this it now has an option to “Limit the number of simultaneously running builds (0 — unlimited)”. Enter 1 in this box. Hit save and you’ll no longer have 2 builds of the same project at the same time.

This is with teamcity version 8.1.3. It may be in a different spot in future versions.