1. A method of optimizing performance of an application executed by a virtual machine, the virtual machine executed by a system that includes a plurality of processing units, the method comprising: measuring, by a container application of the system that controls the virtual machine, at least a hardware metric of the system upon which the virtual machine is executed and a software metric of the application executed by the virtual machine; and adjusting a tunable execution parameter of the virtual machine that optimizes execution of the application based on the measured hardware and software metric, wherein the hardware metric and the software metric cannot be measured by the virtual machine and the tunable execution parameter is a parameter that is adjusted by the virtual machine, and wherein the tunable execution parameter comprises an allocation of the plurality of processing units allocated to the virtual machine to which servicing of the application is restricted and a spin strategy for the application that controls spinning in locks used for synchronization within the virtual machine.