Thanks to both, here my answers:
>>Is all of the server's 6GB of RAM available to the VM?
YES, we just raised to 8GB, with no success
>>Is the VM set to be able to use multiple processors?
YES, we rose from 2 to 4 two days ago, with no success. Today we set them to HIGH priority and allocated them statically (I do not know the correct term), but the 4 Processors should be always available to the machine now, not only when the machine requests more CPU.
>>Are you running
mysql and apache both on the same VM?
YES, and my last tests showed what you are saying: as long that I am alone, either in phpMyAdmin or on the mysql command line prompt, the mysqld works correctly at 1% of CPU even if I fire up a complicated query on mdl_course table in 10 or more ssh shells.
If I put Moodle in maintenance mode and only a few Admins log in, the CPU consumption of mysqld raises at 100 to 350% and response times get already bad.
And if I let go and 30 or more Students access, most often they receive the
Database-Connection failed error.
>>We've seen very poor performance running my
sql in virtualized environments (on Xen and KVM) and generally try to avoid it.
I did a serious research on Novell SUSE and VMWare to find out if there were known problems speaking against such a move. But there are not! The SUSE 11 is even certified to be the best SUSE OS to work ontop of a VMWare ESX machine. Incredible!
I am on the point to migrate back all data and databases on to the physical server, as our Semester has just begun and people want to work.
There is only one thing I fear: if for any reason phpMyAdmin did not tell the truth about the health of the databases, if they are sort of corrupt, even if they seem to be ok - and what about the indexes? - then I would have two damaged systems.
So do you know whether a dump - even of a corrupt database - will do any harm on my old system when I import the dump? Or are the mysql statements along with the data guarantee that the data imported will be ok??
>>but I'd stay away from running your database in one.
Many thanks for your wise advice.
>>Check the slow queries log
I checked it with phpMyAdmin's runtime info and they seemed to be not too baad to me. Actually 29 with only Admins working and maybe quite more (about 300) with 40 People this morning. But Moodle is the same version as before and 40 People is no load at all, so the slow queries should stay the same as before, unless I do not understand correctly this type of queries...
>>Since you seem to have quite a bit of RAM on the system, you may want to look at firing up memcached.
As there is enough Memory for apache AND php AND mysql, I would simply want it to work as it did before on my physical server. Caching and optimizing would come after the system works correctly and not to correct sort of a bug or misconfiguration of the php, apache or mysql parameters.
I wonder if there is an apache configuration parameter which could help to solve this CPU Problem between apache, php and mysql?
>>disks
We have SAN-Disks attached and allocated to this virtual machine. Maybe we could tweak it a little bit, but again, we have to resolve a major problem first. Any other server out of 70 uses the same disks and even if they are slower than mysqld I do not think this could be the reason of our high CPU utilization accompanied by shut outs of the users.
One disk for OS, one disk for swap and one for Moodles php and data.
>>hdparm -tT /dev/sda - noatime
Thanks, I will check both.
Thanks for all your help, Rosario (facing a long night of work...)