Embodiments of the present disclosure provide a method and an apparatus for scheduling a
virtual machine thread includes: determining, by a load balancing scheduler,
processor affinity of a first virtual
central processing unit (VCPU) thread on a
virtual processor of a
virtual machine in response to receiving a scheduling instruction for the first VCPU thread; determining, based on the
processor affinity of the first VCPU thread, a second hyper-threading logical processor in the target physical processor as
processor affinity of a second VCPU thread in the
virtual processor; scheduling, based on the processor affinity of the first VCPU thread, the first hyper-threading logical processor to run the first VCPU thread; and scheduling, based on the processor affinity of the second VCPU thread, the second hyper-threading logical processor to run the second VCPU thread.