Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Multi-Threaded Dev Server
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  18 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Chris  
View profile  
 More options Nov 16 2008, 1:26 am
From: Chris <chriss...@gmail.com>
Date: Sat, 15 Nov 2008 22:26:57 -0800 (PST)
Local: Sun, Nov 16 2008 1:26 am
Subject: Multi-Threaded Dev Server
I think http://code.djangoproject.com/ticket/3357 should be given
another look at enabling optional multi-threading on the dev server.

Jacob previously closed this ticket, noting the patch could introduce
threading bugs, and would provide functionality too similar to that of
a production environment.

This is my rationale to accept this ticket:
1. Ajax is very common place, and often requires a multi-threaded
server. The dev server is very convenient, but by not providing multi-
threading support, we're preventing it from being even more useful.
2. Since multi-threading would be an optional setting, the default
scenario would still be single-threaded and would not break anything.
Only those specifically desiring multi-threading would subject
themselves to any unforeseen bugs.
3. Fear of multi-threading bugs shouldn't be a reason to avoid multi-
threading, especially when it could be very useful. We don't even know
if there are multi-threading bugs. And even if there are, they can be
fixed.

Regards,
Chris


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Calvin Spealman  
View profile  
 More options Nov 16 2008, 1:39 am
From: "Calvin Spealman" <ironfro...@gmail.com>
Date: Sun, 16 Nov 2008 01:39:54 -0500
Local: Sun, Nov 16 2008 1:39 am
Subject: Re: Multi-Threaded Dev Server
Does it need to be multi-threaded? Can you get a multi-process dev
server instead/also?

--
Read my blog! I depend on your acceptance of my opinion! I am interesting!
http://techblog.ironfroggy.com/
Follow me if you're into that sort of thing: http://www.twitter.com/ironfroggy

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
alex.gaynor@gmail.com  
View profile  
 More options Nov 16 2008, 2:03 am
From: "alex.gay...@gmail.com" <alex.gay...@gmail.com>
Date: Sat, 15 Nov 2008 23:03:51 -0800 (PST)
Local: Sun, Nov 16 2008 2:03 am
Subject: Re: Multi-Threaded Dev Server
If the patch that's currently on there works with no changes at all,
I'd be hesitantly in favor of it, however if there any bugs, or other
complications associated with it, my answer is to use a real server,
setting up something like CherryPy locally is almost no effort, as
seen here: http://www.oebfare.com/blog/2008/nov/03/writing-custom-management-com...

On Nov 16, 1:39 am, "Calvin Spealman" <ironfro...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
David Cramer  
View profile  
 More options Nov 16 2008, 3:42 am
From: David Cramer <dcra...@gmail.com>
Date: Sun, 16 Nov 2008 00:42:41 -0800 (PST)
Local: Sun, Nov 16 2008 3:42 am
Subject: Re: Multi-Threaded Dev Server
I'm a bit confused how multi-threading has anything to do with AJAX?
Your requests will be slower, but they will still get processed (at
least I've never had any issues).

On Nov 16, 1:03 am, "alex.gay...@gmail.com" <alex.gay...@gmail.com>
wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Vinay Sajip  
View profile  
 More options Nov 16 2008, 5:58 am
From: Vinay Sajip <vinay_sa...@yahoo.co.uk>
Date: Sun, 16 Nov 2008 02:58:05 -0800 (PST)
Local: Sun, Nov 16 2008 5:58 am
Subject: Re: Multi-Threaded Dev Server

On Nov 16, 6:26 am, Chris <chriss...@gmail.com> wrote:

I would second what David Cramer said. You don't need, in the general
case, need multi-threading on the server side for Ajax - it's really
about browser-side multi-threading. I'm not sure where your point 1
comes from: I use AJAX with the standard, single-threading development
server all the time, and I have not encountered any issues at all. I'd
say leave it as it is, unless of course you have encountered some
specific problem relating to the single-threaded nature of the server.
In that case, please post some details.

It's theoretically possible that with the server tied up with some
long-running request, the browser might time out before the server got
around to servicing an AJAX request which was next in line. However,
you should be able to configure client-side time-outs appropriately to
mitigate this.

Regards,

Vinay Sajip


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Julian  
View profile  
 More options Nov 16 2008, 6:17 am
From: Julian <julia...@googlemail.com>
Date: Sun, 16 Nov 2008 12:17:38 +0100
Local: Sun, Nov 16 2008 6:17 am
Subject: Re: Multi-Threaded Dev Server

Some months ago I tried a snippet from djangosnippets.org which shows a
upload progress bar. I think some people want to use snippets like that and
a multi-threaded server would help you developing such applications.

2008/11/16 Vinay Sajip <vinay_sa...@yahoo.co.uk>


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Steve Holden  
View profile  
 More options Nov 16 2008, 7:45 am
From: Steve Holden <holden...@gmail.com>
Date: Sun, 16 Nov 2008 07:45:15 -0500
Local: Sun, Nov 16 2008 7:45 am
Subject: Re: Multi-Threaded Dev Server

Julian wrote:
> [...] I think some people want to use snippets like that [...]

Wouldn't you agree that's a pretty feeble use case for something as
potentially disruptive as multi-threaded serving? Particularly when the
CherryPy alternative is so readily available.

regards
 Steve
--
Steve Holden        +1 571 484 6266   +1 800 494 3119
Holden Web LLC              http://www.holdenweb.com/


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Waylan Limberg  
View profile  
 More options Nov 16 2008, 12:21 pm
From: "Waylan Limberg" <way...@gmail.com>
Date: Sun, 16 Nov 2008 12:21:16 -0500
Local: Sun, Nov 16 2008 12:21 pm
Subject: Re: Multi-Threaded Dev Server

On Sun, Nov 16, 2008 at 1:26 AM, Chris <chriss...@gmail.com> wrote:

> I think http://code.djangoproject.com/ticket/3357 should be given
> another look at enabling optional multi-threading on the dev server.
> 3. Fear of multi-threading bugs shouldn't be a reason to avoid multi-
> threading, especially when it could be very useful. We don't even know
> if there are multi-threading bugs. And even if there are, they can be
> fixed.

Yet, the time spent identifying and fixing those buds means less time
developing real features that I need and can use on my production
sites. I'd say the developers time is better spent elsewhere.
Especially considering there are already working solutions out there.
I seem to recall at least one management command someone put together
that runs a multithreaded cherrypy server. Why reinvent the wheel?
Lets focus on real, useful features.

--
----
Waylan Limberg
way...@gmail.com


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Vinay Sajip  
View profile  
 More options Nov 16 2008, 4:08 pm
From: Vinay Sajip <vinay_sa...@yahoo.co.uk>
Date: Sun, 16 Nov 2008 13:08:48 -0800 (PST)
Local: Sun, Nov 16 2008 4:08 pm
Subject: Re: Multi-Threaded Dev Server

On Nov 16, 5:21 pm, "Waylan Limberg" <way...@gmail.com> wrote:

> On Sun, Nov 16, 2008 at 1:26 AM, Chris <chriss...@gmail.com> wrote:
> Especially considering there are already working solutions out there.
> I seem to recall at least one management command someone put together
> that runs a multithreaded cherrypy server. Why reinvent the wheel?
> Lets focus on real, useful features.

Especially since Alex Gaynor helpfully posted a link to that specific
solution earlier in this thread. Here it is again:

http://www.oebfare.com/blog/2008/nov/03/writing-custom-management-com...

Regards,

Vinay Sajip


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
David Cramer  
View profile  
 More options Nov 16 2008, 8:44 pm
From: David Cramer <dcra...@gmail.com>
Date: Sun, 16 Nov 2008 17:44:04 -0800 (PST)
Local: Sun, Nov 16 2008 8:44 pm
Subject: Re: Multi-Threaded Dev Server
I think I may have to actually agree that multi-threading is somewhat
needed, since it does limit these kind of features from working. I,
however, would deem it less a priority than most thing. If you can
write a patch for it (or if one exists, I didn't look) though, I don't
see any reason to not extend runserver to use it.

On Nov 16, 6:45 am, Steve Holden <holden...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Calvin Spealman  
View profile  
 More options Nov 17 2008, 8:54 am
From: "Calvin Spealman" <ironfro...@gmail.com>
Date: Mon, 17 Nov 2008 08:54:20 -0500
Local: Mon, Nov 17 2008 8:54 am
Subject: Re: Multi-Threaded Dev Server
The last thing new people need when they come in and start playing
around with the dev server is to worry about all the issues that can
come up with threading. I would never recommend to anyone who doesn't
really know what they're doing and anyone who does can easily use any
one of the number of solutions other than the dev server to test those
setups. Keep it simple. Keep everyone sane. Even if it was added as
some optional flag, I can guarantee that a number of people without
enough of an understanding of threads are just going to enable it when
they read about it thinking "threads make it faster" and thinking no
more about it. I strongly urge this to not be added to what should be
a simple dev server.

--
Read my blog! I depend on your acceptance of my opinion! I am interesting!
http://techblog.ironfroggy.com/
Follow me if you're into that sort of thing: http://www.twitter.com/ironfroggy

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ludvig Ericson  
View profile  
 More options Nov 17 2008, 11:54 am
From: Ludvig Ericson <ludvig.eric...@gmail.com>
Date: Mon, 17 Nov 2008 17:54:16 +0100
Local: Mon, Nov 17 2008 11:54 am
Subject: Re: Multi-Threaded Dev Server
On Nov 16, 2008, at 07:26, Chris wrote:

> 3. Fear of multi-threading bugs shouldn't be a reason to avoid multi-
> threading, especially when it could be very useful. We don't even know
> if there are multi-threading bugs. And even if there are, they can be
> fixed.

There are bugs. Django isn't thread-safe, and we know that.

The best solution I can come up with would be to use the type of
multitasking given by the processing library in py2.6.

http://pypi.python.org/pypi/processing

Ludvig Ericson


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
matt westerburg  
View profile  
 More options Nov 17 2008, 2:14 pm
From: "matt westerburg" <westym...@gmail.com>
Date: Mon, 17 Nov 2008 13:14:11 -0600
Local: Mon, Nov 17 2008 2:14 pm
Subject: Re: Multi-Threaded Dev Server

Is there any documentation as to why Django is not threadsafe?  It just
seems to me that with the Global Interpreter Lock and all, it would be
threadsafe.  I don't intend to start a flame, I am just curious about
learning why this might be.  I am favor of the mutlitprocess approach layed
out by Ludvig.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jacob Kaplan-Moss  
View profile  
 More options Nov 17 2008, 2:25 pm
From: "Jacob Kaplan-Moss" <jacob.kaplanm...@gmail.com>
Date: Mon, 17 Nov 2008 13:25:52 -0600
Local: Mon, Nov 17 2008 2:25 pm
Subject: Re: Multi-Threaded Dev Server
On Mon, Nov 17, 2008 at 10:54 AM, Ludvig Ericson

<ludvig.eric...@gmail.com> wrote:
> There are bugs. Django isn't thread-safe, and we know that.

Um...

That's just not true. At one point (two years ago?) it wasn't, but
these days Django's deployed all over the place in mutli-threaded
situations. If it wasn't threadsafe we'd hear about it.

Jacob


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Leo Soto M.  
View profile  
 More options Nov 17 2008, 6:57 pm
From: "Leo Soto M." <leo.s...@gmail.com>
Date: Mon, 17 Nov 2008 20:57:25 -0300
Local: Mon, Nov 17 2008 6:57 pm
Subject: Re: Multi-Threaded Dev Server

On Mon, Nov 17, 2008 at 4:14 PM, matt westerburg <westym...@gmail.com> wrote:
> Is there any documentation as to why Django is not threadsafe?  It just
> seems to me that with the Global Interpreter Lock and all, it would be
> threadsafe.

That wouldn't as nice as "really-really thread safe". You know, there
are GIL-less Python implementations out there ;-)

--
Leo Soto M.
http://blog.leosoto.com


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
mrts  
View profile  
 More options Nov 18 2008, 3:21 am
From: mrts <m...@mrts.pri.ee>
Date: Tue, 18 Nov 2008 00:21:59 -0800 (PST)
Local: Tues, Nov 18 2008 3:21 am
Subject: Re: Multi-Threaded Dev Server
On Nov 17, 6:54 pm, Ludvig Ericson <ludvig.eric...@gmail.com> wrote:

> On Nov 16, 2008, at 07:26, Chris wrote:

> > 3. Fear of multi-threading bugs shouldn't be a reason to avoid multi-
> > threading, especially when it could be very useful. We don't even know
> > if there are multi-threading bugs. And even if there are, they can be
> > fixed.

> There are bugs. Django isn't thread-safe, and we know that.

Which bugs in particular? By all means, if you find one, report it. I
have run Django with mod_wsgi threaded daemon mode with no ill effects
for a long time. See http://code.djangoproject.com/wiki/DjangoSpecifications/Core/Threading
, all bugs found during the review were fixed a long time ago (and
only one of them, #6950, was serious-ish).

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Vinay Sajip  
View profile  
 More options Nov 18 2008, 5:30 am
From: Vinay Sajip <vinay_sa...@yahoo.co.uk>
Date: Tue, 18 Nov 2008 02:30:14 -0800 (PST)
Local: Tues, Nov 18 2008 5:30 am
Subject: Re: Multi-Threaded Dev Server

On Nov 17, 7:25 pm, "Jacob Kaplan-Moss" <jacob.kaplanm...@gmail.com>
wrote:

> That's just not true. At one point (two years ago?) it wasn't, but
> these days Django's deployed all over the place in mutli-threaded
> situations. If it wasn't threadsafe we'd hear about it.

As I understand it, there are some areas where you have to be careful.
For example, you can't be sure that caching templates won't lead to
problems, because there are some template tags where rendering state
is held in the nodes rather than the context. This post may give more
information:

http://lucumr.pocoo.org/cogitations/2008/09/16/why-jinja-is-not-djang...

If you ensure that templates are always compiled from source for each
request, then this shouldn't bite you.

Best regards,

Vinay Sajip


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Matthew Russell  
View profile  
 More options Nov 18 2008, 6:04 am
From: "Matthew Russell" <matt.horiz...@gmail.com>
Date: Tue, 18 Nov 2008 11:04:27 +0000
Local: Tues, Nov 18 2008 6:04 am
Subject: Re: Multi-Threaded Dev Server

Hi,
I'd like to point out that as you've stated, django is deployed in
mulit-threaded environments successfully,
employing an app that makes use of geodjango in a multi-threaded environment
is not.
Justin (Bronn) will testify to this I'm sure (as I and others have run into
this issue whilst attempting to deploy mod_wsgi/mod_python/others in a
mutli-threaded environment.  (This is due to the underlying libgeos c
library not being thread safe itself)

I should (and will) create a ticket to make this clear in the django docs
for the geodjango parts, so that others may avoid the pain we went throught
a few months back.

Cheers,
Matt

2008/11/17 Jacob Kaplan-Moss <jacob.kaplanm...@gmail.com>

> On Mon, Nov 17, 2008 at 10:54 AM, Ludvig Ericson
> <ludvig.eric...@gmail.com> wrote:
> > There are bugs. Django isn't thread-safe, and we know that.

> Um...

> That's just not true. At one point (two years ago?) it wasn't, but
> these days Django's deployed all over the place in mutli-threaded
> situations. If it wasn't threadsafe we'd hear about it.

> Jacob

--
Cheers,
Matt

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »