Health Check

Hi,

How can we monitor the health of our backend?
Sometimes, requests take much longer than normal and we don’t know how to monitor the backend health and monitor this.
Our backend is inconsistent now that we’ve launched on the app store for some users and some are having timeouts and unusual errors.

Innocent.

Hi @Innocent_Nwaukwa

Do you use our Cloud installation or Pro?
Could you please provide more details about these errors?

We use Cloud 99.
Requests work perfectly sometimes and other times, they take significantly longer to complete.
This varies on different days but is seemingly random.
Also, we have more users and sometimes, requests have errors.
200 response with 10 users and then a 500 with 1 (this is not specifically the error rate, just a minor illustration); essentially, requests aren’t processed consistently but the main issue seems to be that requests take longer sometimes.

hello @Innocent_Nwaukwa

please share with us the response when you got 500 errors.

Also to explain or fix something we need the steps to reproduce it. Please provide examples of long time requests.

I’d say the main issue that can be recreated is around our /castVote endpoint.

Application ID: E655DC15-398E-A358-FFC1-1D414D006C00

It returns a response under 5 seconds most times.
But there are just times in the day (with no traffic) where it returns a response after over 10 seconds and gives a timeout error.

Hello @Innocent_Nwaukwa,

Can we call the /castVote endpoint in your app for our tests?

Regards,
Olha

Yup, feel free.
Just do so using new User objects and let us know which ones those are.
We have real users using the app and don’t want them affected.

Innocent.

Hello,

I looked through the implementation of the “castVote” method and saw that it has a rather high number of API requests and a bunch of logging (which also translates to API calls). It is not a surprise that sometimes it make take longer than 5 seconds, the function is indeed quite long in terms of what it does.

Whenever it happens that the function doesn’t finish under 5 seconds, it is not a sign of the backend being unhealthy, but a fact that the app runs in a shared hosting environment such as Backendless Cloud. The resources of the system are divided between multiple apps. At times we allocate additional resources when a surge occurs. These resources may not be instantly available since they need to be procured. As a result, invocations of methods with higher than-average complexity (in terms of the number of API calls) may take longer to execute. A remedy for this is to purchase a function pack that provides a longer runtime Cloud Code duration for the invocations.

Regards,
Mark

There we go!
I figured that resources were being reallocated.
Yeah, the castVote endpoint is due for a refactor but just wanted to know why the response times may fluctuate.

Thanks again for the help Mark!

Innocent.