-
Notifications
You must be signed in to change notification settings - Fork 31
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
性能恶劣? #80
Comments
还有很大上升空间啊😂。
|
我在 linux x86_64 测了下,把线程数放开后,Rust 版性能比 C 版,好差不多 30 %(但会丢失一小部分的查询) 你重新再测一下? C 版 Rust 版,工作线程数,可用下面的方式配置,使用的线程数量,默认是 CPU 的核数 num-workers 4 Line 1684 in fea125c
Sets the number of worker threads the Runtime will use. This can be any number above 0 though it is advised to keep this value on the smaller side. This will override the value read from environment variable TOKIO_WORKER_THREADS. The default value is the number of cores available to the system. When using the current_thread runtime this method has no effect. |
新版编译不过去。。。坑 |
什么问题? |
|
#105 这个 PR 先修复,禁用设备绑定了。这个库 https://github.com/rust-lang/socket2 居然有问题 不会再出现此类编译问题了,已经加了 #107 CI 检查,代码合并前,得通过这些检查。 |
似乎无改善
不过确实是四个线程了 |
无改善? 看你上面的意思你限制了4个线程?之前就是锁死了四个线程。 上面说 |
我2核,,,不配置就是2线程。那么配置4线程cpu使用量是30%,我改成16试了cpu使用量仍是30%,但确实是16个线程了。 他那个测试脚本是重复测www.baidu.com,原则上应该完全命中缓存。但是脚本运行时看到有5Mbps的入站流量,感觉似乎完全没有命中缓存。 |
那就奇怪了,为啥你电脑30%,cpu 利用率上不去难道卡在入站流量上了? |
rust-lang/libc 昨天发布0.2.141 release了说修复了编译问题 |
看了一下上端路由器的状态。性能测试时连接数满(6万多),大概一半是icmp连接。可见是缓存完全没有命中,时间都耗费在查询和测速上了。带宽占用大概5Mbps。 |
使用dnspref测试,脚本参考 pymumu/smartdns#1337 (comment)
受cpu性能限制,c++查询效率大约每秒2万次(目标5万次),cpu使用率90%以上 pymumu/smartdns#1337 (comment)
rust版采用相同配置,查询效率大约每秒2百次,cpu使用率约20%。
·测试结果符合预期吗?
·如何提高运行效率(比如更换编译器、静态链接、增加内存)?
The text was updated successfully, but these errors were encountered: