On Wed, Dec 21, 2016 at 11:23:42AM +0000, Stefan Hajnoczi wrote: > On Wed, Dec 21, 2016 at 04:44:08PM +0800, Bob Chen wrote: > > -smp 16 > > > > -smp cores=4,threads=4,sockets=1 > > > > > > Which one has better performance? The scenario is guest VMs running on > > cloud server. > > It's more complicated than that. > > The CPU topology (cores, threads, sockets) can be used by guest kernels > to make scheduling decisions.
cores vs sockets will have little difference, but cores or sockets vs threads will definitely affect guest schedular. > If you pin vcpu threads to host cpus and configure the guest with > an accurate CPU topology then you can expect the guest kernel to make > the best decisions. > > If you do not pin vcpu threads then you cannot expect any consistent > performance advantage by specifying the CPU topology. In fact if you do not pin threads and you specify a CPU topology that has > 1 hyperthread, you may well make performance of the guest worse. Essentially you never want to use threads>1, unless pinning guest CPUs to host CPUs 1:1 Regards, Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://entangle-photo.org -o- http://search.cpan.org/~danberr/ :|