Search…

X3 Photo Gallery Support Forums

Search…
 
User avatar
mjau-mjau
X3 Wizard
Posts: 13993
Joined: 30 Sep 2006, 03:37

Re: Performance Improvements

19 Dec 2014, 08:47

alexhenes wrote:preload = false (things seem to slow down significantly if I set this to true)
Preload is pretty simple. After you have edited anything, it needs to be created ... If a single page on your host takes 16 seconds to render the first time it is visited, then you can only try to imagine how long time it will take to create the preload object and cache it ... and you can only imagine how much stress it might put your server under.

Thus, before it is created, there is no way it will speed up your general server. In fact, as mentioned before and in docs, you need to very very careful with it, because it can hog down your entire server.

HOWEVER, once it is created and cached, it will speed things up incredibly for the visitor, without affecting server performance. For example, when I checked it now, it is already cached, loads in 1.8 seconds and doesn't affect your server at all!
Image

The main questions for you perhaps, since your server is slightly underpowered, will you be editing and adding pages consistently over time? Once you are through a "caching phase" (after edits), your website should speed up nicely eventually. However, if you are editing very often, it will be in a consistent caching phase.
 
illunis
Experienced
Posts: 84
Joined: 14 May 2012, 07:24

Re: Performance Improvements

19 Dec 2014, 09:27

After we finish uploading photos and recreating the website there will always be a day that we may upload a picture or even 10....or write something at the blog/updates....

would this affect the server too much if preload is set to true?...will it cache everything again or only the things that have not being cached?
 
User avatar
mjau-mjau
X3 Wizard
Posts: 13993
Joined: 30 Sep 2006, 03:37

Re: Performance Improvements

19 Dec 2014, 09:56

illunis wrote:After we finish uploading photos and recreating the website there will always be a day that we may upload a picture or even 10....or write something at the blog/updates....

would this affect the server too much if preload is set to true?...will it cache everything again or only the things that have not being cached?
It depends on how powerful your server is, and how many folders and images you have in your content structure. The best thing is to simply try ... The worst that can happen, is that your server is over-stressed for a period of time until the site object is created and cached at {yourwebiste}/services/site.json ... or as in our demo gallery https://www.photo.gallery/demo/x3/services/site.json ... As you can see, that page loads relatively fast after its cached, considering it contains the entire website (without assets).

When I was working with mjau-mjau.com, I normally disabled preload while I was editing. After editing, I navigate through the new pages and make sure they cache properly before re-enabling the preload. The benefit of this, is that you don't create the sudden burden of caching both new pages AND the website object, and maybe image-resizing also, all at the same time for server. This could cause problems, and timeouts even when creating the website object ... Thus, it is sometimes best to disable it until the new pages are created and cached, and some of the images are resized.

Try it ... keep the preload setting on even when editing. The server might go slow, and perhaps even unresponsive for several minutes, but if it recovers nicely within a reasonable time frame, then that should be acceptable ... After all, caches are created.
 
illunis
Experienced
Posts: 84
Joined: 14 May 2012, 07:24

Re: Performance Improvements

19 Dec 2014, 10:01

Great.....i WILL try it soon....let see what happens :twisted:
 
User avatar
alexhenes
Experienced
Topic Author
Posts: 568
Joined: 28 Sep 2006, 16:13

Re: Performance Improvements

19 Dec 2014, 10:31

Thanks for looking at the Karl... I will wait and see what happens over then next month or so. I am mostly done with configuration. In the winter I may add content on a monthly basis. In the spring and summer... I will be adding content on a weekly basis. I will set the preload to true over the holidays and see what happens. I also wonder if the total number of images on my site make a difference.
Alex
https://www.merelyafleshwound.com
https://www.goldenbikeshop.com
 
User avatar
alexhenes
Experienced
Topic Author
Posts: 568
Joined: 28 Sep 2006, 16:13

Re: Performance Improvements

19 Dec 2014, 19:42

After building my cache up to 328M using the the crawler... then setting preload to true... things seem to be buzzing along nicely. Will keep an eye on it.
Alex
https://www.merelyafleshwound.com
https://www.goldenbikeshop.com
 
illunis
Experienced
Posts: 84
Joined: 14 May 2012, 07:24

Re: Performance Improvements

20 Dec 2014, 03:27

Same here !

I have uploaded around 15 more images while keeping
Code
prepload = true
and the only side effect was that my server came up with an error that "Resources were exausted" and displayed a blank page.....after a refresh everything came to normal and the speed is amazing :D
 
User avatar
mjau-mjau
X3 Wizard
Posts: 13993
Joined: 30 Sep 2006, 03:37

Re: Performance Improvements

20 Dec 2014, 12:23

alexhenes wrote:Thanks for looking at the Karl... I will wait and see what happens over then next month or so. I am mostly done with configuration. In the winter I may add content on a monthly basis. In the spring and summer... I will be adding content on a weekly basis.
Letting the website "settle" will definitely make sure it speeds up.
alexhenes wrote:I will set the preload to true over the holidays and see what happens. I also wonder if the total number of images on my site make a difference.
It definitely impacts performance. A page before cached, will need to process several items, including all child images, and all folders (for your menu). In your case, I think the main performance-impact comes from your relatively large folder structure. Each full page on your website needs to loop through all other pages to create the mega menu ... However, as a "human" visitor, it is unlikely you will notice this because X3 only needs to load the "content" of the page in json format through ajax. This is MUCH lighter, because the page only processes the content, and does not process the items in the menu like a full page reload does ... Basically, each page has two cache files: 1) full html 2) json (format for ajax content loading)

In fact, the only reason full html pages are created and cached, is because you might be sharing links, and visitors may be accessing your website from a specific gallery link. Because "full pages" are not really created for human visitors (except entry page), often your full cached pages won't get created because they never get demanded.
alexhenes wrote:After building my cache up to 328M using the the crawler... then setting preload to true... things seem to be buzzing along nicely. Will keep an eye on it.
... which leads me to this. I am not saying it is a bad idea to use the crawler, but keep in mind your crawler is not using javascript like a human browser is using. Basically the crawler will be going through your website, caching "full" pages, which are not even used when a human is navigating your page. Considering full "pages" are very heavy (because they also require creating the menu), you are basically triggering a very heavy process, that will certainly slow down your server, which provides no immediate benefits for human visitors.

When a browser navigates between pages, it loads a file like this:
http://www.merelyafleshwound.com/canyoneering.json
... instead of this ...
http://www.merelyafleshwound.com/canyoneering

The json "page" also gets cached, but is a much lighter process, because it just gets the content. I would just be cautious about using crawlers to cache your website, as that is a very "expensive" process for your server, that does not really provide any benefits immediately as they are not used to much degree. At the same time, it might be slowing down the server doing other processes, like creating the json page caches.

... and there is more: If you have preload enabled and the preload object is cached, it won't use neither the json pages or full pages (cached or not). It will only use the data in the preload object, since it includes the entire website compressed. (The preload does not include pages that are hidden from menu, but still available by URL).

Not sure if any of the above makes sense, but I wrote it anyway ...
 
User avatar
Bulletproof IT
Experienced
Posts: 134
Joined: 04 May 2013, 04:36

Re: Performance Improvements

23 Dec 2014, 00:03

I'm going blind. Where was reference to the crawler "utility / tool" to "index" and process all the images, thumbnails and each of the 7 preview images size?
Thank you.
» I Imagevue X3 «
 
User avatar
mjau-mjau
X3 Wizard
Posts: 13993
Joined: 30 Sep 2006, 03:37

Re: Performance Improvements

23 Dec 2014, 02:51

Bulletproof IT wrote:I'm going blind. Where was reference to the crawler "utility / tool" to "index" and process all the images, thumbnails and each of the 7 preview images size?
Is that question directed to me? I am not quite sure what you mean ... AlexHenes uses a crawler bot to cache his pages, and my reply to him (extended version above), tell that it might not be productive, and might even be counter-productive. We are certainly not gonna build our own web-crawler at imagevue ... There is not point in "indexing" (nothing gets indexed anywhere) ... A page may get "written" to disk on FIRST visit from first visitor to that specific page, which speeds up all consecutive visits for any consecutive visitor. At best, a crawler will improve speed for a single visitor, and only the visitor which visits a specific resource first ... At the same time, it is a liability, because instead of "caching-on-demand", it would take your server into a state of processing that is not fit for a shared-server-environment. Furthermore, it is pointless to pre-process "all images" ... In X3, there is not a set amount of image sizes that it wants to create. In fact, we would have "unlimited" sizes, but instead we LIMIT it within an array just to make sure your host doesn't have to process every pixel request, and store them. If you are running a full page slideshow, likely only 2-3 image sizes will ever need to get created and cached, so why pre-create "7" sizes? In fact, why pre-process and pre-cache anything at all, when at BEST, it would only benefit the first visitor to the specific resource, while the 100s/1000s consecutive visitors will be served the cached resource regardless?

We are looking into several optimizations in next release, and I have also looked at lot into CDN networks to use with X3. There are some cool features that will improve X3 performance and offload your hosting, but ultimately we are left with a single bottleneck: Your "shared hosting environment" which in its limitations, has to process initial pages and image renders (which is where the X3 cache becomes important), before any other general page speed optimization can even be taken into consideration. Just an unrelated side note!