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

Statistics for all available channels? #54

Closed
approxit opened this issue Jul 10, 2017 · 7 comments
Closed

Statistics for all available channels? #54

approxit opened this issue Jul 10, 2017 · 7 comments

Comments

@approxit
Copy link

Having global_statistics() and channel_statistics() is actually the only way to figure out what's going on with channels performance with asgi_redis. The problem with channels_statistics() - it's hard to get statistics about response channels, that can be full too.

Playing with performance tuning and a little bigger scale (~200 websocket connections, 6 daphnes, 12 workers) is it very hard to measure lack of daphnes or lack of workers.

Is there any way to get statistics about all available channels?

@proofit404
Copy link
Member

I don't think there are any special statistic methods for reply channels.

Probably the most useful way will be to run stress test against a real project. Compare how many time was spent inside consumer against total message processing time must give you proper insight.

@andrewgodwin
Copy link
Member

channel_statistics is particularly unhelpful for response channels, I agree, but we can't list all channels as that in itself might be very slow, especially if things are sharded. If you could give examples of the sort of things you might want to know, we can think about ways to get them semi-efficiently.

@approxit
Copy link
Author

My wet dreams would be have some kind of channels htop thing, to see actually everything about performance. Interface servers and their load, workers and their load, channels and their load. But we know how it is with dreams...

Right now I'm receiving tons of channel full messages on "daphne.response" and I realized that I'm totally blind on outgoing messages from channels server.

Current parameters like in channel_statistics are totally enough for making load charts, or trigger automatic deployment to spawn more traffic lifting, etc. I would love to have a little more sources.

I want to archive ability to know when I'm close to my capacity and act before error raises and messages are dropped. Anything that can tell me "that daphne instance can't handle more load" or "that websocket connection is way too heavy" would do the job perfectly.

@proofit404
Copy link
Member

I have plans to work on some kind of monitoring tool. I don't know what form it will have at the end. For now, I just have few thoughts.

Probably it will be a collection of predefined alerts for prometheus.io

Maybe this issue can be a sophisticated place to start this discussion.

@devenbhooshan
Copy link

@approxit 👍
Some of the alerts should be triggered when

  1. Average queuing time of the messages in certain channel is greater than X ms(during some interval)
  2. Y% (eg: 90%) of the channel capacity reached
  3. Average time taken by the workers listening to a particular channel is greater than Z ms.

@proofit404
Copy link
Member

@devenbhooshan Can you clarify some conditions for me?

  1. Is to broad, some channel layers don't expose current message number in the channel. This alert is nice to have, but maybe layer specific.
  2. What is the purpose of this alert?

@andrewgodwin
Copy link
Member

Statistics have been removed from channels_redis in version 2.0 as it's no longer used for sending HTTP request/response data and it's meant to be lighter-weight overall (plus the Redis key structure is now a lot simpler and easier to query with external scripts), so closing this.

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

4 participants