Skip to content
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

关于_test_speed的优化建议 #827

Open
azluck opened this issue Sep 27, 2018 · 1 comment
Open

关于_test_speed的优化建议 #827

azluck opened this issue Sep 27, 2018 · 1 comment

Comments

@azluck
Copy link

azluck commented Sep 27, 2018

在QATdx_adv.py中有服务器测速的函数_test_speed在api_worker被一个ip列表循环调用,然后将小于0.1的服务器都创建客户端连接。这里可优化为异步的方式,应该可以减少测速耗时。另外,如果在某些地区或因网络原因,很可能会造成没有小于0.1的服务器,所以能不能将服务器IP改成优先队列PriorityQueue,这样如果服务器速度快的空闲的话,就有机会被使用。在实际使用时可定期维护一下这个服务器IP队列。
还有,是否可以仅测试连接时间(以前我是这样用的,但也有可能存在连接成功,但获取数据比较慢的情况),而不get_security_list,或者改成get_security_count(0)也可提升一下速度。

@yutiansut
Copy link
Owner

暂时不能用异步 有兼容性问题

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants