Microservice is restarting very frequently

I have created a custom microservice and deployed in Mgt tenant and it has been subscribed by multiple tenant . Its getting lot of request to process from different tenant and seems to be ok on calculation side.
But it is starting very frequently like every hour .


Memory and CPU configuration

“isolation”: “MULTI_TENANT”,
“resources”: {
“cpu”: “1”,
“memory”: “1G”

Shall i increase Memory and CPU to handle the load ??

Thanks in advance for any help or though.

Regards,
Prakahs

Hi Prakash,

I would suggest establish monitoring to understand why your microservice is restarting, though if it is being restarted it is more likely related to memory than CPU. We have an article describing best practices around monitoring:

which links to two articles that show how to do monitoring for Python and Java microservices.

1 Like

The frequent restart of your microservice could have multiple reasons, most likely an out-of-memory issue or non-catched exception that is exiting the whole microservice.

Also as Harald suggested I would analyze the issue in more detail before taking any action. If you just increase the memory but still have a memory leak it is just a matter of time until the microservice will again run ouf-of-memory. Better would be to optimize the implementation to consume less resources e.g. async logic or releasing references to objects that are not needed any more and can be unloaded from memory.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.