Optimum number of CPU cores for non-VDI Hyper-V

We've found that assigning fewer vCPUs to VMs (we have a non-VDI environment) i.e. 1 instead of 4 can increase performance because the scheduler has to go around fewer cores.

I'll be looking at ordering a new production virtual server in the near future which will be running the latest 2012 R2 and was wondering how significant the number of cores it has is. Is it worth spending the money on 12 or 16 core CPUs instead of a six core in terms of what each VM would be able to utilise of the host hardware?

Is there a point of diminishing returns? If so is there a formula or rule of thumb to work it out?

In our system, we have upwards of thirty or forty VMs on each server, and we'd gladly trade clock speed for cores (up to a point, of course).

Really, it's highly dependent on your environment: both the number of VMs, and the kinds of services that run on them.

If you have few VMs, then you really don't need more cores, so you should be focusing on clock speed. But if you have a lot of VMs, or the services they provide are highly parallelized, then you'll see more performance out of more cores than more clockspeed, all else being equal.

Lets say I have a machine with 2x quad cores to keep within Microsoft's licensing restrictions. That'd have 16 logical cores because of Hyper Threading running 2 threads for each core.

Would it be better to run this machine with 8 VMs each with 2x vCPUs so they each get one physical core or to have a ratio of 1 vCPU to 1 logical CPU which would mean it could support 16 VMs? Would the VMs be using less of the hardware in the second scenario?

As I said in the title these are for non-VDI machines. They run a mix of Server 2003 R2, Server 2008 R2 and Server 2012 R2. They're mostly test machines and machines used to replicate customer environments so we can test against specific configs. We use dynamic memory where we can, most use 512MB when idle but could be 2-3GB when under load so we're not talking massive amounts of memory. Would this change how you'd deploy them?