在大查询中续集阻止节点事件循环
最近,我们一直注意到应用程序的不良性能,并使用blocked-at
软件包发现semelize(v5.22)正在阻止大型查询的节点事件循环。
特别是查询并不复杂,只有foomodel.findall(someOptions)
,也没有任何连接。只是结果可能最多可达100k行。
是否有一些已知的方法可以提高性能,或者至少确保事件循环不会被阻止?
Recently we've been noticing bad performance of our app, and using the blocked-at
package found that Sequelize (v5.22) is blocking the node event loop on large queries.
The query in particular isn't complicated, just FooModel.findAll(someOptions)
, without any joins either. It's just that the result could be up to 100k rows.
Are there some known methods to improve performance, or at least ensure that the event loop won't be blocked?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
用阻止的AT进行进一步的测试表明,它给出的痕迹并不总是100%准确。有时,它表示将控件返回事件循环的点,而不是导致事件循环阻塞的任务。
就我而言,问题不是foomodel.findall,而是在此之前进行的一些逻辑。
Further testing with blocked-at has shown that the trace it gives isn't always 100% accurate. It sometimes indicates the point at which control was returned to the event loop, instead of the task that caused the event loop to be blocked.
In my case, the issue wasn't FooModel.findAll, but some logic before that.