Search…

X3 Photo Gallery Support Forums

Search…
 
jeroenvermeulen.nu
Topic Author
Posts: 15
Joined: 03 Dec 2015, 09:16

Bad performance

21 Dec 2015, 11:44

Hi,

I've posted many issues this past week; they are all solved except one. Thanks for the excellent support.

U can't see my X3 installation; I'm using adjustments to the hosts file to make everything work.
I'm having issues with the performance, the website is slow.

I am renting a VPS at my local hosting company, they told me the following; we notice that the CPU goes to 80% when loading a page. Every time a page opens it looks like the script checks the folder \app\_cache\images\rendered\, in this folder there are 12000 photos. In some cases the PHP will check this folder, but will also check the original, not cached photos.

Do you have any solutions for me? I am happy to give the correct IP for the hosts file, but I would to message this.

Thank you.
 
User avatar
mjau-mjau
X3 Wizard
Posts: 14452
Joined: 30 Sep 2006, 03:37

Re: Bad performance

21 Dec 2015, 12:12

jeroenvermeulen.nu wrote:I am renting a VPS at my local hosting company, they told me the following; we notice that the CPU goes to 80% when loading a page.
The first time a page loads, it gets "created", but after that there is no reason it should not be fast, since it just loads a cached html page.
jeroenvermeulen.nu wrote:Every time a page opens it looks like the script checks the folder \app\_cache\images\rendered\
It would only check for images stored in cache, that are actually ON the page you are loading. That is the whole point with the cache system, and there is nothing wrong with that specifically. If the resized-image is not yet created/cached, it will have to resize an image, and that is a slow process.
jeroenvermeulen.nu wrote: , in this folder there are 12000 photos.
How many photos do you have in your gallery? That sounds like a suspiciously high number I admit ...
jeroenvermeulen.nu wrote:In some cases the PHP will check this folder
It doesn't generally "check the folder", but it checks for existence of a cached file, and that is the whole point of cache. Also, it will only check for the cached file when the page is created first time, because after that the page instance itself gets cached as a html resource (no more checking).
jeroenvermeulen.nu wrote:but will also check the original, not cached photos.
Not quite sure what you mean by this. The original image is there, and server may load it obviously, but it doesn't "check" it or anything. It just gets loaded, and in some cases counted for the sake of the menu and other things.
jeroenvermeulen.nu wrote:Do you have any solutions for me? I am happy to give the correct IP for the hosts file, but I would to message this.
X3 should not be slow, so yes would be interesting to look into this. It does sound very strange that you have 12000 photos in the /images/ cache specifically. Are you sure the other cache folders are created, and have subfolders inside?
Image
 
jeroenvermeulen.nu
Topic Author
Posts: 15
Joined: 03 Dec 2015, 09:16

Re: Bad performance

21 Dec 2015, 15:20

mjau-mjau wrote:
jeroenvermeulen.nu wrote:I am renting a VPS at my local hosting company, they told me the following; we notice that the CPU goes to 80% when loading a page.
The first time a page loads, it gets "created", but after that there is no reason it should not be fast, since it just loads a cached html page.
jeroenvermeulen.nu wrote:Every time a page opens it looks like the script checks the folder \app\_cache\images\rendered\
It would only check for images stored in cache, that are actually ON the page you are loading. That is the whole point with the cache system, and there is nothing wrong with that specifically. If the resized-image is not yet created/cached, it will have to resize an image, and that is a slow process.
jeroenvermeulen.nu wrote: , in this folder there are 12000 photos.
How many photos do you have in your gallery? That sounds like a suspiciously high number I admit ...
jeroenvermeulen.nu wrote:In some cases the PHP will check this folder
It doesn't generally "check the folder", but it checks for existence of a cached file, and that is the whole point of cache. Also, it will only check for the cached file when the page is created first time, because after that the page instance itself gets cached as a html resource (no more checking).
jeroenvermeulen.nu wrote:but will also check the original, not cached photos.
Not quite sure what you mean by this. The original image is there, and server may load it obviously, but it doesn't "check" it or anything. It just gets loaded, and in some cases counted for the sake of the menu and other things.
jeroenvermeulen.nu wrote:Do you have any solutions for me? I am happy to give the correct IP for the hosts file, but I would to message this.
X3 should not be slow, so yes would be interesting to look into this. It does sound very strange that you have 12000 photos in the /images/ cache specifically. Are you sure the other cache folders are created, and have subfolders inside?
Image
5000 files I see in /content/, I think this is the fastest way to check.

The folder /_cache/ has 25000 files inside.
Inside /cache/ there is /rendered with 12500 files and /request/ with 125000 files.

I hope this information is good, I'm trying my best to give the best answer.
 
User avatar
mjau-mjau
X3 Wizard
Posts: 14452
Joined: 30 Sep 2006, 03:37

Re: Bad performance

22 Dec 2015, 01:17

jeroenvermeulen.nu wrote:5000 files I see in /content/, I think this is the fastest way to check.
You mean you have approximately 5000 images in your gallery then?
jeroenvermeulen.nu wrote:Inside /cache/ there is /rendered with 12500 files and /request/ with 125000 files.
If you have 5000 images, then 12500 cached image requests/renders is reasonable. For each image in your gallery, it will produce 3-5 resized images based on your layouts, crop settings, and what mobile devices had visited the page. This is how cache works, so that your server doesn't have to resize every request in realtime.

I am curious though, you must have been using the gallery for a while for that cache-library to build up ... If you start with an empty cache, and visit a single page with 100 images, then 100 renders/requests will get populated into cache (perhaps with a few more if you have images in the menu). What Im trying to say, is that this is a progressive process, where image renders/requests get added to cache as pages are visited.

On paper, I can't see anything wrong, unless there are some strange/special circumstances. If you had a link, I could at least check myself ...
 
jeroenvermeulen.nu
Topic Author
Posts: 15
Joined: 03 Dec 2015, 09:16

Re: Bad performance

22 Dec 2015, 02:37

mjau-mjau wrote:
jeroenvermeulen.nu wrote:5000 files I see in /content/, I think this is the fastest way to check.
You mean you have approximately 5000 images in your gallery then?
jeroenvermeulen.nu wrote:Inside /cache/ there is /rendered with 12500 files and /request/ with 125000 files.
If you have 5000 images, then 12500 cached image requests/renders is reasonable. For each image in your gallery, it will produce 3-5 resized images based on your layouts, crop settings, and what mobile devices had visited the page. This is how cache works, so that your server doesn't have to resize every request in realtime.

I am curious though, you must have been using the gallery for a while for that cache-library to build up ... If you start with an empty cache, and visit a single page with 100 images, then 100 renders/requests will get populated into cache (perhaps with a few more if you have images in the menu). What Im trying to say, is that this is a progressive process, where image renders/requests get added to cache as pages are visited.

On paper, I can't see anything wrong, unless there are some strange/special circumstances. If you had a link, I could at least check myself ...
I'm messaging you now!
 
jeroenvermeulen.nu
Topic Author
Posts: 15
Joined: 03 Dec 2015, 09:16

Re: Bad performance

22 Dec 2015, 11:15

I'm sorry, did u have any chance to look at my message or are you busy?
 
User avatar
mjau-mjau
X3 Wizard
Posts: 14452
Joined: 30 Sep 2006, 03:37

Re: Bad performance

22 Dec 2015, 12:45

jeroenvermeulen.nu wrote:I'm sorry, did u have any chance to look at my message or are you busy?
Yes I replied ... I'm not on same time as you ;)