Memory leaks
I run for a month, I find it memory is 4.9 G, hope the author can help to look at, thank you!
Which backend do you use?
On Sat, Apr 1, 2017, 03:21 huwenzheng [email protected] wrote:
I run for a month, I find it memory is 4.9 G, hope the author can help to look at, thank you!
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/kelseyhightower/confd/issues/550, or mute the thread https://github.com/notifications/unsubscribe-auth/AQFc8zOiFCEMqz6w13XjBUR8_igTMOToks5rraaagaJpZM4MwTeB .
zookeeper watch model
Hmm. How did you measured confds memory usage? Top is not reporting the accurate memory usage of your application for example.
On Sat, Apr 1, 2017, 08:47 huwenzheng [email protected] wrote:
zookeeper watch model
— You are receiving this because you commented.
Reply to this email directly, view it on GitHub https://github.com/kelseyhightower/confd/issues/550#issuecomment-290900652, or mute the thread https://github.com/notifications/unsubscribe-auth/AQFc8-T0o_1hnJZBsgTgrDooVFABrv2mks5rrfLpgaJpZM4MwTeB .
"top | grep confd" the confd memory is 4.9G 。when i restart it , it ok
and sometimes the cpu is very hight (300% ~ 500%), i don't fond sleep function in "for" loop and not have runtime.GC() function.
There maybe some problems in the implementations:
https://github.com/kelseyhightower/confd/blob/master/backends/zookeeper/client.go#L99
This may lead to a goroutine leak: when multiple keys are changed in a WaitPrefix call, more than one goroutines may try to write to the response channel, but the calling routine only receives one of them, leaving others to be blocked indefinitely.
Another problem may be
https://github.com/kelseyhightower/confd/blob/93c8904baa404add44565be4e42716eb391f83f9/backends/zookeeper/client.go#L86
Watches are set for every key in every loop, but most of them are not triggered. This may leave a lot of channels open.
And there are also other problems like changes are missing. I don't know how to fix all of these...
We have an intensive CPU usage too using confd with ZooKeeper. More or less 5 processes are using near 100% of CPU until we restart the service.
Version:
confd 0.16.0 (Git SHA: 7217b0c, Go Version: go1.12)