3 ms·
A single-threaded server is fine if you're only mildly IO bound, which is the case when you're serving files-as-resources. My understanding anyway is that http.
by javajosh 5y ago
A single-threaded server is fine if you're only mildly IO bound, which is the case when you're serving files-as-resources. My understanding anyway is that http.server is explicitly not for production use!
- masklinn 5y ago> A single-threaded server is fine if you're only mildly IO bound, which is the case when you're serving files-as-resources. It's fine if you're also evented, but that's not the case here, http.server literally can only interact with one connection at a time, the next connection(s) will be queued up waiting for http.server to finish its thing and accept them. > My understanding anyway is that http.server is explicitly not for production use! Sure, but "I'm at a lan party and have the installer for $game so we don't explode the 'net connection" is not the sort of "production use" that's intended by this statement. Neither is "I want to open this HTML file I wrote which has a bunch of static assets booting up the webapp".
- londons_explore 5y agoIt also means a mis-configured client that doesn't close the connection can hang the server. Looking at you HttpClient-on-esp8266...
- jcims 5y agoWe had an engineer add it to his unit tests and started blaming the network team when everything started slowing down. Took me two days to convince him to try another server.