Koenkk / zigbee-herdsman

A Node.js Zigbee library
MIT License
456 stars 277 forks source link

Increase concurrency to 16 in zStackAdapter #140

Closed ex3ndr closed 4 years ago

ex3ndr commented 4 years ago

I was in deep investigation why my network is sooo unresponsive some time, but it turns out that the bottleneck is concurrency in Queue in zStackAdapter.

Most of the operations are done almost immediately, but some are timeouts after 10(?) second that blocks this queue without any actual work done by controller.

Increasing this number made a huge impact on my setup and everything is super responsive.

I am not sure why this limitation was here in the first place, but with new CC26x2R1 chip it is possible to increase this concurrency dramatically.

Koenkk commented 4 years ago

Please add a check if this.version = zStack3x0 here, we dont want to increase this for the cc2531 e.g.

ex3ndr commented 4 years ago

Done!

Koenkk commented 4 years ago

Thanks!

james-fry commented 4 years ago

I was in deep investigation why my network is sooo unresponsive some time, but it turns out that the bottleneck is concurrency in Queue in zStackAdapter.

Most of the operations are done almost immediately, but some are timeouts after 10(?) second that blocks this queue without any actual work done by controller.

Increasing this number made a huge impact on my setup and everything is super responsive.

I am not sure why this limitation was here in the first place, but with new CC26x2R1 chip it is possible to increase this concurrency dramatically.

I hope this solves the "delay" issue I see in my network. Thanks!

gev commented 4 years ago

What about cc2538? Which value will be good for?

Koenkk commented 4 years ago

I guess it would also work for that, but currently we cannot distinguish between zStack 3 CC2531 and a zStack 3 CC2538, this has to be fixed in the firmware. @reverieline Could you set the product to 4 in the firmware?

reverieline commented 4 years ago

I guess it would also work for that, but currently we cannot distinguish between zStack 3 CC2531 and a zStack 3 CC2538, this has to be fixed in the firmware. @reverieline Could you set the product to 4 in the firmware?

Yes, shure.

gev commented 4 years ago

I've check queue length 16 for cc2538. All works as well!

gev commented 4 years ago

I suggest add queue length into controller constructor options

gev commented 4 years ago

Also, think, better to use productId instead znp version

ex3ndr commented 4 years ago

Can we make this configurable? I really want to play around with different values, it seems that such limitation is not needed at all.

gev commented 4 years ago

@ex3ndr see: I made concurrent configurable: https://github.com/Koenkk/zigbee-herdsman/pull/159

gev commented 4 years ago

need a help, can't understand why coverage tests have been failed