简体   繁体   中英

How to profile nodejs app for memory leaks inside docker container?

I have developed a nodejs app with mongo connectivity.

I have deployed both mongo and node app in different containers.

I am deploying these containers using docker-compose up .

Now I want to profile those containers for memory profiling , http requests ?

I found about docker stats ,but it only gives container statastics.

I want to profile those apps for memory leaks and other stuff.

Any inputs?

I would suggest using pm2 : process manager for Node.js .

I did the following for my node App.

I deployed my node app inside a container built on official node image.then I connected this node app to mongodb container.

Now using pm2 I could track memory usage and other aspects of performance easily. It also has keymetrics dashboard where you can directly track resource allocations for your processes which are running docker containers.

Hope this helps.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM