Re: A faster paginator for django

2018-12-15 Thread Kye Russell
It might also be worth looking at the alternative pagination methods 
offered by Django REST Framework as a source of inspiration.

On Wednesday, December 5, 2018 at 8:15:22 PM UTC+8, Saleem Jaffer wrote:
>
> Hi all,
>
> The default paginator that comes with Django is inefficient when dealing 
> with large tables. This is because the final query for fetching pages uses 
> "OFFSET" which is basically a linear scan till the last index of the 
> current page. Does it make sense to have a better paginator which does not 
> use "OFFSET". 
>
> If this sounds like a good idea, I have some ideas on how to do it and 
> with some help from you guys I can implement it.
>
> Saleem
>

-- 
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+unsubscr...@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/0f431ffc-5ebf-4703-9e01-91240007c154%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: A Django Async Roadmap

2018-12-15 Thread James Addison
If you're following that 'medium' article, then you'll see it 
uses https://github.com/jneight/django-db-geventpool, which has 
instructions for using `psycogreen` with gunicorn... I believe what it 
states is correct.

On Thursday, December 13, 2018 at 3:21:32 AM UTC, Ray Marceau wrote:
>
> James Addison,
>
>  I also currently use `psycogreen.gevent` for postgresql async behaviour.
>>
>
> How did you go about using psycogreen.gevent for async postgres?  I tried 
> using various tools and was unsuccessful in seeing any performance 
> improvements.  I was following the info here: 
> https://medium.com/@bfirsh/squeezing-every-drop-of-performance-out-of-a-django-app-on-heroku-4b5b1e5a3d44
>
> Have any suggestions/tips?  django blocking while waiting for postgres is 
> a huge bottleneck for my app.
>
> Thanks!
>
>
> How did you go about using psycogreen.gevent for postgresql async 
> behavior?  I'm 
> On Tuesday, August 21, 2018 at 10:16:03 AM UTC-7, James Addison wrote:
>>
>> On Monday, June 4, 2018 at 6:18:23 AM UTC-7, Andrew Godwin wrote:
>>>
>>> For a while now I have been working on potential plans for making Django 
>>> async-capable, and I finally have a plan I am reasonably happy with and 
>>> which I think we can actually do.
>>>
>>
>> Andrew,
>>
>> Out of curiosity, how would these kinds of changes interact with gunicorn 
>> running with a `gevent` worker? I also currently use `psycogreen.gevent` 
>> for postgresql async behaviour.
>>
>> Thanks,
>> James
>>
>

-- 
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+unsubscr...@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/f765848c-6e8f-4402-8baf-ca5ed0c96b4e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Widening participation (Thoughts from DjangoCon)

2018-12-15 Thread Claude Paroz
Le jeudi 13 décembre 2018 09:17:49 UTC+1, Carlton Gibson a écrit :
>
> ...
> I'd like to push on these avenues (and similar) before we take on the 
> massive project of changing systems. 
> (Ultimately I think we'd change system and find ourselves in exactly the 
> same boat.) 
>

Thanks Carlton, I totally agree with this position. I'm convinced the 
difficulty is not in the tool (even if improving tooling is always welcome) 
but rather in the content. We should not complain that easy issues are 
solved, that's IMHO the sign of a good community. 
It's probably a common issue in mature projects. At some point, what you 
need is skilled and/or perseverant contributors with enough time to solve 
harder issues. And those contributors are not like fishes in the sea…

Claude

-- 
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+unsubscr...@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/ec4e3794-2607-418e-8e84-3a1b150dc821%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Database connection retry

2018-12-15 Thread Carlton Gibson
Hi Jamesie.

Two things stick out from the thread: 

Aymeric: might be more user-friendly, which is a goal. (If not too 
complex...)
Tim: can you show us a patch to see what it would look like. 

Fancy putting together a POC? 
C.

On Saturday, 15 December 2018 08:52:15 UTC+1, Jamesie Pic wrote:
>
> Hi all,
>
> Sorry to bump this, but I didn't find another thread, and I'm pretty sure 
> re-trying the database connection is the sane thing to do.
>
> Otherwise, Django will remain in failed state after reboot in some cases: 
> psycopg2.OperationalError: FATAL:  the database system is starting up
>
> It would be better if Django could tolerate this situation and retry, then 
> the server would be reboot proof.
>
> At least, show a 500 page until the DB server has started, would be more 
> reasonnable.
>
> Are you sure Django should not be a bit a bit more tolerant with databases 
> starting up ? 
>
> Or should we open a ticket ?
>
> Thanks in advance for your reply
>
> Have a great weekend
>

-- 
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+unsubscr...@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/79a8ca96-4e65-4916-93da-8c32897a8b30%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Database connection retry

2018-12-15 Thread Jamesie Pic
Nope, uwsgi in docker...

-- 
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+unsubscr...@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/CAC6Op198KTy6x7LFPnQZcVn0bC1a8_Va%2BZvxMRtKNDuFrZWJWg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Database connection retry

2018-12-15 Thread ludovic coues
Are you using runserver in production ?

On Sat, Dec 15, 2018, 08:52 Jamesie Pic  Hi all,
>
> Sorry to bump this, but I didn't find another thread, and I'm pretty sure
> re-trying the database connection is the sane thing to do.
>
> Otherwise, Django will remain in failed state after reboot in some cases:
> psycopg2.OperationalError: FATAL:  the database system is starting up
>
> It would be better if Django could tolerate this situation and retry, then
> the server would be reboot proof.
>
> At least, show a 500 page until the DB server has started, would be more
> reasonnable.
>
> Are you sure Django should not be a bit a bit more tolerant with databases
> starting up ?
>
> Or should we open a ticket ?
>
> Thanks in advance for your reply
>
> Have a great weekend
>
> --
> 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+unsubscr...@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/CAC6Op18ET_ZZs_XBQou70sJL9vo2fsk2BL57q4j-U-j5H_d4oQ%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 developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@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/CAEuG%2BTbXZL%2BH5kgZryAsK_i06NwaRCb5EkHMRLmgZ6rA%3D7yhjA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.