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

Huge Memory needs on first page load #10736

Open
dadaxr opened this issue Aug 30, 2024 · 0 comments
Open

Huge Memory needs on first page load #10736

dadaxr opened this issue Aug 30, 2024 · 0 comments

Comments

@dadaxr
Copy link

dadaxr commented Aug 30, 2024

Bug description

On a site with ~2000 "products" entries in a collection, When I flush the app cache & refresh the stache (clear + warm)... The first page load of a template listing products (with pagination and showing "only 16" products) needs between 3 and 6 Go of RAM.
3 Go when I remove some partial doing some apparently lite stuff (ie: checking if a value exist in session and display static html if so) and 6 GO when I let them in place... That's a huge gap to me, even the first 3GO are a LOOOT to display 16 products...

On the 2nd page load, it only takes ~200 Mo of RAM. (No caching strategy enabled, and using local file as cache storage engine)

Also, what's strange is : when I clear all the app cache (+ stache refresh), and load first another page (like the home page where no products are displayed), it takes ~200 Mo of RAM for this first page, and then load the product listing template , it also takes ~200Mo of RAM.

One hypothesis (ie : Without doing code diving) about what could explain that is ... when doing some querying with an freshly emptied cache + warmed stache..., some cached items are created on the fly , but cannot be used immediately (for instance if inside a loop or something) and have to wait until the request is done ... to be usable... (for instance it's like if if cached items are put in a queue and really written on the disk at the end of the request ...). Or ... of course the reason could be something else ... ;)

But to me, needing many GO of ram on first page load and then only few hundreds, whereas the stache is warm does not smell good... what do you think ?

How to reproduce

can share a private project with core team if needed...

Logs

No response

Environment

Environment
Application Name: xxx
Laravel Version: 10.48.13
PHP Version: 8.2.7
Composer Version: 2.6.2
Environment: local
Debug Mode: ENABLED
URL: xxx.localhost
Maintenance Mode: OFF

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

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

Statamic
Addons: 4
Sites: 1
Stache Watcher: Disabled
Static Caching: Disabled
Version: 5.20.0 PRO

Statamic Addons
jacksleight/statamic-bard-texstyle: 3.2.3
jacksleight/statamic-bonus-routes: 0.3.2
rias/statamic-redirect: 3.7.1
statamic/seo-pro: 6.0.3

Installation

Fresh statamic/statamic site via CLI

Additional details

No response

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

No branches or pull requests

2 participants