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

多条订阅数据异常 #323

Open
kuhot opened this issue May 24, 2024 · 2 comments
Open

多条订阅数据异常 #323

kuhot opened this issue May 24, 2024 · 2 comments

Comments

@kuhot
Copy link

kuhot commented May 24, 2024

book_ticker多条订阅异常

直接使用book_ticker函数进行订阅,6条订阅以上就会发生异常,报CLOSE frame received, closing websocket connection。
my_client = SpotWebsocketStreamClient(on_message=message_handler)
my_client.book_ticker(symbol="btcusdt")
my_client.book_ticker(symbol="ethusdt")
my_client.book_ticker(symbol="bnbusdt")
……

subscribe组合订阅异常

my_client.subscribe(stream=['btcusdt@bookTicker','ethusdt@bookTicker','bnbusdt@bookTicker',......])

def message_handler(_, message):
print(message)

当8条以上订阅时 'a','b'价格更新慢,不准
2024-05-24 19:36:39 3466 {'u': 47341739062, 'a': '68943.15000000', 'b': '68943.14000000', 'A': '8.48391000', 'B': '0.11000000'}
2024-05-24 19:36:39 3467 {'u': 47341739124, 'a': '68941.77000000', 'b': '68940.06000000', 'A': '0.26766000', 'B': '0.00295000'}
2024-05-24 19:36:39 3468 {'u': 47341739236, 'a': '68940.07000000', 'b': '68940.06000000', 'A': '6.73170000', 'B': '0.00295000'}
2024-05-24 19:36:39 3469 {'u': 47341739238, 'a': '68940.07000000', 'b': '68940.06000000', 'A': '6.95500000', 'B': '0.00295000'}
2024-05-24 19:36:39 3474 {'u': 47341739310, 'a': '68940.07000000', 'b': '68940.06000000', 'A': '7.78406000', 'B': '0.00295000'}
2024-05-24 19:36:39 3476 {'u': 47341739347, 'a': '68939.97000000', 'b': '68939.96000000', 'A': '3.26244000', 'B': '0.05171000'}
2024-05-24 19:36:39 3477 {'u': 47341739388, 'a': '68938.47000000', 'b': '68938.46000000', 'A': '1.07844000', 'B': '0.02900000'}
2024-05-24 19:36:39 3478 {'u': 47341739419, 'a': '68938.47000000', 'b': '68938.46000000', 'A': '5.12102000', 'B': '0.04351000'}
2024-05-24 19:36:39 3479 {'u': 47341739467, 'a': '68938.47000000', 'b': '68938.46000000', 'A': '7.06186000', 'B': '0.43962000'}
2024-05-24 19:36:39 3501 {'u': 47341739526, 'a': '68938.47000000', 'b': '68938.46000000', 'A': '7.06186000', 'B': '0.04351000'}
2024-05-24 19:36:39 3502 {'u': 47341739527, 'a': '68938.47000000', 'b': '68938.46000000', 'A': '7.22566000', 'B': '0.04351000'}
2024-05-24 19:36:39 3503 {'u': 47341739536, 'a': '68938.47000000', 'b': '68938.46000000', 'A': '7.22566000', 'B': '0.25329000'}
2024-05-24 19:36:39 3530 {'u': 47341739601, 'a': '68938.47000000', 'b': '68938.46000000', 'A': '8.06935000', 'B': '0.25329000'}
2024-05-24 19:36:39 3546 {'u': 47341739638, 'a': '68938.47000000', 'b': '68938.46000000', 'A': '8.06975000', 'B': '0.25329000'}

当12条以上订阅时 'a','b'价格不更新
2024-05-24 19:36:48 8121 {'u': 47341745055, 'a': '68911.68000000', 'b': '68911.67000000', 'A': '5.60380000', 'B': '1.78247000'}
2024-05-24 19:36:48 8138 {'u': 47341745056, 'a': '68911.68000000', 'b': '68911.67000000', 'A': '6.15831000', 'B': '1.78247000'}
2024-05-24 19:36:48 8181 {'u': 47341745062, 'a': '68911.68000000', 'b': '68911.67000000', 'A': '6.17791000', 'B': '1.78247000'}
2024-05-24 19:36:48 8194 {'u': 47341745066, 'a': '68911.68000000', 'b': '68911.67000000', 'A': '6.17791000', 'B': '1.78207000'}
2024-05-24 19:36:48 8209 {'u': 47341745068, 'a': '68911.68000000', 'b': '68911.67000000', 'A': '6.17791000', 'B': '1.78168000'}

Environment

Provide any relevant information about your setup, such as:

  • Version of binance-connector-python
  • Python version 3.10.12
  • Operating system ubuntu22.04 2cpu 4G

有什么办法可以多个币订阅不卡吗?我看案例还有instant_subscribe,现在找不到了

@kuhot
Copy link
Author

kuhot commented May 25, 2024

第一个问题知道了,Websocket服务器每秒最多接受5个消息。

@kuhot
Copy link
Author

kuhot commented May 25, 2024

第二个问题突然好了,但是订阅数量好像170个,再多就全都没数据了?

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

No branches or pull requests

1 participant