Python / Django slow ? Deciding my next technological stack

classic Classic list List threaded Threaded
16 messages Options
Reply | Threaded
Open this post in threaded view
|

Python / Django slow ? Deciding my next technological stack

Benjamin Melki
Hi,
i'm going to invest lots of time and energy in various web projects (mostly community web sites), and want to pick up a language / framework and invest heavily on it.
I've spent a lot of time evaluating the various options, and narrowed my choice to 2 stacks: C sharp asp.net  MVC or Python / Django.

I'm more attracted to Python / Django combo, because of the Python language, and high level framework Django. I really want to use these.
My only concern is speed. I read that Python can't run concurrent tasks, is this true ? So a multi-processor with hyperthreads won't benefit the stack and even slow it down ?
I have no clue how this translates in reality, but should I expect noticable performance difference on a same server, shall I use Python / Django than if I had C Sharp Asp.net ?
I don't want to invest lots of time and efforts only to discover in the end that the site is slow. 
You that have real world experiences with running sites, what are your conclusions ?


I expect sites to be medium traffic: could be handled by a good dedicated server or average cloud ressources.

Benj

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/4b92f220-55a1-4cb5-9da2-6d659bb17c14%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Python / Django slow ? Deciding my next technological stack

Alex Mandel-2
On 02/24/2015 03:30 PM, Benj wrote:

> Hi,
> i'm going to invest lots of time and energy in various web projects (mostly
> community web sites), and want to pick up a language / framework and invest
> heavily on it.
> I've spent a lot of time evaluating the various options, and narrowed my
> choice to 2 stacks: C sharp asp.net  MVC or Python / Django.
>
> I'm more attracted to Python / Django combo, because of the Python
> language, and high level framework Django. I really want to use these.
> My only concern is speed. I read that Python can't run concurrent tasks, is
> this true ? So a multi-processor with hyperthreads won't benefit the stack
> and even slow it down ?
> I have no clue how this translates in reality, but should I expect
> noticable performance difference on a same server, shall I use Python /
> Django than if I had C Sharp Asp.net ?
> I don't want to invest lots of time and efforts only to discover in the end
> that the site is slow.
> You that have real world experiences with running sites, what are your
> conclusions ?
>
>
> I expect sites to be medium traffic: could be handled by a good dedicated
> server or average cloud ressources.
>
> Benj
>

Use a good WSGI like uwsgi or gunicorn and don't use sqlite as your db.
Those WSGI containers are threaded. Don't confuse running python
directly which is different (and there are ways to use multicores even
then).

Plenty of examples of big websites running django out there.
http://blog.disqus.com/post/62187806135/scaling-django-to-8-billion-page-views

Enjoy,
Alex

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/54ED0EB9.2020505%40wildintellect.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Python / Django slow ? Deciding my next technological stack

Vijay Khemlani
It's true that the Global Interpreter Lock will prevent threads from a single process from running concurrently, but your server (uWSGI, gunicorn, etc) will spawn multiple process that don't conflict with the GIL.

Also, if you need some form of multiprocessing celery is a good choice, and one that also doesn't collide with the GIL as it is a different process.

Finally, web apps are mostly limited by I/O (database access), so the actual stack used usually is not that important unless you are scaling a lot (StackOverflow-level "a lot").

I've worked with both Django and ASP.NET MVC (although an older version) and even though ASP.NET MVC is amazing in the level of the IDE (VisualStudio) and query language (Entity Framework / LINQ) it's still a little cumbersome for my taste (and I also prefer Linux enviroments...)

On Tue, Feb 24, 2015 at 8:52 PM, Alex Mandel <[hidden email]> wrote:
On 02/24/2015 03:30 PM, Benj wrote:
> Hi,
> i'm going to invest lots of time and energy in various web projects (mostly
> community web sites), and want to pick up a language / framework and invest
> heavily on it.
> I've spent a lot of time evaluating the various options, and narrowed my
> choice to 2 stacks: C sharp asp.net  MVC or Python / Django.
>
> I'm more attracted to Python / Django combo, because of the Python
> language, and high level framework Django. I really want to use these.
> My only concern is speed. I read that Python can't run concurrent tasks, is
> this true ? So a multi-processor with hyperthreads won't benefit the stack
> and even slow it down ?
> I have no clue how this translates in reality, but should I expect
> noticable performance difference on a same server, shall I use Python /
> Django than if I had C Sharp Asp.net ?
> I don't want to invest lots of time and efforts only to discover in the end
> that the site is slow.
> You that have real world experiences with running sites, what are your
> conclusions ?
>
>
> I expect sites to be medium traffic: could be handled by a good dedicated
> server or average cloud ressources.
>
> Benj
>

Use a good WSGI like uwsgi or gunicorn and don't use sqlite as your db.
Those WSGI containers are threaded. Don't confuse running python
directly which is different (and there are ways to use multicores even
then).

Plenty of examples of big websites running django out there.
http://blog.disqus.com/post/62187806135/scaling-django-to-8-billion-page-views

Enjoy,
Alex

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/54ED0EB9.2020505%40wildintellect.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CALn3ei0T%2B7HokGppre4z7JhPc6P1%3DkLW%2BJ2o1vAtG0v5DD8MtA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Python / Django slow ? Deciding my next technological stack

Andrew Farrell
As Vijay said, most of the performance of a web app (in any framework) is database access. With django, you can use the Django Debug Toolbar or the db.connection.queries object to find out where those queries are being made and then use the select-related and prefetch-related features of the ORM to reduce them to a minimum.

It is also worth noting that for many applications, the speed at which a programmer is able to work effectively matters more for the success of the project than the speed of the language. Of course, the two aren't completely unrelated; If your unit test suite runs slowly, that will slow down your development workflow.

If you have a need to do high-performance analysis of really large scale data sets, python has a variety of tools like blazepandas, and numba and is pretty widely used in scientific computing for this reason.

On Tue, Feb 24, 2015 at 5:59 PM, Vijay Khemlani <[hidden email]> wrote:
It's true that the Global Interpreter Lock will prevent threads from a single process from running concurrently, but your server (uWSGI, gunicorn, etc) will spawn multiple process that don't conflict with the GIL.

Also, if you need some form of multiprocessing celery is a good choice, and one that also doesn't collide with the GIL as it is a different process.

Finally, web apps are mostly limited by I/O (database access), so the actual stack used usually is not that important unless you are scaling a lot (StackOverflow-level "a lot").

I've worked with both Django and ASP.NET MVC (although an older version) and even though ASP.NET MVC is amazing in the level of the IDE (VisualStudio) and query language (Entity Framework / LINQ) it's still a little cumbersome for my taste (and I also prefer Linux enviroments...)

On Tue, Feb 24, 2015 at 8:52 PM, Alex Mandel <[hidden email]> wrote:
On 02/24/2015 03:30 PM, Benj wrote:
> Hi,
> i'm going to invest lots of time and energy in various web projects (mostly
> community web sites), and want to pick up a language / framework and invest
> heavily on it.
> I've spent a lot of time evaluating the various options, and narrowed my
> choice to 2 stacks: C sharp asp.net  MVC or Python / Django.
>
> I'm more attracted to Python / Django combo, because of the Python
> language, and high level framework Django. I really want to use these.
> My only concern is speed. I read that Python can't run concurrent tasks, is
> this true ? So a multi-processor with hyperthreads won't benefit the stack
> and even slow it down ?
> I have no clue how this translates in reality, but should I expect
> noticable performance difference on a same server, shall I use Python /
> Django than if I had C Sharp Asp.net ?
> I don't want to invest lots of time and efforts only to discover in the end
> that the site is slow.
> You that have real world experiences with running sites, what are your
> conclusions ?
>
>
> I expect sites to be medium traffic: could be handled by a good dedicated
> server or average cloud ressources.
>
> Benj
>

Use a good WSGI like uwsgi or gunicorn and don't use sqlite as your db.
Those WSGI containers are threaded. Don't confuse running python
directly which is different (and there are ways to use multicores even
then).

Plenty of examples of big websites running django out there.
http://blog.disqus.com/post/62187806135/scaling-django-to-8-billion-page-views

Enjoy,
Alex

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/54ED0EB9.2020505%40wildintellect.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CALn3ei0T%2B7HokGppre4z7JhPc6P1%3DkLW%2BJ2o1vAtG0v5DD8MtA%40mail.gmail.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CA%2By5TLYOihmvq1hUqETnWwY4vBaBFmttsm_ZkKoUzctFFg7JVQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Python / Django slow ? Deciding my next technological stack

Russell Keith-Magee-4
In reply to this post by Benjamin Melki

On Wed, Feb 25, 2015 at 7:30 AM, Benj <[hidden email]> wrote:
Hi,
i'm going to invest lots of time and energy in various web projects (mostly community web sites), and want to pick up a language / framework and invest heavily on it.
I've spent a lot of time evaluating the various options, and narrowed my choice to 2 stacks: C sharp asp.net  MVC or Python / Django.

I'm more attracted to Python / Django combo, because of the Python language, and high level framework Django. I really want to use these.
My only concern is speed. I read that Python can't run concurrent tasks, is this true ? So a multi-processor with hyperthreads won't benefit the stack and even slow it down ?
I have no clue how this translates in reality, but should I expect noticable performance difference on a same server, shall I use Python / Django than if I had C Sharp Asp.net ?
I don't want to invest lots of time and efforts only to discover in the end that the site is slow. 
You that have real world experiences with running sites, what are your conclusions ?

Instagram is a Django site. Disqus is a Django site. Many of the Mozilla properties are Django sites. I guarantee that these sites serve more traffic than your site will *ever* serve.

Don't get me wrong - these sites have all had to pay careful attention to the design of their systems, and in many cases have made extensive modifications to "stock" Django to support high performance. However - again - they also serve *much* more traffic than your site will *ever* serve.

C#/ASP.net isn't magical performance sauce. Django and/or the Python GIL isn't a magical performance drain. The choices you make in database schema design, caching strategies, query profiling and algorithm choices will affect your site performance *long* before the limitations of Python or Django start to become the limiting factor.

My advice to you - as long as your candidate frameworks meet basic performance requirements, and there's evidence that they can scale to larger sites (ASP.net, Django, and Ruby on Rails all easily meet these criteria), don't worry about performance. Worry about the language you like to use, the speed of development, the community that exists around the tools, and so on. 

Yours,
Russ Magee %-)

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAJxq84_tcPG7V1%3DM9UU-vSATnXFbekuzDcr8xm5UoTY8sUk-Zg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Python / Django slow ? Deciding my next technological stack

Tom Evans-3
In reply to this post by Benjamin Melki
On Tue, Feb 24, 2015 at 11:30 PM, Benj <[hidden email]> wrote:

> Hi,
> i'm going to invest lots of time and energy in various web projects (mostly
> community web sites), and want to pick up a language / framework and invest
> heavily on it.
> I've spent a lot of time evaluating the various options, and narrowed my
> choice to 2 stacks: C sharp asp.net  MVC or Python / Django.
>
> I'm more attracted to Python / Django combo, because of the Python language,
> and high level framework Django. I really want to use these.
> My only concern is speed. I read that Python can't run concurrent tasks, is
> this true ? So a multi-processor with hyperthreads won't benefit the stack
> and even slow it down ?
> I have no clue how this translates in reality, but should I expect noticable
> performance difference on a same server, shall I use Python / Django than if
> I had C Sharp Asp.net ?
> I don't want to invest lots of time and efforts only to discover in the end
> that the site is slow.
> You that have real world experiences with running sites, what are your
> conclusions ?
>
>
> I expect sites to be medium traffic: could be handled by a good dedicated
> server or average cloud ressources.
>
> Benj

Unless you are producing web-scale sites (gmail, ebay, instagram), the
speed of your website will depend more upon what you do with a
framework than the framework you choose.

If you are producing web-scale sites, then whatever framework you
choose you will need to make the right design decisions and/or
compromises.

Even with the best framework in the world, if you design the
architecture of a website poorly, the website will be slow.

Even less important than the choice of framework is the choice of
hosting container for your framework. If you ever get to the point
where the speed of your wsgi container is the thing that is holding
you back, well done, now you should spend some time looking at it.
Until then, use the way that is easiest for you.

Cheers

Tom

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAFHbX1JZYHL%3DbBuyAaC7_raZ%3DOv%3D4T1zunTwSLYNH2gCBHALJg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Python / Django slow ? Deciding my next technological stack

Nikolas Stevenson-Molnar-2
On 2/25/2015 6:27 AM, Tom Evans wrote:

> On Tue, Feb 24, 2015 at 11:30 PM, Benj <[hidden email]> wrote:
>> Hi,
>> i'm going to invest lots of time and energy in various web projects (mostly
>> community web sites), and want to pick up a language / framework and invest
>> heavily on it.
>> I've spent a lot of time evaluating the various options, and narrowed my
>> choice to 2 stacks: C sharp asp.net  MVC or Python / Django.
>>
>> I'm more attracted to Python / Django combo, because of the Python language,
>> and high level framework Django. I really want to use these.
>> My only concern is speed. I read that Python can't run concurrent tasks, is
>> this true ? So a multi-processor with hyperthreads won't benefit the stack
>> and even slow it down ?
>> I have no clue how this translates in reality, but should I expect noticable
>> performance difference on a same server, shall I use Python / Django than if
>> I had C Sharp Asp.net ?
>> I don't want to invest lots of time and efforts only to discover in the end
>> that the site is slow.
>> You that have real world experiences with running sites, what are your
>> conclusions ?
>>
>>
>> I expect sites to be medium traffic: could be handled by a good dedicated
>> server or average cloud ressources.
>>
>> Benj
> Unless you are producing web-scale sites (gmail, ebay, instagram), the
> speed of your website will depend more upon what you do with a
> framework than the framework you choose.
>
> If you are producing web-scale sites, then whatever framework you
> choose you will need to make the right design decisions and/or
> compromises.
>
> Even with the best framework in the world, if you design the
> architecture of a website poorly, the website will be slow.
>
> Even less important than the choice of framework is the choice of
> hosting container for your framework. If you ever get to the point
> where the speed of your wsgi container is the thing that is holding
> you back, well done, now you should spend some time looking at it.
> Until then, use the way that is easiest for you.
>
> Cheers
>
> Tom

I recently came across a recent article addressing many of common myths
about Python. I recommend giving it a read:
https://www.paypal-engineering.com/2014/12/10/10-myths-of-enterprise-python/

As Tom says, it's mostly a matter of how you use the language. You can
write slow assembly and you can write fast Python. There are certain
areas where writing code in another language will yield significant
performance advantages, but for that most part, much of what you'd want
to do has already been efficiently implemented in C and made available
in Python. E.g., numpy (actually some of this is Fortran, too), scipy,
Pillow (for image processing), et. al.

My general thought is that if it works for Instagram (any many other
high-traffic services), it'll probably work for whatever I'm doing.

_Nik

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/54EDFF29.5070908%40consbio.org.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Python / Django slow ? Deciding my next technological stack

Benjamin Melki
Thanks for quality answers guys, I'll definitely go the Python route and follow my initial intuition.

On Wednesday, February 25, 2015 at 5:57:21 PM UTC+1, Nikolas Stevenson-Molnar wrote:
On 2/25/2015 6:27 AM, Tom Evans wrote:

> On Tue, Feb 24, 2015 at 11:30 PM, Benj <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="KDe5zGwsqbUJ" rel="nofollow" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">webk...@...> wrote:
>> Hi,
>> i'm going to invest lots of time and energy in various web projects (mostly
>> community web sites), and want to pick up a language / framework and invest
>> heavily on it.
>> I've spent a lot of time evaluating the various options, and narrowed my
>> choice to 2 stacks: C sharp <a href="http://asp.net" target="_blank" rel="nofollow" onmousedown="this.href='http://www.google.com/url?q\75http%3A%2F%2Fasp.net\46sa\75D\46sntz\0751\46usg\75AFQjCNEvcDUH6J2ftQZWIFVuNHUDniphEA';return true;" onclick="this.href='http://www.google.com/url?q\75http%3A%2F%2Fasp.net\46sa\75D\46sntz\0751\46usg\75AFQjCNEvcDUH6J2ftQZWIFVuNHUDniphEA';return true;">asp.net  MVC or Python / Django.
>>
>> I'm more attracted to Python / Django combo, because of the Python language,
>> and high level framework Django. I really want to use these.
>> My only concern is speed. I read that Python can't run concurrent tasks, is
>> this true ? So a multi-processor with hyperthreads won't benefit the stack
>> and even slow it down ?
>> I have no clue how this translates in reality, but should I expect noticable
>> performance difference on a same server, shall I use Python / Django than if
>> I had C Sharp Asp.net ?
>> I don't want to invest lots of time and efforts only to discover in the end
>> that the site is slow.
>> You that have real world experiences with running sites, what are your
>> conclusions ?
>>
>>
>> I expect sites to be medium traffic: could be handled by a good dedicated
>> server or average cloud ressources.
>>
>> Benj
> Unless you are producing web-scale sites (gmail, ebay, instagram), the
> speed of your website will depend more upon what you do with a
> framework than the framework you choose.
>
> If you are producing web-scale sites, then whatever framework you
> choose you will need to make the right design decisions and/or
> compromises.
>
> Even with the best framework in the world, if you design the
> architecture of a website poorly, the website will be slow.
>
> Even less important than the choice of framework is the choice of
> hosting container for your framework. If you ever get to the point
> where the speed of your wsgi container is the thing that is holding
> you back, well done, now you should spend some time looking at it.
> Until then, use the way that is easiest for you.
>
> Cheers
>
> Tom

I recently came across a recent article addressing many of common myths
about Python. I recommend giving it a read:
<a href="https://www.paypal-engineering.com/2014/12/10/10-myths-of-enterprise-python/" target="_blank" rel="nofollow" onmousedown="this.href='https://www.google.com/url?q\75https%3A%2F%2Fwww.paypal-engineering.com%2F2014%2F12%2F10%2F10-myths-of-enterprise-python%2F\46sa\75D\46sntz\0751\46usg\75AFQjCNHYPp2PsekSHpEwV9roNsRJoF3prQ';return true;" onclick="this.href='https://www.google.com/url?q\75https%3A%2F%2Fwww.paypal-engineering.com%2F2014%2F12%2F10%2F10-myths-of-enterprise-python%2F\46sa\75D\46sntz\0751\46usg\75AFQjCNHYPp2PsekSHpEwV9roNsRJoF3prQ';return true;">https://www.paypal-engineering.com/2014/12/10/10-myths-of-enterprise-python/

As Tom says, it's mostly a matter of how you use the language. You can
write slow assembly and you can write fast Python. There are certain
areas where writing code in another language will yield significant
performance advantages, but for that most part, much of what you'd want
to do has already been efficiently implemented in C and made available
in Python. E.g., numpy (actually some of this is Fortran, too), scipy,
Pillow (for image processing), et. al.

My general thought is that if it works for Instagram (any many other
high-traffic services), it'll probably work for whatever I'm doing.

_Nik

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/7856d567-92f4-492d-b36d-ebb39c8d411d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Python / Django slow ? Deciding my next technological stack

Benjamin Melki
In reply to this post by Tom Evans-3
Just a little questions guys: when a user upload a file to server, and that file is a litte big and takes 3 seconds to be uploaded... what's the proper way, if possible, not to block the entire system for these 3 seconds so the server can serve other users while the upload is taking place.

On Wednesday, February 25, 2015 at 3:28:34 PM UTC+1, Tom Evans wrote:
On Tue, Feb 24, 2015 at 11:30 PM, Benj <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="sfeuhfZQ7X8J" rel="nofollow" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">webk...@...> wrote:

> Hi,
> i'm going to invest lots of time and energy in various web projects (mostly
> community web sites), and want to pick up a language / framework and invest
> heavily on it.
> I've spent a lot of time evaluating the various options, and narrowed my
> choice to 2 stacks: C sharp <a href="http://asp.net" target="_blank" rel="nofollow" onmousedown="this.href='http://www.google.com/url?q\75http%3A%2F%2Fasp.net\46sa\75D\46sntz\0751\46usg\75AFQjCNEvcDUH6J2ftQZWIFVuNHUDniphEA';return true;" onclick="this.href='http://www.google.com/url?q\75http%3A%2F%2Fasp.net\46sa\75D\46sntz\0751\46usg\75AFQjCNEvcDUH6J2ftQZWIFVuNHUDniphEA';return true;">asp.net  MVC or Python / Django.
>
> I'm more attracted to Python / Django combo, because of the Python language,
> and high level framework Django. I really want to use these.
> My only concern is speed. I read that Python can't run concurrent tasks, is
> this true ? So a multi-processor with hyperthreads won't benefit the stack
> and even slow it down ?
> I have no clue how this translates in reality, but should I expect noticable
> performance difference on a same server, shall I use Python / Django than if
> I had C Sharp Asp.net ?
> I don't want to invest lots of time and efforts only to discover in the end
> that the site is slow.
> You that have real world experiences with running sites, what are your
> conclusions ?
>
>
> I expect sites to be medium traffic: could be handled by a good dedicated
> server or average cloud ressources.
>
> Benj

Unless you are producing web-scale sites (gmail, ebay, instagram), the
speed of your website will depend more upon what you do with a
framework than the framework you choose.

If you are producing web-scale sites, then whatever framework you
choose you will need to make the right design decisions and/or
compromises.

Even with the best framework in the world, if you design the
architecture of a website poorly, the website will be slow.

Even less important than the choice of framework is the choice of
hosting container for your framework. If you ever get to the point
where the speed of your wsgi container is the thing that is holding
you back, well done, now you should spend some time looking at it.
Until then, use the way that is easiest for you.

Cheers

Tom

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/7e783c1f-2c44-4110-8dd9-933b489ac9ac%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Python / Django slow ? Deciding my next technological stack

Benjamin Melki
In reply to this post by Tom Evans-3
Just a little questions guys: when a user upload a file to server, and that file is a litte big and takes 3 seconds to be uploaded... what's the proper way, if possible, not to block the entire system for these 3 seconds so the server can serve other users while the upload is taking place. Should this be done in code with things like asyncio, or server with uwsgi workers ?

On Wednesday, February 25, 2015 at 3:28:34 PM UTC+1, Tom Evans wrote:
On Tue, Feb 24, 2015 at 11:30 PM, Benj <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="sfeuhfZQ7X8J" rel="nofollow" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">webk...@...> wrote:

> Hi,
> i'm going to invest lots of time and energy in various web projects (mostly
> community web sites), and want to pick up a language / framework and invest
> heavily on it.
> I've spent a lot of time evaluating the various options, and narrowed my
> choice to 2 stacks: C sharp <a href="http://asp.net" target="_blank" rel="nofollow" onmousedown="this.href='http://www.google.com/url?q\75http%3A%2F%2Fasp.net\46sa\75D\46sntz\0751\46usg\75AFQjCNEvcDUH6J2ftQZWIFVuNHUDniphEA';return true;" onclick="this.href='http://www.google.com/url?q\75http%3A%2F%2Fasp.net\46sa\75D\46sntz\0751\46usg\75AFQjCNEvcDUH6J2ftQZWIFVuNHUDniphEA';return true;">asp.net  MVC or Python / Django.
>
> I'm more attracted to Python / Django combo, because of the Python language,
> and high level framework Django. I really want to use these.
> My only concern is speed. I read that Python can't run concurrent tasks, is
> this true ? So a multi-processor with hyperthreads won't benefit the stack
> and even slow it down ?
> I have no clue how this translates in reality, but should I expect noticable
> performance difference on a same server, shall I use Python / Django than if
> I had C Sharp Asp.net ?
> I don't want to invest lots of time and efforts only to discover in the end
> that the site is slow.
> You that have real world experiences with running sites, what are your
> conclusions ?
>
>
> I expect sites to be medium traffic: could be handled by a good dedicated
> server or average cloud ressources.
>
> Benj

Unless you are producing web-scale sites (gmail, ebay, instagram), the
speed of your website will depend more upon what you do with a
framework than the framework you choose.

If you are producing web-scale sites, then whatever framework you
choose you will need to make the right design decisions and/or
compromises.

Even with the best framework in the world, if you design the
architecture of a website poorly, the website will be slow.

Even less important than the choice of framework is the choice of
hosting container for your framework. If you ever get to the point
where the speed of your wsgi container is the thing that is holding
you back, well done, now you should spend some time looking at it.
Until then, use the way that is easiest for you.

Cheers

Tom

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/cfe76a80-af35-4894-a18d-2717c371235c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Python / Django slow ? Deciding my next technological stack

Vijay Khemlani
The rest of the uWSGI / gunicorn / whatever workers are available to handle the other requests.

If there are so many uploads that all of the workers are busy then there are ways to upload files directly to Amazon S3 (for example) from the browser without going through your server.

On Sun, Mar 1, 2015 at 12:16 PM, Benj <[hidden email]> wrote:
Just a little questions guys: when a user upload a file to server, and that file is a litte big and takes 3 seconds to be uploaded... what's the proper way, if possible, not to block the entire system for these 3 seconds so the server can serve other users while the upload is taking place. Should this be done in code with things like asyncio, or server with uwsgi workers ?

On Wednesday, February 25, 2015 at 3:28:34 PM UTC+1, Tom Evans wrote:
On Tue, Feb 24, 2015 at 11:30 PM, Benj <[hidden email]> wrote:

> Hi,
> i'm going to invest lots of time and energy in various web projects (mostly
> community web sites), and want to pick up a language / framework and invest
> heavily on it.
> I've spent a lot of time evaluating the various options, and narrowed my
> choice to 2 stacks: C sharp asp.net  MVC or Python / Django.
>
> I'm more attracted to Python / Django combo, because of the Python language,
> and high level framework Django. I really want to use these.
> My only concern is speed. I read that Python can't run concurrent tasks, is
> this true ? So a multi-processor with hyperthreads won't benefit the stack
> and even slow it down ?
> I have no clue how this translates in reality, but should I expect noticable
> performance difference on a same server, shall I use Python / Django than if
> I had C Sharp Asp.net ?
> I don't want to invest lots of time and efforts only to discover in the end
> that the site is slow.
> You that have real world experiences with running sites, what are your
> conclusions ?
>
>
> I expect sites to be medium traffic: could be handled by a good dedicated
> server or average cloud ressources.
>
> Benj

Unless you are producing web-scale sites (gmail, ebay, instagram), the
speed of your website will depend more upon what you do with a
framework than the framework you choose.

If you are producing web-scale sites, then whatever framework you
choose you will need to make the right design decisions and/or
compromises.

Even with the best framework in the world, if you design the
architecture of a website poorly, the website will be slow.

Even less important than the choice of framework is the choice of
hosting container for your framework. If you ever get to the point
where the speed of your wsgi container is the thing that is holding
you back, well done, now you should spend some time looking at it.
Until then, use the way that is easiest for you.

Cheers

Tom

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/cfe76a80-af35-4894-a18d-2717c371235c%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CALn3ei2bnQi0FxpMTtvZ1OAP%3D_Q2k0XJze06mv7vCKLc%3D%2BTikQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Python / Django slow ? Deciding my next technological stack

Avraham Serour
if you have so many uploads that all of yours workers are busy, so maybe you need more workers...

On Sun, Mar 1, 2015 at 5:38 PM, Vijay Khemlani <[hidden email]> wrote:
The rest of the uWSGI / gunicorn / whatever workers are available to handle the other requests.

If there are so many uploads that all of the workers are busy then there are ways to upload files directly to Amazon S3 (for example) from the browser without going through your server.

On Sun, Mar 1, 2015 at 12:16 PM, Benj <[hidden email]> wrote:
Just a little questions guys: when a user upload a file to server, and that file is a litte big and takes 3 seconds to be uploaded... what's the proper way, if possible, not to block the entire system for these 3 seconds so the server can serve other users while the upload is taking place. Should this be done in code with things like asyncio, or server with uwsgi workers ?

On Wednesday, February 25, 2015 at 3:28:34 PM UTC+1, Tom Evans wrote:
On Tue, Feb 24, 2015 at 11:30 PM, Benj <[hidden email]> wrote:

> Hi,
> i'm going to invest lots of time and energy in various web projects (mostly
> community web sites), and want to pick up a language / framework and invest
> heavily on it.
> I've spent a lot of time evaluating the various options, and narrowed my
> choice to 2 stacks: C sharp asp.net  MVC or Python / Django.
>
> I'm more attracted to Python / Django combo, because of the Python language,
> and high level framework Django. I really want to use these.
> My only concern is speed. I read that Python can't run concurrent tasks, is
> this true ? So a multi-processor with hyperthreads won't benefit the stack
> and even slow it down ?
> I have no clue how this translates in reality, but should I expect noticable
> performance difference on a same server, shall I use Python / Django than if
> I had C Sharp Asp.net ?
> I don't want to invest lots of time and efforts only to discover in the end
> that the site is slow.
> You that have real world experiences with running sites, what are your
> conclusions ?
>
>
> I expect sites to be medium traffic: could be handled by a good dedicated
> server or average cloud ressources.
>
> Benj

Unless you are producing web-scale sites (gmail, ebay, instagram), the
speed of your website will depend more upon what you do with a
framework than the framework you choose.

If you are producing web-scale sites, then whatever framework you
choose you will need to make the right design decisions and/or
compromises.

Even with the best framework in the world, if you design the
architecture of a website poorly, the website will be slow.

Even less important than the choice of framework is the choice of
hosting container for your framework. If you ever get to the point
where the speed of your wsgi container is the thing that is holding
you back, well done, now you should spend some time looking at it.
Until then, use the way that is easiest for you.

Cheers

Tom

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/cfe76a80-af35-4894-a18d-2717c371235c%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CALn3ei2bnQi0FxpMTtvZ1OAP%3D_Q2k0XJze06mv7vCKLc%3D%2BTikQ%40mail.gmail.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAFWa6tK0xeAe5mHdF_A561Q1-4SGsw1pD34iPEKwY-RVs3%3D6KA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Python / Django slow ? Deciding my next technological stack

Nikolas Stevenson-Molnar-2
In reply to this post by Benjamin Melki
On 3/1/2015 7:13 AM, Benj wrote:
> Just a little questions guys: when a user upload a file to server, and
> that file is a litte big and takes 3 seconds to be uploaded... what's
> the proper way, if possible, not to block the entire system for these
> 3 seconds so the server can serve other users while the upload is
> taking place.
Let a web server handle the actual upload. Nginx is really good at this,
it can easily handle thousands of concurrent connections. Once all the
data is actually transferred to the server, only then does the request
get passed on to your Django app. A worker is not needed until that
point. This is the default behavior if you use a Nginx / Gunicorn (or
uWSGI) / Django stack.

You can also use the Nginx Upload Module, and your Django app will never
need to receive the actual data at all. Nginx will handle the upload,
put it in a location of your choosing, then hand the path on the server
off to your app. http://wiki.nginx.org/HttpUploadModule

_Nik

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/54F48FE7.2030103%40consbio.org.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Python / Django slow ? Deciding my next technological stack

Ilya Kazakevich-2
In reply to this post by Benjamin Melki
In modern world any heavy loaded site should have HORIZONTAL SCALING. That means it should support scale by adding new servers to cluster.
With horizontal scaling you should not care about how python is slow on each node, until you have traffic like Facebook or Guthub have. I believe 99% websites work well on Python/Django and you have more chances to face database bottlenecks, than Django/Python bottlenecks. You know Instagram, right? They use Django AFAIK. 

CLR (.NET) should probably be faster in some cases (specially with JIT) and it has better multithreading support and better profiling tools, but even with it you will need to create cluster architecture for heavy sites.

So, choosing between C#/.NET and Python/Django is not about performance, I believe. It is about language, platforms, static/no static typing and so on.




On Wednesday, February 25, 2015 at 2:30:30 AM UTC+3, Benj wrote:
Hi,
i'm going to invest lots of time and energy in various web projects (mostly community web sites), and want to pick up a language / framework and invest heavily on it.
I've spent a lot of time evaluating the various options, and narrowed my choice to 2 stacks: C sharp <a href="http://asp.net" target="_blank" rel="nofollow" onmousedown="this.href='http://www.google.com/url?q\75http%3A%2F%2Fasp.net\46sa\75D\46sntz\0751\46usg\75AFQjCNEvcDUH6J2ftQZWIFVuNHUDniphEA';return true;" onclick="this.href='http://www.google.com/url?q\75http%3A%2F%2Fasp.net\46sa\75D\46sntz\0751\46usg\75AFQjCNEvcDUH6J2ftQZWIFVuNHUDniphEA';return true;">asp.net  MVC or Python / Django.

I'm more attracted to Python / Django combo, because of the Python language, and high level framework Django. I really want to use these.
My only concern is speed. I read that Python can't run concurrent tasks, is this true ? So a multi-processor with hyperthreads won't benefit the stack and even slow it down ?
I have no clue how this translates in reality, but should I expect noticable performance difference on a same server, shall I use Python / Django than if I had C Sharp Asp.net ?
I don't want to invest lots of time and efforts only to discover in the end that the site is slow. 
You that have real world experiences with running sites, what are your conclusions ?


I expect sites to be medium traffic: could be handled by a good dedicated server or average cloud ressources.

Benj

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/b610b638-2b97-4af5-a211-313c654f56c9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Python / Django slow ? Deciding my next technological stack

ijazz jazz
In reply to this post by Benjamin Melki
he appropriate tech stack is crucial for a successful web application. ... Ruby (Ruby on Rails); Python(Django, Flask, Pylons); PHP (Laravel); Java .... Needless to say, removing all bugs requires a lot of time and slows down development.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/334f687c-9d19-4258-966e-0864622fdeb0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Python / Django slow ? Deciding my next technological stack

ijazz jazz
In reply to this post by Benjamin Melki
Python Training in Bangalore Best Python Training Courses in Bangalore –  Marathahalli, BTM Layout, Rajajinagar, Kalyan Nagar & Jaya Nagar. We train the students from basic level to advanced concepts with a real-time environment. We are the Best Python Training Institute in bangalore.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/7b0c134a-f289-4b96-a890-cb9ab9a8cb10%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.