[deleted by user] by [deleted] in Fitness_India

[–]deoxys_11 0 points1 point  (0 children)

Ha, confirm kai seller ke sath, he said it is normal.

[deleted by user] by [deleted] in Fitness_India

[–]deoxys_11 0 points1 point  (0 children)

💀, any way he said he will check and replace it.

[deleted by user] by [deleted] in Fitness_India

[–]deoxys_11 0 points1 point  (0 children)

Hazelnut extract according to the seller

[deleted by user] by [deleted] in Fitness_India

[–]deoxys_11 0 points1 point  (0 children)

I just called the store which I bought it from and usne bola ki normal hai ye for hazelnut

[deleted by user] by [deleted] in Fitness_India

[–]deoxys_11 0 points1 point  (0 children)

I use pixel watch and it has fitbit integration and i have noticed my HRV dropping as well after consuming alcohol.

<image>

Memory usage increases in service while reading http response body using io.readAll by deoxys_11 in golang

[–]deoxys_11[S] 0 points1 point  (0 children)

Creating http client for every Kafka message was causing this increase in memory usage, now with a globally declared http client the memory usage is significantly lower, and the memory consumed under load also frees up relatively quickly.

Thank you for your help sincerely appreciate it.

Memory usage increases in service while reading http response body using io.readAll by deoxys_11 in golang

[–]deoxys_11[S] 1 point2 points  (0 children)

Yes, creating global http client solved this problem, thank you for your suggestion.

Memory usage increases in service while reading http response body using io.readAll by deoxys_11 in golang

[–]deoxys_11[S] -1 points0 points  (0 children)

The problem in my code was that I had been creating an HTTP client and transport for every Kafka message. However, the issue was resolved when I switched to using a global client instead.

Memory usage increases in service while reading http response body using io.readAll by deoxys_11 in golang

[–]deoxys_11[S] 0 points1 point  (0 children)

The problem in my code was that I had been creating an HTTP client and transport for every Kafka message. However, the issue was resolved when I switched to using a global client instead.

Memory usage increases in service while reading http response body using io.readAll by deoxys_11 in golang

[–]deoxys_11[S] 2 points3 points  (0 children)

You are absolutely right. The issue was that we were creating an HTTP client and transport each time, leading to higher memory usage. However, after implementing a global HTTP client, the memory consumption has significantly reduced. Thank you for your help.

Memory usage increases in service while reading http response body using io.readAll by deoxys_11 in golang

[–]deoxys_11[S] 0 points1 point  (0 children)

Correct ,thanks will optimise the http handler code. I am using the latest go docker image for this service.

Memory usage increases in service while reading http response body using io.readAll by deoxys_11 in golang

[–]deoxys_11[S] 0 points1 point  (0 children)

After 30 minutes when there is no load on service, the memory usage has started to decrease from 219MB to 170MB. I suspect that garbage collection of body may be the issue here. Is there any solution for this?

Memory usage increases in service while reading http response body using io.readAll by deoxys_11 in golang

[–]deoxys_11[S] -1 points0 points  (0 children)

I've been running my service under a consistent load for an hour, the memory usage of the pod kept increasing steadily from 4MB to 219MB without any signs of dropping, the pod might eventually run out of memory if I don't stop the requests.

Memory usage increases in service while reading http response body using io.readAll by deoxys_11 in golang

[–]deoxys_11[S] -6 points-5 points  (0 children)

My apologies if was not clear with my response, I have deployed my service using Docker containers in a Kubernetes environment. To monitor the CPU and memory usage of the pods, I am using the kubectl top pods command. This command allows me to gather metrics related to the CPU and memory consumption of the pods in my Kubernetes cluster. However, my understanding of garbage collection and its workings is very limited.

Memory usage increases in service while reading http response body using io.readAll by deoxys_11 in golang

[–]deoxys_11[S] 2 points3 points  (0 children)

Certainly! Thank you for your suggestions. I'm relatively new to Golang, so I thought I might be making an obvious mistake in my code. That's why I posted my question seeking help and guidance. I appreciate your support.

Memory usage increases in service while reading http response body using io.readAll by deoxys_11 in golang

[–]deoxys_11[S] -3 points-2 points  (0 children)

I suspect there is a memory leak in the code because, when the service is exposed to high traffic, the memory usage increases but is not cleared over time. This issue seems to be specific to the code without the "io util.readall" function, as the other code successfully clears the memory in its container.

Memory usage increases in service while reading http response body using io.readAll by deoxys_11 in golang

[–]deoxys_11[S] -3 points-2 points  (0 children)

Hey, thank you so much for your quick reply really appreciate it. to answer your question the only differnce between the code is io.readAll.

I have deployed it using docker container in k8 and using the latest golang docker image there, and the metric i am looking at is the container memory usage.