• Resolved jinspin

    (@jinspin)


    i have recently seen extreme slow down performance or time out on blog posts that use photonic to display my smumug gallery. I don’t know why it has become so slow or time out now. I am using Elementor website editor so when i edit blog posts with embedded photonic smugmug gallery it is hitting database a lot and eventually spiking CPU to max 100% which slows down my website down and I have to call my ISP server admin to kill all processes for my website. I suspect when people click thru my blog posts that this will also hit database a lot and spike CPU to max slowing down website.

    This is my blog page with all posts

    https://sweetdreamsstudio.com/blog/

    If you click on any of blog posts – you can see how it is very slow or time out to bring up the post. But please note that the first blog post for Neve bat mitzvah is using Essential Grid to display photos so that is working ok.

    I am using PHP 8.1 in PHP Mode so it is SEO friendly. Should I change this to older versioin PHP?
    I am using BaguetteBox with Masony layout
    I think I am using mostly default settings for photonic.
    I have custom CSS in its own file checked.
    I am using wp_rocket cache plugin with Delay Javascript turned on but excluding list of javscript files below (which wp rocket tech support said to exclude so it works on mobile) –

    /jquery-?0-9.(.min|.slim|.slim.min)?.js
    /jquery-migrate(.min)?.js
    /wp-content/plugins/photonic/include/ext/baguettebox/baguettebox.min.js
    /wp-content/plugins/photonic/include/js/front-end/nomodule/photonic-baguettebox.min.js
    /wp-content/plugins/photonic/include/js/front-end/module/photonic-baguettebox.min.js
    /essential-grid/
    /wp-content/themes/HighendWP/assets/js/scripts.js
    /wp-includes/js/jquery/ui/autocomplete.min.js
    /wp-includes/js/jquery/ui/core.min.js
    /wp-includes/js/jquery/ui/menu.min.js

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Sayontan Sinha

    (@sayontan)

    I tried a few pages on your site, e.g., https://sweetdreamsstudio.com/lunch-break-red-bank-food-pantry-grand-opening-ribbon-cutting-ceremony/ and https://sweetdreamsstudio.com/photo-booth-quinn-bat-mitzvah-party-fishbowl-dream-midtown-hyatt-nyc/ – they are not at all slow, and loaded pretty fast (< 2 seconds to start rendering).

    I am using Elementor website editor so when i edit blog posts with embedded photonic smugmug gallery it is hitting database a lot and eventually spiking CPU to max 100% which slows down my website down and I have to call my ISP server admin to kill all processes for my website.

    You will need to evaluate what is happening when you are trying to save posts. For reference, Photonic never builds out your gallery when you are trying to save a post – it only stores the shortcode in your post. When the page is retrieved on the front-end, the shortcode is evaluated and the markup is built.

    This leads me to think that you have something that is doing all the SmugMug web-service calls etc. when you are saving the post (probably your caching plugin), and that is becoming a memory hog. You will need to work with your caching plugin authors to see what it is that they are doing that is consuming so much memory.

    I suspect when people click thru my blog posts that this will also hit database a lot and spike CPU to max slowing down website.

    No – that will not happen, because your posts are already cached. The caching will always retrieve saved markup, so there is no web-service call that happens. You can try this by pulling up any of your pages from the front-end in Chrome’s incognito mode.

    Now, if you want to determine whether Photonic is really slowing down your site, you can do the following:

    1. Pick any post.
    2. Disable caching for that post.
    3. Save the post. This should save pretty fast, since, as I mentioned above, it is just a shortcode in Photonic.
    4. Now try loading it in the front-end. This should load slower than a cached post, because it will try to pull the shortcode live. However, under no circumstances will Photonic cause a 100% CPU load. Photonic uses native WP features to make web-service calls. WP doesn’t make multiple web-service calls in parallel, which is both, a curse (serial calls slow down response time), and a blessing (parallel calls can spike your CPU load).
    5. If you want to make it faster, use the JS load mode (not the PHP load mode). The JS load mode will 100% prevent the web-service call from being made by your server, even if you are caching the page. The JS load mode delegates the web-service call to the browser, and with current lazy-loading features in place, this comes up pretty fast.

    I am using PHP 8.1 in PHP Mode so it is SEO friendly. Should I change this to older versioin PHP?

    You will be better served by switching your galleries to the JS load mode. That will automatically show you results. You might be overestimating the benefits of the gallery markup for your specific use case – in looking through your site, many of your galleries have hundreds of photos, several of which have the same alt text (e.g. “lunch break red bank food panty grand opening ribbon cutting ceremony”, or “Photo Booth rental party entertainment Quinn bat mitzvah Fishbowl Dream Midtown Hyatt NYC”). This is already reflected in the main body of your post as well, so you are not gaining much by fetching the whole gallery behind the scenes.

    There is nothing to be gained by reducing your PHP version – PHP versions get faster.

    /jquery-?0-9.(.min|.slim|.slim.min)?.js
    /jquery-migrate(.min)?.js
    /wp-content/plugins/photonic/include/ext/baguettebox/baguettebox.min.js
    /wp-content/plugins/photonic/include/js/front-end/nomodule/photonic-baguettebox.min.js
    /wp-content/plugins/photonic/include/js/front-end/module/photonic-baguettebox.min.js
    /essential-grid/
    /wp-content/themes/HighendWP/assets/js/scripts.js
    /wp-includes/js/jquery/ui/autocomplete.min.js
    /wp-includes/js/jquery/ui/core.min.js
    /wp-includes/js/jquery/ui/menu.min.js

    The two lines with photonic-baguettebox.min.js have not been a part of Photonic’s code-base for more than a year. You might have added them in accordance with a prior thread, but that is no longer needed.

    Thread Starter jinspin

    (@jinspin)

    hi
    thank you for very detailed and helpful reply. The blog posts are indeed fast coming up.

    I had talked to tech support for my web host and they did 2 things which maybe sped things up. They created real cron job instead of virtual cron job in wordpress and they had me disable heartbeat within wp rocket plugin. The caching of posts also probably helped.
    https://www.a2hosting.com/kb/installable-applications/optimization-and-configuration/wordpress2/configuring-a-cron-job-for-wordpress/

    I did not notice there were still some blog posts using photonic that were coming up very slow and even timing out especially older blog posts on page 8 or further. I think they are are not cached yet for some reason. I can tell when blog post will be very slow when it takes more than 2 seconds to come up.

    Next time I edit blog post I will disable WP rocket beforehand to see if that is what spiked CPU.

    I didn’t want to use JS mode because I read that PHP mode is SEO friendly and helps search engine crawl and detect the photos on posts as the whole page is rendered and sent to browser.
    If I did use JS mode then search engine crawlers will not be able to see the photos on my posts so it would not help with SEO correct? You are saying photos are not going to be much help for SEO anyways because they have same redundant alt tags? I really want my images to be seen by search engines to help with SEO ranking so this is dilemma.

    Any other settings I can change to speed up photonic besides switching to JS mode?

    i will remove those 2 lines js baguette from wp rocket.

    Plugin Author Sayontan Sinha

    (@sayontan)

    I had talked to tech support for my web host and they did 2 things which maybe sped things up. They created real cron job instead of virtual cron job in wordpress and they had me disable heartbeat within wp rocket plugin. The caching of posts also probably helped.

    I can say this for a fact… caching of the posts is really the only thing that is majorly benefitting you on the front-end. Cron etc. wouldn’t have any impact here.

    You are saying photos are not going to be much help for SEO anyways because they have same redundant alt tags? I really want my images to be seen by search engines to help with SEO ranking so this is dilemma.

    The way I see it, there are two points of consideration:

    1. You want your site itself to show up in search engine results, based on keywords.
    2. You want your site’s photos to show up in search engine results, e.g. when people look at the “Images” tab in Google’s results, your photos should be visible.

    While the above seem to be the same, there is a subtle distinction. Point #1 can be accomplished rather easily with the JS load mode, since most of your photos have the same keywords, which are often incorporated in the body of the post. Point #2 would need the PHP load mode. However… which of these photos do you want to show in the search results? All have the same description!

    Some other notes:

    • If you are not using caching, you could use the “Load More” feature and just show a limited number of photos on the main post, then add a “Load More” button that will enable users to keep clicking until the end of the album. But, since you are using caching, this wouldn’t matter.
    • The JS mode has another advantage over caching – if there are new photos in your gallery, the JS mode will pick them up automatically even if your page is cached.

    I think it really is a toss-up between caching and the JS mode for you. Caching is currently impacting your save times (due to the large albums), but is keeping your front-end fast. JS mode will keep both, your save times and your front-end fast, but will not get you the point #2 of your SEO considerations.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘My blog posts with smugmug gallery slow or time out’ is closed to new replies.