Web3 API servers crashing consistently when calling getBlock

Can you also try to do a test where you call web3api from a could function using a http request instead of using web3api from sdk?

Ok let me figure out how to do that

Ok so same behaviour when using cloud functions. It takes a bit longer to cause the server to go 100% cpu and stop responding (like 4-8 hrs) but it still happens. This time some of the servers would still respond for a brief minute, but when I start running getBlock on them they almost immediately go unresponsive. Something with the server is obviously not cleaning up after itself.

I think the servers need a dev to look at them when they’re in this state to see what’s consuming the cpu.

How did you call the api from the cloud function?

Did you use the api key with a http request or the web3api call available?

I’m calling it with a http request using the api key

Ok, strange. Now, can you try with a different http request, that only reads the data from an url to see if it replicates?

Ok I’m calling a cloud function via http that only returns the param it was sent. It returns quickly in about 200 ms, cpu is at 10% and so far no degradation.

What’s the next step?

I’ll do some tests later too.

You could try to make a http request to a simple url in a cloud function to see if it still crashes when you call that cloud function multiple times.

Isn’t that what I just did? Not sure if you’re saying something different to this:

I’m not sure what you did there, something seems strange, maybe you need to make a POST request.

It was just this function, which I called repeatedly via http:

Moralis.Cloud.define("Hello", (request) => {
return `${request.params.name}`
});

Is that the kind of test you were asking me to do?

I don’t know where from you called this function, as in from another cloud function or directly form the sdk or local computer. What I wanted to say was closer to call it from another cloud function.

I was calling it over http like you asked. If you want me to run something specific I’m happy to, just send me the code

The idea is to make a http request from a cloud function. Similar on how you made a http request to call web3api with the api key. Now I’m thinking that it is something related to http requests made from a cloud function and not to web3api in particular.

I wasn’t using cloud functions when I posted this thread, I was using the sdk calling getBlock.

Yes, I know, but it seems that same problem happens when you call web3api from a cloud function by making a http request. That was my understanding.

Yes it happens when calling getBlock both ways. It’s not specific to using cloud functions.

The problem doesn’t happen when calling a cloud function that does basically nothing.

My assumption now is that it should happen also when calling a cloud function that makes a http request but not necessarily a http request to we3api.

Ok well I’ll let you do your testing. Let me know if you need anything from me