node-clinic icon indicating copy to clipboard operation
node-clinic copied to clipboard

no Userland area in bubbleporf

Open alvinlys opened this issue 4 years ago • 10 comments

Hi, my bubbles shows Userland is disabled, does that implies all the issue is coming from native nodejs? image

alvinlys avatar Mar 26 '22 15:03 alvinlys

It depends on several factors:

  • Are you generating load to your application?
  • For how much time?
  • Node version?
  • Can you create a minimal reproducible code?

RafaelGSS avatar Mar 26 '22 16:03 RafaelGSS

Thank you and really appreciate on your help.

  • Are you generating load to your application?

Yes, i did use autocannon of 500 requests, but it happened every time i profile

  • For how much time?

30s, but happened every time too

  • Node version?

v16.14.2

  • Can you create a minimal reproducible code?

Here is the sample of my code

alvinlys avatar Mar 27 '22 03:03 alvinlys

Here is the sample of my code

The code you uploaded looks invalid (https://github.com/alvin30595/gist-1/blob/main/app.js#L4), can you create a minimal reproducible code?

Just an important note, I've noticed that most of your code makes assumptions on some transpiler (webpack, for instance), remember to profile your application after the transpilation. The clinic.js must run against the code that runs in production.

RafaelGSS avatar Mar 27 '22 16:03 RafaelGSS

  • May i know what do you mean by invalid code? I do upload some changes on it by ensuring no error when start node app
  • I do not use any webpack and those code is actually production code

alvinlys avatar Mar 27 '22 16:03 alvinlys

May i know what do you mean by invalid code?

This import is invalid:

import EventEmitter from '#root/configs/event.js'

RafaelGSS avatar Mar 28 '22 11:03 RafaelGSS

I dont think there is any issue on it as i could start the node application. the #root actually is a Subpath imports mentioned in package.json file, and i used ESM ways to import. Pls do correct me if i'm wrong, open for discussions

alvinlys avatar Mar 28 '22 13:03 alvinlys

> nodemon app.js

[nodemon] 2.0.15
[nodemon] to restart at any time, enter `rs`
[nodemon] watching path(s): *.*
[nodemon] watching extensions: js,mjs,json
[nodemon] starting `node app.js`
[ioredis] Unhandled error event: ClusterAllFailedError: Failed to refresh slots cache.
    at tryNode (/home/rafaelgss/repos/os/tests/gist-1/node_modules/ioredis/built/cluster/index.js:401:31)
    at /home/rafaelgss/repos/os/tests/gist-1/node_modules/ioredis/built/cluster/index.js:418:21
    at /home/rafaelgss/repos/os/tests/gist-1/node_modules/ioredis/built/cluster/index.js:677:24
    at run (/home/rafaelgss/repos/os/tests/gist-1/node_modules/ioredis/built/utils/index.js:157:22)
    at tryCatcher (/home/rafaelgss/repos/os/tests/gist-1/node_modules/standard-as-callback/built/utils.js:12:23)
    at /home/rafaelgss/repos/os/tests/gist-1/node_modules/standard-as-callback/built/index.js:33:51
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
Error: connect ECONNREFUSED 127.0.0.1:3306
    at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1187:16) {
  errno: -111,
  code: 'ECONNREFUSED',
  syscall: 'connect',
  address: '127.0.0.1',
  port: 3306,
  fatal: true
}
WORKERPOOL started
[ioredis] Unhandled error event: ClusterAllFailedError: Failed to refresh slots cache.
    at tryNode (/home/rafaelgss/repos/os/tests/gist-1/node_modules/ioredis/built/cluster/index.js:401:31)
    at /home/rafaelgss/repos/os/tests/gist-1/node_modules/ioredis/built/cluster/index.js:418:21
    at /home/rafaelgss/repos/os/tests/gist-1/node_modules/ioredis/built/cluster/index.js:677:24
    at run (/home/rafaelgss/repos/os/tests/gist-1/node_modules/ioredis/built/utils/index.js:157:22)
    at tryCatcher (/home/rafaelgss/repos/os/tests/gist-1/node_modules/standard-as-callback/built/utils.js:12:23)
    at /home/rafaelgss/repos/os/tests/gist-1/node_modules/standard-as-callback/built/index.js:33:51
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
[ioredis] Unhandled error event: ClusterAllFailedError: Failed to refresh slots cache.

Your code has a pre-configuration, I can't run it locally. Can you please create a Minimal, reproducible example?

RafaelGSS avatar Mar 28 '22 16:03 RafaelGSS

Thanks again for helping me. However, may I know how should I provide an example when my code would require redis and database, shall I provide the credentials to redis and database or provide an docker-compose file?

alvinlys avatar Mar 29 '22 01:03 alvinlys

Try to create an application from scratch mocking those services, thus, I will be able to see in which part of your code is the bug

RafaelGSS avatar Mar 29 '22 02:03 RafaelGSS

image

i had removed most of the unnecessary code & able to test locally without any dependencies. Things get interesting that with the new code, clinic doctor report "Event Loop issue: Event Loop Utilization" instead of previous "I/O issue: CPU Usage"

alvinlys avatar Mar 29 '22 08:03 alvinlys