Earlier quoted context omitted.
Django hasn't stopped insisting on that... v1.5 might have pooling, but it's taken them a long time to get connection pooling in.
Forgive my ignorance, but isn't this the point of something like pgpool? I didn't think connecting to a connection pool would be as expensive as connecting to the database itself (if it is, then my next question would be: What's the point of a connection pool? Because clearly I've missed something one way or the other).
10 000 concurrent real-time connections to Django
31–40 of 40 posts
Re: 10 000 concurrent real-time connections to Django
#32Earlier quoted context omitted.
By "implemented", do you mean "contributed to trunk", or "used it in my application"? If the former, thanks, if the latter, I was under the impression that it was on by default in 1.5?
Looks like it will be available in the next (1.6?) release[1]. [1] https://docs.djangoproject.com/en/dev/ref/databases/#persist...
Re: 10 000 concurrent real-time connections to Django
#33Earlier quoted context omitted.
Because it's a popular, well-written framework with a huge volume of existing code, and integrating WebSockets into Django means you don't have to maintain two codebases if you want to have a realtime Django app. Also, it's fun.
how much of that existing code has any application in a websocket context.. if it uses the orm layer throw it out.. if it uses the template layer.. optionally throw it out for efficiency (jinja and friends).. what are you really left with... routing.. trivial.. a familiar api with the guts out.. overrated and a hobgoblin of consistency.
In the long run they might build tulip-awareness into the ORM.
For that matter I start Tornado servers with management commands just for convenience...
Re: 10 000 concurrent real-time connections to Django
#34The C10K problem[1] is about real clients accessing real web servers, not about writing short strings over WebSocket. I'll associate "C10K" and "Django" when I'll see a dynamic web page being served using the template system, the standard middleware and the ORM (with the default behavior of creating and destroying a database connection for each request). [1] http://www.kegel.com/c10k.html
Why would you insist on creating and destroying a db connection on each request? We stopped doing that decades ago.
Re: 10 000 concurrent real-time connections to Django
#35Earlier quoted context omitted.
how much of that existing code has any application in a websocket context.. if it uses the orm layer throw it out.. if it uses the template layer.. optionally throw it out for efficiency (jinja and friends).. what are you really left with... routing.. trivial.. a familiar api with the guts out.. overrated and a hobgoblin of consistency.
In my opinion there is nothing wrong with doing simple Django ORM calls even with a tornado/gevent websocket. Async purists will cry foul, but if all you want is a realtime feature, you can block for a few milliseconds without getting into trouble. In the long run they might build tulip-awareness into the ORM. For that matter I start Tornado servers with management commands just for convenience...
This blocks in a separate thread leaving the event loop to handle other tasks.
Re: 10 000 concurrent real-time connections to Django
#36The C10K problem[1] is about real clients accessing real web servers, not about writing short strings over WebSocket. I'll associate "C10K" and "Django" when I'll see a dynamic web page being served using the template system, the standard middleware and the ORM (with the default behavior of creating and destroying a database connection for each request). [1] http://www.kegel.com/c10k.html
Why would you insist on creating and destroying a db connection on each request? We stopped doing that decades ago.
Re: 10 000 concurrent real-time connections to Django
#37why do people persist in mangling django into doing websocket persitent concurrency when there are better py or otherwise well suited tools to such tasks...
Re: 10 000 concurrent real-time connections to Django
#38Earlier quoted context omitted.
Well, about PgBouncer, I believe this tells more of PostgreSQL than of Django + psql libraries (After all it will still open and close connections for Django but keeps them open for psql) Now, for serving 10k connections with template libraries and middlewares and ORM, out of the box? Serving dynamic content for each connection? Impossible =) Not without some kind of caching (but you can do that with the help of a mi…
It's not PostgreSQL's fault that Django closes the connection after each request explicitly (see close_connection() for what was done before 1.6): [1] https://github.com/django/django/blob/master/django/db/__ini...
What I'm saying is that with PgBouncer you have Django PgBouncer Postgresql, right?
So what PgBouncer is doing (dealing with several open/close connections) maybe could be done better inside PostgreSQL
Re: 10 000 concurrent real-time connections to Django
#39For Python2.X, I think gevent.wsgi.WSGIServer could handle C10k or more, no?
Re: 10 000 concurrent real-time connections to Django
#40For Python2.X, I think gevent.wsgi.WSGIServer could handle C10k or more, no?
In practice, debugging is an unpleasant experience. If you're doing anything slightly out of the ordinary, you should take care.