Server >> web api rate limits

One idea is that you build in a cue in the SDK to automatically handle these headers and adapt OR make a far easier system. I already spent 6-8 hours trying to adapt to all your limits, and still don’t feel confident that I have a good solution. Feels like time wasted.

1 Like

Explain the throttle limit, please, and any ways to prevent it applying to the cloud code on the server. Should we be using the Moralis SDK rather than http calls? Should we be doing something completely different?

Using http calls is fine. Based on what requests you make could be a different reason for getting that throttle limit that means that too many requests were done in a second. Usually adding a delay between requests removes that error.

That’s… not helpful. I’m not sure you understand how these systems need to work. We’re not talking about a single client with a single set of calls. We’re in a world with multiple clients, multiple servers, with spiky loads. There’s no such thing as “put a delay in”. Or, rather, there could be, but it should be your dev team doing those things so your system is fit for purpose.

We can do our best to deduplicate requests (but even that’s a hard problem with the upgraded server, as they’re multi-instance).

But that still doesn’t help the basic problem that the limits are set up badly, not communicated well, and not configurable for the uses people need. And the only way to figure all this out is spending a ton of engineering time and doing detailed trial-and-error.

You can also increase the limits with a custom plan if you want. The delay you can add it also when you get a rate limit error and try same request after delay.

+1. Moralis team, please be more clear about limits: The pricing page says the “Pro” package supports 3500 requests per minute…

…But in practice, it is more like 100 per minute. Try to do more and you run into “throttle” or some other undocumented limit.

My program analyzes <100 wallets using Node.js + Moralis SDK. I hit the rate limit error after about 20 wallets. I waited ~10 min to start over, but the rate limit is still there for even 1 request.

error {
  code: 141,
  error: 'This Moralis Server is rate-limited because of the plan restrictions. See the details about the current rate and throttle limits: {"x-rate-limit-limit":"3500","x-rate-limit-remaining":"51","x-rate-limit-remaining-ttl":"51","x-rate-limit-throttle-limit":"88","x-rate-limit-throttle-remaining":"1","x-rate-limit-throttle-remaining-ttl":"1","x-rate-limit-throttle-used":"108","x-rate-limit-used":"40"}'
}

This error message is incredibly poorly formatted. Is this really the best naming scheme we could come up with, x-rate-limit-throttle-remaining-ttl?

The documentation here covers exactly two of the dozen or so elements in the error message. What we need is a reference that defines all of them with precision. Here’s another customer asking for the same thing.

If I’m reading this correctly, it says I’ve used only 40 requests over the past minute (“x-rate-limit-used”:“40”) so if I’m paying for 3500/min, why on earth am I getting rate-limited?

At this point, I would expect a response from support that says something like “some requests count double” and “check your cloud limits” but these are not the point. The pricing page says 3,500 requests per minute. I would challenge the Moralis team to show us some code that gets anything close to that. Using any request, cloud limit or other parameters that are available to paying customers like us.

it seems like some extra throttle limit is counted for those requests.

it also looks like we have a problem now with the headers that are returned when using web3api with a server, it looks like some fields are missing.

Lots of “seems like” and “looks like.” Is the problem on the Moralis side, or with our code? If on the Moralis side, what’s the ETA for a fix. If on our side, what do we need to do?

Can someone at Moralis address the rest of the questions in the post?

1 Like

Can you ask one question at a time?. It is clear from that response that throttle limit was hit.

Can you answer the question fully please?

Is the problem on the Moralis side, or with our code? If on the Moralis side, what’s the ETA for a fix. If on our side, what do we need to do?

Can we get a definition of all the limit headers?
Can you show how to get to 3500 requests per minute or is that not possible?

The headers that you see there are not complete. The limit should work as expected. I don’t have an ETA.

I don’t understand. Does this mean the problem is on the Moralis side, or with our code? If on our side, what do we need to do?

Can we get a definition of all the limit headers?
Can you show how to get to 3500 requests per minute or is that not possible?

Those are compute units and not requests. Every request has a different number of compute units. And some requests also have throttle limit that is bigger than the compute unit number.

There is a list in documentation with the number of compute units per API endpoint.

Sorry, but I don’t think you read the question all the way through. It says

At this point, I would expect a response from support that says something like “some requests count double” and “check your cloud limits” but these are not the point. The pricing page says 3,500 requests per minute. I would challenge the Moralis team to show us some code that gets anything close to that. Using any request, cloud limit or other parameters that are available to paying customers like us.

Also, you did not answer the questions above: What do we do about it?

The billing and rate limit page:
https://docs.moralis.io/misc/rate-limit

3,500 per minute is the limit for pro plan.
Some requests are weighted higher.
All requests are subject to a per-second limit known as the throttle.
(For 3,500 per minute plans, the throttle limit 88 requests per second)

If 100 requests come in within that second, you’ll hit the throttle limit

1 Like

The pricing page says we can get 3,500 requests per minute, but in practice the limit seems to be ~100 per minute, not per second.

Let me recap the questions, which have not been answered yet:

  1. What do the rate limit error headers mean? These docs only define a few of them. We need a full and precise reference.
  2. What are the “throttle limit” request weights? These docs show weights for “speedy nodes” and for “api” but not for the “throttle limit.”
  3. If a throttle limit is hit, how long is service blocked? Until the next second? minute? day?
  4. If it is really possible to reach 3,500 requests per minute without hitting a “throttle limit” please show code that does so.
1 Like

Following up on these. Can we get some help from the devs please?

it should be until next second

there is a new endpoint now for web3api that gives more detailed information (https://admin.moralis.io/web3Api): /info/endpointWeights

Can you please address all four questions? They are not complicated.

it should be until next second

Can we be more definitive? Is it until the next second or not?

there is a new endpoint now for web3api that gives more detailed information (https://admin.moralis.io/web3Api): /info/endpointWeights

Are these the throttle limit request weights? If not, what is the relevance?

an example of output:

  {
    "endpoint": "getBlock",
    "path": "/block/{block_number_or_hash}",
    "price": 1,
    "rateLimitWeight": 1
  },