I think my server freezes randomly

I am noticing some weird behavior on my production server. Sometimes syncing stops but whenever I change something in cloud code that makes the server “refresh” it starts syncing again. Same when I restart the server. I need someone to look into it to see whats going on with the server. CPU and RAM doesnt show any high percentages.

Also subscriptions to live server keep reconnecting on my front end many times in short period of time.

just started moralis cli get logs and its also only showing “waiting for logs”

server url in case needed
https://kb5kpiz0r1ry.usemoralis.com:2053/server

taking a look now on that server

something is happening on the server, the server uses 100% CPU and RAM

it could be something from cloud code that uses that many resources

yea possible, but it started today and since the backend lacks debugging tools or any kind of metrics I can not seem to find out why exactly. Is there anyone that can narrow down the cause of this? Its a production server with lots of cores and ram, Im not sure how its possible that its overloaded

I don’t know how to narrow it down, try to add more debugging messages with logger.info, to see what functions are called, I can look in logs, but I don’t know what for to look in logs now

I tried putting in more logs and I basically now whats inside my cloud code but the logs doesnt get printed since the server keeps freezing preventing logs from beeing printed to console. Arent there any kind of admin tools that signal usage of internal functions?

we don’t have something for usage of internal functions

if you have enough logging, I can search for a specific string in logs

I have a feeling it might have something to do with my other issue that throwing an error inside beforeSave doesnt prevent the objects from beeing saved which might could cause overload but I can not test it yet. I followed the documentation by doing "throw “error message” which according to documentation should prevent saving but it doesnt.

I removed almost all my cloud code and also deleted all jobs from the server in order to find out why this server is busted. I deleted all documents inside all collections and I dont have any historical syncing going on. However, after deleting all documents, the collection gets new items stored in it with transaction hashes that have been 8+ hours old. SOmething is messed up and it seems the end user (myself in this case) can not make it work. I restarted 100 times, deleted all my cloud code even tho its a live application with real users. This is a nightmare rn.