OT: limit number of connections from browser to my server?

Rob Gaddi rgaddi at highlandtechnology.invalid
Tue May 17 12:59:26 EDT 2016


Steven D'Aprano wrote:

> On Tue, 17 May 2016 02:52 am, Chris Angelico wrote:
>
>> On Tue, May 17, 2016 at 2:34 AM, Rob Gaddi
>> <rgaddi at highlandtechnology.invalid> wrote:
>>>> The solution might actually be to move all your static files
>>>> elsewhere. Slap 'em up onto github.io or something, and then the
>>>> browser is free to make all the parallel connections it likes; your
>>>> embedded device can just serve the stuff that actually varies
>>>> (presumably the main HTML file). I know that isn't what you asked for,
>>>> but it's something to consider :)
>>>>
>>>> ChrisA
>>>
>>> Oooof.  Not to be rude, Chris, but your "software guy" is showing.
>>> Grant's got the right of it; if you're shipping a box with an RJ-45 and
>>> a webpage, and you want the customer to be able to always make it
>>> work, then it needs to be a self-contained entity.  The belief that your
>>> external dependancies will always be there is why leftpad was able to
>>> break everything, and why Google just bricked a bunch of people's
>>> expensive Revolv Hubs.
>
> Schadenfreude is a beautiful emotion :-)
>
> "Yes, let's put a critical requirement of our business in the hands of a
> third party with absolutely *no* obligations to us, and no government
> oversight. What could *possibly* go wrong???"
>
>
>> I agree, but I also make no apology for suggesting the option of
>> getting someone else to do some of the work. In this case, it can be
>> rejected for the exact reason you cite (dependencies are a cost, and
>> in this case way too high a cost), and that's fine and correct.
>> Ultimately, if the job gets done, everything else is implementation
>> detail, with consequences - and I know a lot of people who'll
>> willingly sacrifice "reliability in the face of an internet connection
>> outage" in favour of "less than fifteen second response time". 
>
> How can you not serve a web page over your LAN in 15s?
>
> I mean, you could *almost* do it by hand, copying the files onto a USB stick
> and walking them across the room in 15 seconds. Maybe 30.
>

Simple, because embedded web servers running on toy microprocessors are
HARD.  When you're trying to work with whatever browser the customer may
have, you have no control over the number of simultaneous connections 
it will try to make to your box.  If you don't allow those connections
it can cause huge stalls by forcing the TCP layer to time out.  If you
do, in Grant's case, it forces you to perform tons of expensive
public-key crypto on a 40 MHz processor (which, hmmm, external memory
bus, ~40 MHz... Coldfire?).

A lot of things you can take for granted on a compute monster (like a
Chromebook or Atom based laptop) get much more complicated when you're
resource constrained.

-- 
Rob Gaddi, Highland Technology -- www.highlandtechnology.com
Email address domain is currently out of order.  See above to fix.



More information about the Python-list mailing list