Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slow website response times after update to 5.7 #10286

Closed
dkolarov opened this issue Jun 11, 2024 · 14 comments · Fixed by #10325
Closed

Slow website response times after update to 5.7 #10286

dkolarov opened this issue Jun 11, 2024 · 14 comments · Fixed by #10325
Assignees

Comments

@dkolarov
Copy link

Bug description

After updating one of our websites (eloquent) to latest version 5.7.2, which have approx. 600 entries in a collection, the page response times from server increased to 4-5 seconds (all content). It turns out this due to changes in version 5.7, as the problem is not present under version 5.6.2.

We first upgraded to 5.7.2 and when we noticed the problem started downgrading to lower versions and can confirm that in 5.6.2 the site performs with normal response times.

How to reproduce

I guess the issue is related to the higher number of entries in a collection, as another websites we have with approx. 50 entries have normal response times in version 5.7.2.

Logs

No response

Environment

Environment
Application Name: woodfloorsanding.co.uk
Laravel Version: 10.48.12
PHP Version: 8.3.6
Composer Version: 2.7.2
Environment: production
Debug Mode: OFF
URL: www.woodfloorsanding.co.uk
Maintenance Mode: OFF

Cache
Config: NOT CACHED
Events: NOT CACHED
Routes: NOT CACHED
Views: CACHED

Drivers
Broadcasting: log
Cache: statamic
Database: mysql
Logs: stack / single
Mail: mailersend
Queue: sync
Session: file

Statamic
Addons: 3
Sites: 1
Stache Watcher: Disabled
Static Caching: Disabled
Version: 5.7.2 PRO

Statamic Addons
jacksleight/statamic-bard-ipsum: 1.0.1
jacksleight/statamic-bard-texstyle: 3.2.2
statamic/eloquent-driver: 4.2.0

Statamic Eloquent Driver
Asset Containers: eloquent
Assets: eloquent
Blueprints: eloquent
Collection Trees: eloquent
Collections: eloquent
Entries: eloquent
Forms: eloquent
Global Sets: eloquent
Global Variables: eloquent
Navigation Trees: eloquent
Navigations: eloquent
Revisions: eloquent
Taxonomies: eloquent
Terms: eloquent
Tokens: file

Installation

Fresh statamic/statamic site via CLI

Additional details

No response

@duncanmcclean
Copy link
Member

duncanmcclean commented Jun 13, 2024

Are you able to try updating to v5.7.3 and let us know if that improves performance at all?

@dkolarov
Copy link
Author

Hi Duncan, after moving to v5.7.3 no difference is noticed unfortunately.

@duncanmcclean
Copy link
Member

Hi Duncan, after moving to v5.7.3 no difference is noticed unfortunately.

Okay, thanks for checking anyway!

@RobMaple
Copy link

I'm also experiencing this -- have tried v5.8 too. Version 5.6.2 is the last release that performs normally.
After a bit of digging around it seems to relate to rendering asset fields although I haven't had chance to look into what it is specifically.

@jasonvarga
Copy link
Member

I think it's due to #10139. I will dig into this soon.

@jasonvarga
Copy link
Member

I haven't had a chance to actually test on a slow site and whether this resolves it, but I've thrown something up at #10325. I will investigate it more tomorrow, but if you'd like to try it out in the mean time and let me know if it helps, that would be awesome.

You can change the statamic/cms requirement in your composer.json to dev-cache-fieldtype-config-fields and run composer update statamic/cms.

@jasonvarga
Copy link
Member

Apparently that causes an issue. Maybe don't use it just yet.

@OleksiiBrylin
Copy link

OleksiiBrylin commented Jun 19, 2024

I have the same issue.
it looks like some updates multiply page load in few times:
Statamic 2.11.22 -> 0.7 s
Statamic 5.6.2 -> 2.6 s
Statamic 5.8.0 -> 5.6 s

I have collection with 178 items and related few taxomies, the pice of code takes 78% of loading time:


loop partial 178 times ....

<article id="{{ slug }}" class="team-item element-item {{ taxanomi_1 | raw | join(' ') }}">

  <div class="team-item__bild">
    {{ image }}
      <img class="lazyload" data-src="{{ glide :src="url" width='450' height='450' fit='crop_focal' q='69' sharpen='5'}}">
    {{ /image }}
  </div>

  <div class="team-item__textwrapper">
    <h3 class="h3">
        {{ if email }}
            <a class="link--black" href="mailto:{{ email | obfuscate_email }}">
                {{ vorname }} {{ title | Ueaeoe }}
            </a>
        {{ else }}
            {{ vorname }} {{ title }}
        {{ /if }}
    </h3>
    {{ if funktion }}
      <div class="team-item__funktion">{{ funktion | Ueaeoe }}</div>
    {{ /if }}
    <div class="markdown team-item__info">{{ info | replace('<br>', '\n') | markdown | Ueaeoe }}</div>

  </div>

</article>

by the way, replacing this pice of code to blade partial increased the page speed to 1.82 s (Statamic 5.8.0)

@duncanmcclean
Copy link
Member

duncanmcclean commented Jun 19, 2024

@OleksiiBrylin Are you able to try Jason's fix and let us know if that improves things for you? (see #10325)

@RobMaple
Copy link

@duncanmcclean hope it's alright to chime in -- I've tried the fix and it's improved things although it's still roughly 2x slower than older versions (as opposed to the 4x previously)

@duncanmcclean
Copy link
Member

Thanks for testing!

@jasonvarga
Copy link
Member

jasonvarga commented Jun 20, 2024

@RobMaple I've pushed an update to that PR. Can you try again with the latest?

Edit: Or just upgrade to 5.10.0

@michaeljhopkins
Copy link

Background

Tossing some more information towards this issue as I believe it's related (possibly to this issue as well).

We have 19k blog Posts that each have a Category taxonomy. When viewing the blog post, if the page had categories:title anywhere in the html it would take a long time to load. Using debugbar it said there were roughly 19k UuidEntryModel models loaded. Clearly the source of the slowness

Removing categories:title from the page would make the page snappy again.

In the content/collections/Posts.yaml file was the below block of code

taxonomies:
  - categories

Fix

Removing the above block of code makes all the pages snappy once more. I suspect because the below code is in resources/blueprints/collections/posts/post.yaml is why pulling the title or slug still works in antlers templates

-
  handle: categories
  field:
    type: terms
    taxonomies:
      - categories
    display: Category
    max_items: 1
    mode: select

New Issue

This introduces a new issue however. Because the collection no longer has "access" to the categories taxonomy, you are unable to manage that data in the control panel. I think this issue should be reopened and looked at

@duncanmcclean
Copy link
Member

@michaeljhopkins Can you please open a new issue? Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants