MDPro - scalability issues - if file_exists Logan - Jan 07, 2007 - 07:52 AM Post subject: scalability issues - if file_exists
I run quite big photoportal based on MD-pro autotheme, pnphpbb2 and smartors album pack.
In album pnphpbb2 module I've changed code not to display images via thumbnails scripts which were checking database than checking whether file exists and than if not resampling thumbnail with code which was first checking whether file exists and than if does not starting thumbnail script. On category page this procedure was performed for each thumbnail - 20 times. With growing number of pictures portal was slower and slower.
Recently I came to the conclusion that this looop if (file_exists ... is unnecesary because it is enough to do it once after uploading photo and resampling thumbnail.
But effect was unbelivable - portal is 2-3 times faster. I think that for each generation of page 20 files was checked and than 20 files loaded - double unnecesary work. Disk making it phisically.
Now I found that during generation of ANY page md-pro and autotheme is performing file_exists check for 30-40 times.
Just change " if (file_exist" and " if (@file_exist" with "echo "x";if (file_exist" in your portal scripts and you will see 30-40 x-es on generated page. And this skips or elseif (file_exist functions (about the same numebr but not all are executed.
I think that it might be very usefull to get rid of those functions in places in which they are unnecesary. That would give extra power to md-pro portal which id very voulnerabe for heavy traffic.
How do you think? TiMax - Jan 07, 2007 - 07:58 AM Post subject:
We always try to remove unnecesary code, but maybe if it is there is because it need to be there
You can work in this way to optimize YOUR installation, not to use like default release Logan - Jan 07, 2007 - 10:11 AM Post subject:
Thank you for that fast answer.
Yes your right. I think I will try do do something with this I hope it will give good results.
Those observations also mean that limits in scalability are caused rather by limitation of file system then by processor strenght, what is not a good news for me because I wanted to switch for stronger server - but I don't thing there will be any improvement on file system performance.
Greetings !!! TiMax - Jan 08, 2007 - 04:11 AM Post subject:
Try also to use MDLite, it is more fast and need less memory