-
Notifications
You must be signed in to change notification settings - Fork 740
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
最大只能开启16个线程,怎么解除限制?无法利用64核心 #481
Comments
嗯 你是指哪个线程池?是http服务的核心线程池?还是AndServer的服务?AndServer服务只需要一个线程就够了,主要是维持http传输的线程,这块代码不是你贴的这些。主要是要表达清楚你的诉求,为什么要跑满之类的,我可以改代码做支持。 |
谢谢大佬。最近出了事没有看。
为什么要跑满:因为每次访问http都需要执行我的代码计算10秒钟。当并发访问http://127.0.0.1/jisuan的时候,希望能利用上所有64个cpu,而不是只有16个核工作,其他核心都空闲的 |
明白了,我抽空搞搞。 |
静候老大的好消息 |
现在v2.1.11版本,我测试64个线程,都是能同时连接上AndServer的,用的Apche Jmeter工具测试的 |
我的服务器是64核心的, 我有64个线程并发访问,但是只能跑满16个cpu,其他cpu全部空闲,怎么解决这个问题?
我找到了创建线程的代码,发现并没有限制线程数量:
private Executors() {
mService = java.util.concurrent.Executors.newCachedThreadPool();
mHandler = new Handler(Looper.getMainLooper());
}
The text was updated successfully, but these errors were encountered: