Channels thread count is increasing

88 views
Skip to first unread message

erkin kabataş

unread,
Sep 15, 2018, 7:02:54 PM9/15/18
to Django users
Hi All,

I am new to python and django. 
I am using Python 3.6.5, Django 2.1 and Channels 2.1.2.
My problem is when I switch to ASGI from WSGI server, in every request, thread count is increasing. Same thing is happening when I use sync_to_async function in consumers.py. Is this a normal behaviour?

Thanks,
Erkin

vishal sharma

unread,
Sep 15, 2018, 11:05:02 PM9/15/18
to django...@googlegroups.com
In post API How to return response to network machine in Django ?


--
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...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
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/8635d3c1-c1e6-43d2-a70c-3db2ef3cc1f3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

erkin kabataş

unread,
Sep 16, 2018, 5:15:18 AM9/16/18
to Django users
Hi,

I followed the channels documentation, you can check from here:


After completing this part, in every page refresh, thread count is increasing at top 23.

16 Eylül 2018 Pazar 06:05:02 UTC+3 tarihinde vs704263 yazdı:

Andrew Godwin

unread,
Sep 17, 2018, 5:42:42 PM9/17/18
to django...@googlegroups.com
There's a reasonably large threadpool that sync_to_async uses (I think it defaults to number of CPU cores * 5), so you're probably just seeing that. It should stop growing at some point.

Andrew

--
Reply all
Reply to author
Forward
0 new messages