160k Workload in 3Hours with less than 100 records!

We are experiencing a critical issue with excessive workload usage on our Bubble backend APIs, specifically with functions like get_cart_product_details
costs about 160K workload
image

Basically we have 3 Steps

  1. Server script code for calculation process

image

2- Another server script code
image
image
image

3- At the end we return data processed before and another data from database


Like these steps can hit the workload to reach this level ?

That’s lots of searches. You even have a nested search. So the WF itself is running multiple searches. I assume this is an API WF? If yes, do you have “ignore all privacy rules” applied when running it? If you do then it also means all of those searches will return all field values since no privacy rules are being applied.

Exactly API WF @ihsanzainal84
Something that need wondering if all fields returned that’s costs so much in short time as you see . In your opinion is that bubble problem or how to deal with something like that ?
AND most of fields needed in different places .

Run with privacy rules and call the WF from the appropriate user. Alternatively, you can use the Data API to CRUD your records instead. These 2 are the only things that I can suggest without delving deeper into your setup (which unfortunately I don’t have the time for ATM).

As a rule of thumb, I will try to not do any searches in an action or nest searches. I usually build/adjust my datatypes around this rule.

For example, when it comes to API WFs initiated client side, I will try to grab the required data client side first, then pass them as parameters to the API WF.

In the backend, for example, if I know I will use a record for multiple actions, I will pass its values as a parameters to different Custom WFs depending on what I need done.

There’s no one solution. Just be aware of what costs WU.

3 Likes