Please find my issues:
1) We deployed a simple website (no major cpu intensive computation or backend db operations) on the VM. We also have the same website deployed on a physical machine. When I hit the URL of the website deployed on the VM, I notice that the website takes way too much time (10 seconds) to load the first page (login). Note that the first page is essentially static content with no DB lookups whatsoever. I logged in to the VM and ran top at the same time as accessing the static page. I noticed that top froze ! The results didn't refresh for close to 5 seconds. The physical machine doesn't take that long to respond.
2) When I hit the second page, the website starts consulting the backend database and again the response time is too long (about 8 seconds). And top freezes again. The subsequent pages are okay and load up in considerably less time (< 3 seconds).
3) Another weird thing about this VM is that, when I try to ssh into the machine, the login prompt takes close 5 seconds to appear ! And once I enter the username, the password prompt takes another 5 seconds to appear ! However, once I have logged in, most commands that I run have reasonably good response times.
So, my guess is that the machine essentially freezes when new processes become active. In #1, "ruby" became active and in #2, "postmaster" (Postgres) became active. Once both ruby and postgres were active, the responses turned out to be much better.
Hope this helped. Please let us know what you find out. We really cannot use this VM in production especially when response times become unpredictable.
Why my linux machine is showing poor performace? How to improve it ?