node.js - node.js 应用程序中的 epoll_pwait 是什么,我该怎么办?

标签 node.js profiling epoll

我的应用程序是棋盘游戏的网络版Settlers of Catan .

我正在使用 node --prof app.js配置应用程序和 node --prof-process ISOLATE_LOG_FILE > processed.txt把它们变成一个处理过的文件。

我确实收到了很多 Code move event for unknown code事件:https://prnt.sc/q69ugk

最后我留下了一个文件,如下所示:
Statistical profiling result from isolate-0x3df60c0-v8.log, (13113 ticks, 192 unaccounted, 0 excluded).
enter image description here

  • node.js上下文中的这个epoll_pwait是什么?
  • 为什么它使用了我应用程序的 60%?
  • 我该怎么办?
  • 最佳答案

    epoll_pwait本质上意味着您的应用程序(事件循环)正在等待某些东西,即 I/O 操作。
    引用上面的链接:
    调用 epoll_pwait()将阻塞直到:

       • a file descriptor delivers an event;
    
       • the call is interrupted by a signal handler; or
    
       • the timeout expires.
    

    为了进一步调试,我真正想到的是,如果您有任何 setInterval具有很少或零超时的代码,如果是这样,请发布您传递给间隔的回调函数。

    关于node.js - node.js 应用程序中的 epoll_pwait 是什么,我该怎么办?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59183930/

    相关文章:

    javascript - React 中两个组件的渲染之间的转换 [React-Spring]

    node.js - 如何在 package.json 中使用变量?

    python - 是否有 Python 的高级分析模块?

    sockets - golang epoll 发送消息后必须关闭套接字吗?

    linux - epoll_wait() 占用太多 CPU

    node.js - 了解回调

    javascript - 服务器路径的流程

    c - 使用 dtrace 分析 C 代码

    c# - 在 VS 2012 中分析

    linux - 当 fd 关闭时,我会收到 epoll 的通知吗?