Big issues with PPC and Cloud files
So, I have photopost and photopost classifeds running on my site. Both apps share EVERYTHING, and that means same web server, same file systems and even the same amazon cloud bucket.
I am using s3fs fuse cloud system mounted to an amazon cloud bucket. I have 288,000 images in photopost and when I access them via the app which reads offf of the amazon cloud, the response is acceptable considering what it has to do. No issues there. It takes 3 seconds to load the index page. Not the best but acceptable considering its a cloud.
However, the photopot-classifieds which from the looks of if is very similar to photopost, the page loads take 30 seconds to load and there are only 1200 images in that bucket as apposed to 288,000.
I have gone through the code and the issue is inside of the function get_imagethumb function.
Furthermore, as a side note, the calls to the function dirsize kill the system . I modifieed it just return 1. This is a bad thing with cloud files.
Does the latest version of the classifieds still use similar logic? Is there a work around for using cloud files besides the s3fs?
narrowed it down to a call to getimagesize which is a big overhead with a cloud
The photopost pro and classifieds code is highly identical you can try commenting out these lines in the function get_imagethumb in classifieds pp-inc.php but not sure what would be affected since I have not tried this
Yeap. getimagesize is a real killer. drastically improves when its not called.
Now for another issue with getimagesize.
When uploading images to an ad, getimagesize is called to identify the image type. ie. jpg, gif ... The problem in the function create_thumb is that you call the getimagesize against the file on the server instead of the tmp file name created by php in /tmp. I woud like to change this to get the info from the uploaded file before it is saved as the target file but cannot find in the code where this is. This would be much more efficient than issuing get and post commands that cloud files use since those tmp files are local. any help would be appreciated. and future stats gathering from images maybe can be gathered from the uploading process rather then the destination file.
There is nothing wrong with the code it is simply how it is done. There is no temp file. We throw the uploaded file into the uploads directory and then process those pictures and they are moved into the data folder. Your calling getimagesize in create_thumb against the $filepath variable. Filepath is simply the users uploads directory and filename. You need to actually call getimagesize against an actual true file to get info from this is how it works.
|All times are GMT -5. The time now is 03:07 PM.|
Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0