cortezaproject / corteza

Low-code platform
https://cortezaproject.org
Apache License 2.0
1.49k stars 345 forks source link

High CPU usage when modifying custom CSS #1713

Open moalamri opened 4 months ago

moalamri commented 4 months ago

Is there an existing issue for this?

Version of Corteza

2023.9

Current Behavior

When editing the Custom CSS, most of the time it runs ok, but sometimes it takes alot of time before returning a timeout, I monitored the server resources and it shows as following IMG_7318

Expected Behavior

No response

Steps To Reproduce

  1. Change Custom CSS
  2. Hit Submit

Environment and versions

No response

Anything else?

No response

Fajfa commented 4 months ago

Ok thanks, we'll take a look at that. Strange since it works without much processing on my end

moalamri commented 4 months ago

Hi @Fajfa Whenever this happens, I check the action log and it's filled with such records

image

Please let me know if I can do anything else to helps you debug this Thank you

Fajfa commented 3 months ago

https://forum.cortezaproject.org/t/dart-processes-running-forever/1934

moalamri commented 3 months ago

@Fajfa I’m sorry for closing the issue earlier because I thought it was from my setup. Glad to see that you have spotted the issue.

KinyaElGrande commented 2 months ago

@moalamri

I believe the root of the issue lies within Dart-Sass, particularly regarding the specific versions of Dart-Sass you're using. Could you please provide the dart-sass version and if possible the style sheets as well?

I've repeteadly updated my stylesheets on corteza's custom-css-editor to lines spanning more than 25k while monitoring my CPU, which showed a steady pattern of spikes and drops.

Furthermore, there have been documented reports of CPU performance issues associated with Dart-Sass, as indicated by various issues such as:

Nevertheless, the Dart-Sass team asserts that many of these performance issues have been addressed in versions beyond v1.61.0.

Corteza's custon-css-editor screenshot

Screenshot 2024-05-17 at 17 33 07

CPU metrics screenshot

Screenshot 2024-05-17 at 17 37 51

moalamri commented 1 month ago

Hey @KinyaElGrande I'm sorry for not being able to reproduce this again since I don't using Corteza for now and I remember it was a bit tricky to get it up and running because of proxy network is not being created or something, so I can't setup it again for further debugging.

I remember my Custom CSS was only few lines ~10 line or so. So, it wasn't a matter of payload size... I wish I could be more helpful. I hope you can figure the issue and fix it if it does exist with other users.