- I share Mark's concern about the performance (latency, specifically)
implications for projects that want to keep deploying old-style, given
all the new serialization that would now be in the request path.
Hi Andrew,
- I share Mark's concern about the performance (latency, specifically)
implications for projects that want to keep deploying old-style, given
all the new serialization that would now be in the request path. I think
some further discussion of this, with real benchmark numbers to refer
to, is a prerequisite to considering Channels as a candidate for Django
1.10. To take a parallel from Python, Guido has always said that he
won't consider removing the GIL unless it can be done without penalizing
single-threaded code. If you think a different approach makes sense here
(that is, that it's OK to penalize the simple cases in order to
facilitate the less-simple ones), can you explain your reasons for that
position?
--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-develop...@googlegroups.com.
To post to this group, send email to django-d...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/CALMtK1Gz%3DaYMLyFW2da2C6Wo_-c_V2T_4p6K9eh0vwrKB91dKw%40mail.gmail.com.
--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-develop...@googlegroups.com.
To post to this group, send email to django-d...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/56730C8B.1050309%40oddbird.net.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/CAFwN1upm8N8tOhCdAgPEbYbBO6MU%2BmnEQ%3D%3Dp6EmW75%3DbNXHkfg%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/CALMtK1FOVa6K-MMsZ9vACfcw0w0KHwdCXJ2vxu7_Y5Q9PHJ6Gg%40mail.gmail.com.
To unsubscribe from this group and stop receiving emails from it, send an email to django-developers+unsubscribe@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/CALMtK1Gz%3DaYMLyFW2da2C6Wo_-c_V2T_4p6K9eh0vwrKB91dKw%40mail.gmail.com.
--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-developers+unsubscribe@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/CAFwN1upm8N8tOhCdAgPEbYbBO6MU%2BmnEQ%3D%3Dp6EmW75%3DbNXHkfg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to django-develop...@googlegroups.com.
To post to this group, send email to django-d...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/CALMtK1Gz%3DaYMLyFW2da2C6Wo_-c_V2T_4p6K9eh0vwrKB91dKw%40mail.gmail.com.
--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-develop...@googlegroups.com.
To post to this group, send email to django-d...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/CAFwN1upm8N8tOhCdAgPEbYbBO6MU%2BmnEQ%3D%3Dp6EmW75%3DbNXHkfg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to django-develop...@googlegroups.com.--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To post to this group, send email to django-d...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/CALMtK1FOVa6K-MMsZ9vACfcw0w0KHwdCXJ2vxu7_Y5Q9PHJ6Gg%40mail.gmail.com.
--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-develop...@googlegroups.com.
To post to this group, send email to django-d...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/9c7233b8-64b2-454a-8b13-1c8e33b77214%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/CAFwN1uoCX67D4E5J8n_wOo3VvPVjZYVnOG%2BshX6oDQk3zgu3vw%40mail.gmail.com.
I have a gut feeling this isn't going to work that well. The reasons include:- Backwards compatibility: how is a large site going to upgrade from 1.9 to 1.10?
- Complexity of setup.
- Error conditions: for example, what happens when an interface server sends a request to worker, and then dies (that is, the response channel has zero listeners). Similarly for chunked messages.
- Does the architecture really scale enough? The channel backend is going to be a bottleneck, it needs the ability to handle a huge amount of data and a huge amount of individual messages. In particular, the request channel is going to be contested. We know classic http scales, but is the same true for interface server architecture?
- Performance. Each request and response needs two additional network roundtrips. One to save to the channel server, one to fetch from the channel server. If the messages are large, this adds a lot of latency.
- Untested architecture: does any big site use this kind of architecture for all http handling?
A realistic test for this is to push a scalable amount of scalable sized requests through the stack. The stack should recover even if you shut down parts of the network, any single interface server, channel backend server or worker server. Of course, when a server or a part of the network recovers, the stack would need to recover from that. Compare the performance, simplicity of setup and ability to recover from error conditions to a setup with only classic Django http servers.I'm sorry if this feels negative. But, you are planning to change the very core of what a Django server is, and I feel we need to know with certainty that the new architecture really works. And not only that, it needs to be at least as good as classic http handling for existing users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/CALMtK1E4HLL5v-z4u7temEDh6WfBpa9mcOXOf%3D-nSpKWRV%3DJsA%40mail.gmail.com.
--
You received this message because you are subscribed to a topic in the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/django-developers/CZPvEE0WPi4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to django-develop...@googlegroups.com.
To post to this group, send email to django-d...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/CAFwN1uoUc7_-4XbterzhriSB9vLhJ3DLfqrSUH9iyMNyVwSD7A%40mail.gmail.com.
Anssi criticisms are fair and I feel that some of these responses are glossing over the details.
You've claimed this is the same or equivalent to a forked worker model but it isn't because there is no process management/link between the interface and worker and because you've chosen to make this network transparent. As much as you'd like to claim this isn't like Celery, the same issues that exist when trying to (ab)use Celery for blocking RPC calls is what you will have here.
> Then the response is dropped, the same way a WSGI worker drops a connection if it dies.It isn't entirely the same because in this channel case the worker doesn't know the client/interface dropped the connection. It's still working hard to generate a response which will sit in the response channel (Redis, memory, etc) until it expires (assuming that all backends expire channel messages). That doesn't happen in the current WSGI interface.
> All Django requests already involve multiple round trips to database servers, and the Redis backend at least is much quicker on the processing side.This isn't true. Database round trips are not a requirement for Django's current architecture. I'll concede that many views touch the DB but that's a choice of the developer, not Django's. When using channels the views will still need to make the same DB calls, though that processing happens at the worker. Putting Redis in between doesn't make it faster.
> You could make the same argument about not having separate load balancers and nginx serving static files - after all, you're just adding another network roundtrip to send traffic onward from the other server to Django.There are notable differences here. These are persistent HTTP connections and don't suffer from the same problem of client/server drops previously noted. They are also cacheable in a known way allowing round-trips or bandwidth to be avoided. Many Django applications will continue to use load balancers with channels. It can't be denied that channels introduce two more network round trips that didn't exist before. Trying to paint this as "we already talk over the network, so what's a couple more" is not a compelling argument to me.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/CAG2P6nRSPW04heEaDj2rgNu77kgKNb9s1jP_kiL1M5P4XQ12jg%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/CAFwN1uo8p3R-8pZBk%3DdbhYrqiWdjzN8f%2BbTz4-r9yEZUb0KBeQ%40mail.gmail.com.
> You seem to be assuming I'm here to foist a brand new middle layer on everyone; I'm not. I'm here to make one that fits neatly into Django, that I think most people will want to turn on, and that provides a lot of value in exchange for a slight round-trip performance hit - my goal is sub-5ms, and preferably sub-3. If it starts being 10/20/30 milliseconds of cost, then we'll have to change our approach until it's acceptable.Yes that's how I read this plan and that's why I think it needs some clarity. I didn't mean for this to turn into a long discussion about performance. This was meant to be a discussion about the transition plan. To go back to my original message, I see no gain for existing WSGI applications to have this on by default, even using the in-memory channel, when they upgrade to 1.10 (or whenever this lands). The current plan reads as though it will.
From what you are saying above this sounds more like a django.contrib.channels than a django.core.channels. Either way I feel the plan should provide more clarity in that regard.
Andrew, I thank you for your patience and civility in these discussions. I know this is something you've been working hard on and I'm not trying to be needlessly critical of your work.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/CAG2P6nS68Zd1zU3o898VTEtkOVgp_YVYDA%2B_axh%3D0u_EjzdaZA%40mail.gmail.com.
On Fri, Dec 18, 2015 at 3:44 PM, Mark Lavin <markd...@gmail.com> wrote:> You seem to be assuming I'm here to foist a brand new middle layer on everyone; I'm not. I'm here to make one that fits neatly into Django, that I think most people will want to turn on, and that provides a lot of value in exchange for a slight round-trip performance hit - my goal is sub-5ms, and preferably sub-3. If it starts being 10/20/30 milliseconds of cost, then we'll have to change our approach until it's acceptable.Yes that's how I read this plan and that's why I think it needs some clarity. I didn't mean for this to turn into a long discussion about performance. This was meant to be a discussion about the transition plan. To go back to my original message, I see no gain for existing WSGI applications to have this on by default, even using the in-memory channel, when they upgrade to 1.10 (or whenever this lands). The current plan reads as though it will.I agree - that was my original intention and how the current version of channels works, but it's no longer my plan, and I should update the integration plan to be more specific and discuss things like introducing different HttpRequest subclasses other than WSGIRequest.
[Note: I have not read all the channels docs, sorry if some of these points are covered there.]
On a packaging note, is there a way to use django[channels] type syntax like flask does? I'm not familiar with the restrictions of this but it may remove the need for try/except imports.
I'm also curious about what a "small scale" deployment of channels would look like. It has features which are useful to small sites which deploy on a single server or heroku dyno. It would be great to be able to run a complete channels stack with in memory communication with a single process start - something as easy as gunicorn wsgi.py. I know you are intending this to be possible for users not using channels, but when it has features so useful for modern web apps like tasks and websockets, getting a no-setup deploy of this working would be a huge win over celery/other systems. Obviously you would lose the no down time deploys here.
I've said this in person to you, but I think a REDIS_SERVERS setting like DATABASES would be a hugely useful feature for django independently of channels, especially if it supported tests well. I'm yet to find a third party app which does this well.
Testing in general is an interesting question - how do you envisage a test environment would run? Would self.client go straight to the consumer? How would you test the channel setup? Will there be test utilities to test, say, that a given message has been sent to a given channel without consuming it?
You talk about being able to load balance between backend tasks and requests. Is there am easy way to not do this in a multi server setup, where say image processing is on a box with far more RAM than is needed for a request processing box?
Have you considered a means of asking the channels system how much load it is under so that systems could do intelligent autoscaling?
Marc
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/CAFwN1urUZvhN49C%3D0GAUK6YxjiyUp5NJpE58j7qgtke6fekvNg%40mail.gmail.com.
For 1.10, my vote goes to time based releases, that is, we don't decide at this point what must be in 1.10.
- Anssi--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-develop...@googlegroups.com.
To post to this group, send email to django-d...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/CALMtK1G-bC56UR-SKQfWujSxb%3DLe4WXedYj3bGRasfFkDWLn0g%40mail.gmail.com.
I've said this in person to you, but I think a REDIS_SERVERS setting like DATABASES would be a hugely useful feature for django independently of channels, especially if it supported tests well. I'm yet to find a third party app which does this well.
[Note: I have not read all the channels docs, sorry if some of these points are covered there.]
On a packaging note, is there a way to use django[channels] type syntax like flask does? I'm not familiar with the restrictions of this but it may remove the need for try/except imports.
I'm also curious about what a "small scale" deployment of channels would look like. It has features which are useful to small sites which deploy on a single server or heroku dyno. It would be great to be able to run a complete channels stack with in memory communication with a single process start - something as easy as gunicorn wsgi.py. I know you are intending this to be possible for users not using channels, but when it has features so useful for modern web apps like tasks and websockets, getting a no-setup deploy of this working would be a huge win over celery/other systems. Obviously you would lose the no down time deploys here.
I've said this in person to you, but I think a REDIS_SERVERS setting like DATABASES would be a hugely useful feature for django independently of channels, especially if it supported tests well. I'm yet to find a third party app which does this well.
Testing in general is an interesting question - how do you envisage a test environment would run? Would self.client go straight to the consumer? How would you test the channel setup? Will there be test utilities to test, say, that a given message has been sent to a given channel without consuming it?
You talk about being able to load balance between backend tasks and requests. Is there am easy way to not do this in a multi server setup, where say image processing is on a box with far more RAM than is needed for a request processing box?
Have you considered a means of asking the channels system how much load it is under so that systems could do intelligent autoscaling?
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/CAMwjO1EP5Hjx0sj5eQxV83ZEyZ0-ATPNP1RQn2VuxEizEt96yA%40mail.gmail.com.