#34442: runserver is slow to accept http connexions when running on 0.0.0.0
-----------------------------------------+------------------------
               Reporter:  Arthur         |          Owner:  nobody
                   Type:  Bug            |         Status:  new
              Component:  Uncategorized  |        Version:  4.1
               Severity:  Normal         |       Keywords:
           Triage Stage:  Unreviewed     |      Has patch:  0
    Needs documentation:  0              |    Needs tests:  0
Patch needs improvement:  0              |  Easy pickings:  0
                  UI/UX:  0              |
-----------------------------------------+------------------------
 When running `python manage.py runserver` on macOS, a decently sized
 project takes about 1 second to startup and respond to requests (based on
 the first access log I can see).

 However, when running `python manage.py runserver 0.0.0.0:8000`, the
 server will appear to have started, but will only start responding to
 requests 7/8 seconds later.

 I've been able to consistently reproduce the bug on a freshly installed
 project aswell (`django-admin startproject timings_test`) :

 - On 127.0.0.1:8000, the app will start in (08:42:11 - 08:42:11) less than
 a second
 - On 0.0.0.0:8000, the app will start in (08:42:32 - 08:42:26)
 approximately 6 seconds

 {{{

 bash-3.2$ cd $(mktemp -d)
 bash-3.2$ django-admin startproject timings_test
 bash-3.2$ cd timings_test/
 bash-3.2$ # I'll now refresh my web browser, pay close attention to the
 timings
 bash-3.2$ python3 manage.py runserver
 Watching for file changes with StatReloader
 Performing system checks...

 System check identified no issues (0 silenced).

 You have 18 unapplied migration(s). Your project may not work properly
 until you apply the migrations for app(s): admin, auth, contenttypes,
 sessions.
 Run 'python manage.py migrate' to apply them.
 March 28, 2023 - 08:42:11
 Django version 4.1.7, using settings 'timings_test.settings'
 Starting development server at http://127.0.0.1:8000/
 Quit the server with CONTROL-C.
 Not Found: /__reload__/events/
 [28/Mar/2023 08:42:11] "GET /__reload__/events/ HTTP/1.1" 404 2137
 [28/Mar/2023 08:42:12] "GET / HTTP/1.1" 200 10681
 [28/Mar/2023 08:42:12] "GET /static/admin/css/fonts.css HTTP/1.1" 304 0
 [28/Mar/2023 08:42:12] "GET /static/admin/fonts/Roboto-Bold-webfont.woff
 HTTP/1.1" 304 0
 [28/Mar/2023 08:42:12] "GET /static/admin/fonts/Roboto-Regular-
 webfont.woff HTTP/1.1" 304 0
 [28/Mar/2023 08:42:12] "GET /static/admin/fonts/Roboto-Light-webfont.woff
 HTTP/1.1" 304 0
 Not Found: /favicon.ico
 [28/Mar/2023 08:42:12] "GET /favicon.ico HTTP/1.1" 404 2116
 [28/Mar/2023 08:42:12,122] - Broken pipe from ('127.0.0.1', 54544)
 [28/Mar/2023 08:42:12] "GET / HTTP/1.1" 200 10681
 Not Found: /__reload__/events/
 [28/Mar/2023 08:42:14] "GET /__reload__/events/ HTTP/1.1" 404 2137
 Not Found: /__reload__/events/
 [28/Mar/2023 08:42:17] "GET /__reload__/events/ HTTP/1.1" 404 2137
 ^Cbash-3.2$ python3 manage.py runserver 0.0.0.0:8000
 Watching for file changes with StatReloader
 Performing system checks...

 System check identified no issues (0 silenced).

 You have 18 unapplied migration(s). Your project may not work properly
 until you apply the migrations for app(s): admin, auth, contenttypes,
 sessions.
 Run 'python manage.py migrate' to apply them.
 March 28, 2023 - 08:42:26
 Django version 4.1.7, using settings 'timings_test.settings'
 Starting development server at http://0.0.0.0:8000/
 Quit the server with CONTROL-C.
 [28/Mar/2023 08:42:32] "GET / HTTP/1.1" 200 10681
 Not Found: /__reload__/events/
 [28/Mar/2023 08:42:32] "GET /__reload__/events/ HTTP/1.1" 404 2137
 Not Found: /__reload__/events/

 }}}

-- 
Ticket URL: <https://code.djangoproject.com/ticket/34442>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018727657a18-4a8c3891-a067-4a75-95c3-f78546bbe46f-000000%40eu-central-1.amazonses.com.

Reply via email to