clinicjs / node-clinic

Clinic.js diagnoses your Node.js performance issues
https://clinicjs.org
MIT License
5.67k stars 125 forks source link

Clinic heap triggers ECONNREFUSED #448

Closed Eomm closed 1 year ago

Eomm commented 1 year ago

Expected Behavior

Current Behavior

image

{"level":50,"@timestamp":"2023-04-11T06:46:17.072Z","pid":75359,"hostname":"MSpigolon-ITMAC21","err":{"type":"Error","message":"connect ECONNREFUSED ::1:50001","stack":"Error: connect ECONNREFUSED ::1:50001\n    at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1300:16)","errno":-61,"code":"ECONNREFUSED","syscall":"connect","address":"::1","port":50001},"msg":"connect ECONNREFUSED ::1:50001"}

Steps to Reproduce (for bugs)

  1. clone https://github.com/PacktPublishing/Accelerate-Web-Development-with-Fastify/
  2. cd './Accelerate-Web-Development-with-Fastify/Chapter 13'
  3. npm i
  4. cp .env.sample .env
  5. npm run mongo:start
  6. npm run clinic:heap --> Error: Cannot find module '/Users/mspigolon/workspace/_experiments/Accelerate-Web-Development-with-Fastify/Chapter' this is another bug, the space in the dir broke it.
  7. npm i clinic@12 -g
  8. npm i autocannon@7 -g
  9. so you can run clinic heap --on-port 'autocannon -d 20 -c 100 http://localhost:3000/todos-heap' -- node index.js to get the error above

Sample upload

NA

Environment

RafaelGSS commented 1 year ago

Can you try the --autocannon [ -d 20 -c 100 /todos-heap ] instead of --on-port script?

Eomm commented 1 year ago

Same output :(

image
jazelly commented 1 year ago

Error: Cannot find module '/Users/mspigolon/workspace/_experiments/Accelerate-Web-Development-with-Fastify/Chapter' this is another bug, the space in the dir broke it

I'll raise a PR to fix this

jazelly commented 1 year ago

Your localhost is treated as IPV6. Can you try with 127.0.0.1

Probably related with https://github.com/mcollina/autocannon/issues/481

Eomm commented 1 year ago

You made my day! It is working with the IP. I will remember it for long time!