Daphne behavior question: Application close timeout and caching

526 views
Skip to first unread message

DeVonte Applewhite

unread,
Oct 8, 2019, 11:47:25 PM10/8/19
to Django users
Hello,

I am using Daphne to run a Quart app (https://pgjones.gitlab.io/quart/index.html#) and I wanted to use caching to improve performance.

I looked at the settings for Daphne and have a question about the below option:

  --application-close-timeout APPLICATION_CLOSE_TIMEOUT
                        The number of seconds an ASGI application has to exit
                        after client disconnect before it is killed

Does Daphne launch an application upon receiving a request, then kill it after the application gives a response every time?
If this is the case, I assume in memory caching would not work since the process running the app would be killed after every request.

Can someone give more information on the behavior of Daphne regarding the application close timeout?

DeVonte Applewhite

unread,
Oct 22, 2019, 11:48:13 PM10/22/19
to Django users
Does anyone have an idea where I can get more information on Daphne behavior?

wd

unread,
Oct 23, 2019, 3:39:05 AM10/23/19
to django...@googlegroups.com
hi,

Daphne support both http and websocket connect, if it's an http connection, I think daphne will close the application when the application gives a response. But if it's a websocket connection, it will keep the connection and last until the websocket connect close.


--
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 view this discussion on the web visit https://groups.google.com/d/msgid/django-users/7cf9d264-e5f3-4486-98c9-60a891eca48f%40googlegroups.com.

wd

unread,
Oct 23, 2019, 3:41:23 AM10/23/19
to django...@googlegroups.com
https://asgi.readthedocs.io/en/latest/specs/main.html#specification-details here is the spec for ASGI, you can check what the doc says.

--
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.

DeVonte Applewhite

unread,
Oct 24, 2019, 11:04:45 PM10/24/19
to Django users
Thanks. I found my answer in the Specification document.


On Tuesday, October 22, 2019 at 9:41:23 PM UTC-6, WD Wang wrote:
https://asgi.readthedocs.io/en/latest/specs/main.html#specification-details here is the spec for ASGI, you can check what the doc says.

On Wed, Oct 23, 2019 at 7:49 AM DeVonte Applewhite <devonte_a...@trimble.com> wrote:
Does anyone have an idea where I can get more information on Daphne behavior?

On Tuesday, October 8, 2019 at 5:47:25 PM UTC-6, DeVonte Applewhite wrote:
Hello,

I am using Daphne to run a Quart app (https://pgjones.gitlab.io/quart/index.html#) and I wanted to use caching to improve performance.

I looked at the settings for Daphne and have a question about the below option:

  --application-close-timeout APPLICATION_CLOSE_TIMEOUT
                        The number of seconds an ASGI application has to exit
                        after client disconnect before it is killed

Does Daphne launch an application upon receiving a request, then kill it after the application gives a response every time?
If this is the case, I assume in memory caching would not work since the process running the app would be killed after every request.

Can someone give more information on the behavior of Daphne regarding the application close timeout?

--
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...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages