Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
http.server start delay
#1
I'm trying to use python http.server with the following command:

python -m http.server 8000
but I'm consistently waiting 30 seconds for it to start up.
I'm working on a MBP 15" 2017, MacOS X High Sierra 10.13.4.

I tried closing all applications, restarting the computer, resetting PRAM and SMC; tried upgrading to python 3.7 (from 3.6.4) [via homebrew] and it didn't help; I tried using python3 -m http.server, and finally uninstalled python 3 and tried python 2.7's

python -m SimpleHTTPServer
but again I got the same result.
Each try was timed using time python -m http.server and pressing ^C after starting. The ^C remained in the buffer until the server started.

Each time the output was something along the lines of
Output:
real 0m30.089s user 0m0.040s sys 0m0.035s
with user and sys going up to around 80-100ms and real to 30.120ms!
My other Express.js apps launch immediately on localhost.

I'm guessing there's a 30 seconds timeout or delay somewhere that gets triggered, but I don't know why and how to solve it! I really don't even know where to look.

(It's my first post here, I'm not sure if it's the right section!)
Reply
#2
Hm, that's very odd. I just tried it but couldn't replicate your findings. Have you tried a different port?
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Upload big file on the server HTTP protocol Timych 1 2,411 May-15-2020, 07:12 AM
Last Post: snippsat
  Scraping with some delay Truman 3 3,029 Jun-10-2019, 12:00 AM
Last Post: metulburr
  Web connection delay ebolisa 5 3,009 Apr-23-2019, 11:07 AM
Last Post: DeaD_EyE
  Rewriting HTTP Server from Arduino codingKnight 1 3,059 Sep-25-2017, 10:47 AM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020