Some days ago I installed an Ubuntu server and two running virtual machines with libvirt. Everything works fine except one performance problem.
Everytime when I call a PHP script with directory operations the operations are very slow and not performant. Here is an example: http://zother.white-tiger.ch/ And here you see an example without a directory operation and how fast it is: http://michaeltanner.ch/
It's all on the same virtual server. The virtual machine uses 6 cores (8 are available) and 7500 megabytes RAM (8 Gigabyte are available). The disk image format is qcow2.
How can I improve the performance?
UPDATE Here is the source code of the directory listing. Before reading I have to say that the script is really old and today I wouldn't code it in that way ;) On my server before (not virtual, on the same dedicated like now) the script didn't have to load as long as on the virtual server.
Here you can see the code: http://fixee.org/paste/yi2fmb2/
UPDATE SOLVED Ok I got it. My damn source code sucks and the following command resulted in a loop until max time specified in php.ini.
<?php echo file_get_contents('http://list.white-tiger.ch/i.php?vers='.$vers) ?>
So it's now solved with removing the command. Anyway it's really dumb to read this url. The requested url even doesn't exist. My fault, sorry.