-
Notifications
You must be signed in to change notification settings - Fork 44
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
Abnormally high resource usage and slow builds #41
Comments
Thank you for reporting the issue @skourismanolis ! I would like to ask you a few questions :
|
I can try to make an example setup demonstrating the bug should that be required. Thanks a lot for your care and time, I really like astro-imagetools it's super useful for optimizing speed and SEO, and I plan on using it in production for this small blog website I'm working on! |
Thank you @skourismanolis, an example setup will really help to investigate the issue. |
I created this repo to explore and demonstrate the issue astro-imagetools-example. It's using the astro blog starter, with modifications in However with experimentation I've found the following:
I changed versions on gitpod with:
While on my windows pc I just removed |
Thank you for your efforts @skourismanolis and especially thanks for using GitPod. It'll help a lot to investigate the issue. |
It's very odd! Can you confirm if |
I saw sharp mentioned on |
No, it's enough information @skourismanolis. Thank you @skourismanolis. |
I'm also seeing |
OK, I think I traced mine down to markdown files being processed, which included images like:
Which is sent to sharp as |
The reason the build is slow in this case is that there are 240 If I change the I'm not sure there's much more that can be done in this package to improve this, other than to find another tool that is faster than sharp, which would be a pretty major change. |
Good catch @IanVS ! I ran a few tests on GitPod and here are the results:
|
Oops. Sorry @skourismanolis, I didn't see that you have locked |
After upgrading to
|
I am confirming that this issue starts from |
@skourismanolis a fix for the regression has been merged and released in After upgrading to
Now, https://github.com/skourismanolis/astro-imagetools-example builds successfully on the latest release. It's taking
|
Closing the issue @skourismanolis ! Feel free to reopen the issue if you are facing any issues. And thank you so much for creating such a detailed issue. |
I just got bitten by this (converting an existing blog). Disabling Would it be acceptable to disable by default in Since it is known to be 10x slower than other conversions, it would be a much nicer experience for newcomers like me 😄 |
I'm noticing high CPU and RAM usage when building using version >0.5.3.
I've tested most versions from 0.5.1-0.5.8 (latest) and 0.5.2/0.5.3 seem to be the fastest, with version 0.5.1 being a close second.
Each time after I get the last "Image at xxx optimized in yyyms", I get a "Completed in xx." and then the CPU spikes. No transformed images are written to the build dir at that point, This last "step" takes much more time than the rest of the build when in finishes. Emphasis on when because I've had to forcibly terminate the build a couple of times. Using versions above 0.5.5 (I think) dramatically worsens the effect.
On the latest version, this last "step" pushes my CPU to 100% and I've noticed it take as much as 9.5GB of RAM. (For reference I have a desktop computer with a 6 core/12 thread i7 8700K and 16GBs of RAM). Initially I thought it was an issue with Windows so I rebooted to my Linux install and tried it there.... It crashed my desktop environment and I got kicked back to the login screen.
Something of note, later versions also throw an error only on Windows when building basically anything else apart from
avif
files. I don't know if these are caused by the same issue (earlier versions are ok).I'd also like to note what I'm trying to do:
I am working on a blog website that uses wordpress as a CMS. I'm currently only using the
Picture
component passing thesrc
attribute as a URL. The blog currently has <50 images.The text was updated successfully, but these errors were encountered: