depyronick / clickhouse-client

ClickHouse Client for NodeJS
https://clickhouse.js.org
MIT License
49 stars 11 forks source link

memory leak #18

Closed philkunz closed 1 year ago

philkunz commented 2 years ago

Monitoring revealed that there seems to be a memory leak somewhere in here. Have you monitored your services over longer periods of time?

depyronick commented 2 years ago

hi @philkunz,

where do you experience the issue? on clickhouse, or the nodejs application that you're using the client with?

philkunz commented 2 years ago

node.js. -> I have a grafana dashboard showing me memory usage and cpu usage of our services. After integrating this package I noticed a steady increase in both CPU and Memory usage. I looked into the source code and noticed you are using brotli. There are other issues on Github (like here https://github.com/Alorel/shrink-ray/issues/49) where Brotli is potentially responsible for memory leaks.

philkunz commented 2 years ago

I reimplemented the http client quickly, and the service is not showing any memory leaks with that: https://gitlab.com/pushrocks/smartclickhouse/-/blob/master/ts/smartclickhouse.classes.httpclient.ts

depyronick commented 2 years ago

Have you tried explicitly setting the compression option to ClickHouseCompressionMethod.GZIP to see if it makes any change?

depyronick commented 1 year ago

Please try 2.0.0 and reopen the issue if still occurs.