Backendless Support
 
Solved

"Your application has exceeded a limit of the undefined on the current plan"

on our shared server app (id: 1B92F985-D9EF-9689-FFAC-C7E5FE5F2A00) there is error message in console:

"Your application has exceeded a limit of the undefined on the current plan.

All API calls are now blocked until the limits are increased.

"

I believe this is due to Business Logic scripts size, which on payment plans stated have now 21mb, whereas limit is 20.

However, when I quite aggressively decreased size down to 8 mb - I still can't deploy and while try deploy I only got error "... the application has been blocked due to exceeding the limit"

Leave a Comment

Comments (10)

photo
1

Hi Yuriy,

The apps are usually unblocked automatically in 2-4 hours after you have decreased the usage. We've unblocked it manually just now to speed it up. Please verify if everything is fine now.

photo
1

hmm, but how system allowed to deploy 21mb with 20mb limit? Also how would it be unblocked after decreased usage if it didn't allowed to "npm run deploy"? I guess, I had to remove some files via developer console "coding" section?

photo
1

also - isn't there option to increase BL size to more than 20 mb (that's way too low in the world of current bloated node_modules)?

photo
1

The limit is typically not checked while you use the service, since the check itself noticeably increases the response time (because interactions with our billing provider to retrieve the limit are required).

There is an external service which checks the usage and limits periodically. It blocks and unblocks the app depending on the comparison of the usage and limit.

So if you correct the usage in your app to be within the limits (regardless of how you do that - either via redeploying or by removing files manually), that service will unblock your app on the next periodic check (which is 2-4 hours usually, but that may vary a bit).

There's no way to increase the limit further. We came up with this number to prevent users from unintentionally slowing down their services, since the JS CodeRunner loads up all these modules each time the business logic script executes. We can't keep the process permanently running because it would be too resource-consuming considering the number of apps in the online version. Though we're in the process of creating a cache layer which would greatly improve this for active apps.

I'd be happy if you shared what would be the reasonable higher limit as to your opinion, considering the constraints described? Probably we may discuss a change if we see it's really needed.

photo
1

Well, I wasn't aware of "slowing down their services, since the JS CodeRunner loads up all these modules each time the business logic script executes", what kind of slowdown are you talking can you provide some numbers (like "+100ms for each +1mb").

The node_modules are known for their bloated size. We aren't using much modules (md5-hash, paypal-rest-sdk, request, web-push, xml2js) and it's already 8mb (after some manual junk removal from node_modules). 21mb when there were few modules for logging libraries, sms sending lib (and before manual node_modules unnecessary files removal).

Maybe you can keep some of the most common modules (https://www.npmjs.com/browse/depended) available in some kind of "shared environment" so it doesn't counted?

photo
1

We did not measure the dependency between the code size and time it takes to load it, but loading files from the file system (which nodejs does to execute them) is known to be slow and we run into that on one of our customers' project where CodeRunner had to handle lots of requests per second.

Typically this problem is negligible, because most nodejs server do not run on-demand, so the overhead is only one-time. But in our case each request runs a separate nodejs command and the file loading time is added to each request.

By the way, our documentation has an advice on how to keep your node_modules smaller by only saving what you actually use:

  1. To reduce the deployment size, consider minimizing the installation of the dependencies to only what the code needs. For example, since the code above uses only the camelCase function, it is possible to install only that module as shown below:
  2. npm install lodash.camelcase --save
  3. Then use the module as:
  4. var camelCase = require('lodash.camelcase');
  5. Backendless.ServerCode.Persistence.beforeCreate('*', function(req) {
  6. req.item.name = camelCase(req.item.name);
  7. });

As to the most common modules, actually we have a few built-in, including lodash, underscore, once, uuid, querystring and a few more. But I see this list is not documented, so I'll pass this further to be added to the docs.

photo
1

By the way, how can I check my Business Logic size after I'm done editing (adding new packages) without chance of triggering system block due to size limit? I mean, I know only one way to check size, after deploy (with "--keep-zip" key)

photo
1

Indeed, there's no option to check zip size before deploying. We've created a task (BKNDLSS-17225 for tracking purposes) to add a new option --size-confirmation, which will pause the deployment, print the total size to be deployed and ask whether you'd like to continue.

photo
1

Hi Yuriy

We've fixed and released it, update JS CodeRunner to version 4.6.7

and run deploy with the next argument:

  1. npm run deploy -- --zip-size-confirmation

Regards, Vlad

photo
1

yup, that's showing size, thanks!

photo