无法创建新线程,因为任务队列已达到最大限制 5000
我在计划任务中使用了相当多的 cfthreads(因为否则 cf 会耗尽内存),现在我收到以下错误:
无法创建新线程,因为任务队列已达到最大值 限制 5000。
所以这是我的问题:
- “任务队列”到底是什么,文档在哪里?
- 我如何增加这个限制?
- 如何动态确定限制是多少?队列中已有多少线程?
I'm using quite a few cfthreads in a scheduled task (because cf runs out of memory otherwise), and now I'm getting the following error:
Cannot create a new thread because the task queue has reached it maximum
limit 5000.
So here are my questions:
- what is the "task queue" exactly, and where are the docs?
- how do I increase this limit?
- how can I determine what the limit is dynamically? and how many threads are already in the queue?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
为什么不使用我提供的 run-join 习惯用法作为您的另一个问题的答案: 一个任务中有很多查询来生成 json?如果您正在寻找异步工作,您可以更改该代码示例以创建多个线程,然后加入。此外,拥有与您的问题描述一样多的线程实际上会减慢速度,因为服务器花费了太多时间在线程之间进行上下文切换。
Why not use the run-join idiom I provided as an answer to another question of yours: many queries in a task to generate json? You could alter that code example to create several threads and then join if you're looking for things work asynchronously. In addition, having as many threads as your question describes actually slow things down because the server spends too much time context switching between threads.
看起来该限制是无法更改的内置限制。
不过,上面的消息是一条错误消息,因此您可以将 cfthread 包装在 cftry 中以找出何时达到限制。
It looks like the limit is a built-in limit that cannot be changed.
The message above is an error message though, so you could wrap the
cfthread
in acftry
to find out when the limit is reached.