Re: Async views means dropping gunicorn gevent for uvicorn, affecting sync view performance

2023-04-17 Thread TITAS ONLINE MARKET
Thanks

On Mon, 17 Apr 2023, 11:42 am Fortune Osho,  wrote:

> You can simply run gunicorn with unicorn workers... which is very
> performance using uvloop... test it performance against pure gunicorn...
> note that performance is not totally dependent on server used(a whole lot
> of things can affect performance like moddlewares, serialization etc)
>
>
> On Sun, Apr 16, 2023 at 5:34 PM Chris Barber 
> wrote:
>
>> Hello
>>
>> Production django app, currently 100% sync views, running under gunicorn
>> with gevent worker class.
>>
>> @andrewgodwin suggests here it is possible to migrate slowly, just run
>> hybrid sync-async and add or convert views as desired
>> https://www.youtube.com/watch?v=19Uh_PA_8Rc=1728s
>>
>> But to get a single async view one has to switch to uvicorn workers or
>> similar, right? Now one is no longer getting the gevent patching for sync
>> views, which could be a major impact on performance/scaling, and could
>> trigger re-evaluation of the production deployment & tuning!
>>
>> Questions:
>>
>> 1. How to approach this? It has me wondering if monkey.patch_all() should
>> be ported to asyncio and tested under uvicorn. This would smooth the
>> transition since the sync views should perform and scale roughly the same
>> as before.
>>
>> 2. Also an important technical question on how sync views under ASGI
>> work. By default they will run all in the same thread (*per worker*)
>> which could be really bad for performance with tons of sync views, correct?
>> If I enable DJANGO_ALLOW_ASYNC_UNSAFE, then the sync views will be run in
>> more threads, right? How many threads?Should I expect to have to tune this?
>>
>> In general, regardless of the approach, one could presumably A/B test in
>> a live environment - run some workers / nodes under uvicorn, partition the
>> traffic accordingly, and see how it compares. Tune, stress test, and then
>> rolling transition.
>>
>> -C
>>
>> --
>> 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 django-users+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/8cc88d44-df9f-4232-8f57-89a1b07fb769n%40googlegroups.com
>> 
>> .
>>
> --
> 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 django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CABqs0Mwr%3DXjg6OLUAN9kxsqCKREJW1%2BtrkDHbTq0pnazKgqQkQ%40mail.gmail.com
> 
> .
>

-- 
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 django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAHdtJhU-ohRUcqju5xKkmf5vEcJ0p%2BHJtEP7zB13HC_4B3CJGw%40mail.gmail.com.


Re: Using the URLconf defined in iblogs.urls, Django tried these URL patterns, in this order:

2023-04-14 Thread TITAS ONLINE MARKET

Setting up a new Django project doesn't require much code copying, my 
friend. This can be done more simply and easily. You follow the new 
tutorial. Also if you have problem knock me I don't know much but I would 
be happy to discuss with you.
On Tuesday, April 11, 2023 at 6:44:53 PM UTC+6 Michael Starr wrote:

> You probably weren't careful enough following instructions. The beginner's 
> tutorial is self-contained and allows a complete Django project to be made. 
> Re-read everything word-for-word and then come back with some hypotheses 
> for us to test for you.
> Michael
>
> On Tuesday, April 4, 2023 at 9:44:38 AM UTC-7 Tanveer wrote:
>
>> 0
>> 
>>
>> I know this question has been asked before, but I haven't found an answer 
>> that solves my situation.
>>
>> I'm looking at the Django tutorial, and I've set up the first URLs 
>> exactly as the tutorial has it, word for word, but when I go to 
>> http://127.0.0.1:8000/, it gives me this error: but when i go to 
>> http://127.0.0.1:8000/admin/ its working fine,where and what i am doing 
>> wrong? i am using python version 3.11.1 please let me know for any other 
>> info
>> urls.py
>>
>> from django.contrib import admin
>> from django.urls import path, include
>> from django.conf.urls.static import static
>> from django.conf import settings
>> from .views import home
>> urlpatterns = [
>> path('admin/', admin.site.urls),
>> path('', home)
>>   ]
>>
>> views.py
>> from django.http import HttpResponse
>> from django.shortcuts import render
>>
>> # Create your views here.
>> def home(request):
>> return render(request,home.html,{})
>>
>>

-- 
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 django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/82c81da4-b9ce-4985-8387-ba1f63985ca2n%40googlegroups.com.