User avatar
rpdom
Posts: 17736
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: Webserver

Wed Jan 06, 2016 6:59 pm

ejolson wrote:
rpdom wrote:I'm on their (Virgin Media)cheapest option, only 50Mb/s down.
Is this upstream or downstream or both? Some services only advertise the downstream, which can be 10 to 50 times faster than upstream.
Downstream, as I said. Up is something like 5 or 7Mb/s.

It's a lot better than the 0.5Mb/s down 128Kb/s up that I had when I first joined, which was a great improvement on the 44.1K I was getting on dial-up (with a per-session time limit of 2 hours).

ejolson
Posts: 6040
Joined: Tue Mar 18, 2014 11:47 am

Re: Webserver

Wed Jan 06, 2016 7:20 pm

Heater wrote:Round here the worst, slowest, cheapest domestic internet connections I have seen for five years or more are 10Mb/s down and 20 or more up (Yes, outgoing faster than incoming) Free with the rent or maybe 10 Euro a month.
Strangely enough 20 mbps is the fastest upstream domestic connection mentioned so far. The fact that upstream is faster than downstream is very interesting as this encourages production rather than consumption. Since production tends to generate wealth, this sounds great for everyone involved. It would appear that the 100 mbps interface on the Pi is more than enough to serve web pages through such a connection.

User avatar
Jim Manley
Posts: 1600
Joined: Thu Feb 23, 2012 8:41 pm
Location: SillyCon Valley, California, and Powell, Wyoming, USA, plus The Universe
Contact: Website

Re: Webserver

Wed Jan 06, 2016 10:52 pm

Heater wrote:
Jim Manley wrote: Europe is much more densely populated than most of the U.S.
Yes, but it's more densely populated than places around here that have excellent network infrastructure:
Rank Country
179 United States
182 Estonia
195 Sweden
203 Finland
213 Norway
The U.S. is only densely populated on portions of the coasts and along the waterways in the Midwest - the other half of the population is in the boondocks, Smithereens (Kansas), and other places with names such as Deadhorse (Alaska), Hell (Michigan), Hellhole (Idaho), Nothing (Arizona), Disappointment (Kentucky), Dismal (Tennessee), Hooker Hole (Louisiana), and No Name (Colorado)! There are over 30,000 municipalities across the U.S., but the above are _tiny_ countries with only a handful of population centers/centres each, much like the South Korean example, and those rankings don't take into account the geographic asymmetries and size differentials at all that we suffer, as I mentioned. This is not a simple one-number-evaluatable problem - it's multi-dimensional, as you have to factor in:

- population size (we're around the same size as all of Europe, but slathered over a place the size of a full continent, not a rump of one ;) and then there are the islands and a single state even bigger than most countries in the world, and even Texas, and that's saying a _lot_, if you've ever met a Texan! :shock: )

- legacy infrastructure value of both computing and telecommunications elements (we had the Internet before it was even called the Internet - I still have an ARPANET e-mail address sitting on a virtualized IBM 360 mainframe running MVS!), heterogeneity of services provided (VOIP still isn't the end-to-end norm for most areas)

- reliability/maintainability/consistency/et-cetera-bility (just because you have 200 Mbps peak, instantaneous service advertised, doesn't mean it's available to everyone, all the time, everywhere in a country)

- regulatory hurdles, not to mention corporate and political agendas (where you stand depends on where you sit :roll: )

When things are close together (you can almost walk in any direction in Europe and be in a sizable town within a day), stringing fiber is pretty easy, but when it takes three months to walk across a nation, and you're being eyed by wolves, bears, mountain lions, buzzards, vultures, and other predators and carrion (and that's just the human riff-raff, never mind the fauna! :o ), it's not such a walk in the park. There aren't even any yummy Swiss chocolates, authentic cappuccinos, fresh pastries, or other culinary diversions beyond cookie-cutter superslab vendors of uniformly-poor, mediocre dreck. As they sing on Broadway, "It's Hard Out There for a Pimp." :lol:
The best things in life aren't things ... but, a Pi comes pretty darned close! :D
"Education is not the filling of a pail, but the lighting of a fire." -- W.B. Yeats
In theory, theory & practice are the same - in practice, they aren't!!!

hello world :-)
Posts: 121
Joined: Sat Nov 14, 2015 7:12 am
Location: England, in an insecure cloud, ie. The Interwebs
Contact: Website Yahoo Messenger AOL

Re: Webserver

Thu Jan 07, 2016 7:06 am

Post deleted
Last edited by hello world :-) on Sun May 15, 2016 3:09 pm, edited 1 time in total.
I do moral support. Here: https://www.raspberrypi.org/forums/search.php?search_id=egosearch
I know I use too many parentheses. Problem?
Topics I have posted in: http://bit.ly/1NbDdr5
My topics: http://bit.ly/1ObnKqQ
All my posts: http://bit.ly/1OHzje7

User avatar
Jim Manley
Posts: 1600
Joined: Thu Feb 23, 2012 8:41 pm
Location: SillyCon Valley, California, and Powell, Wyoming, USA, plus The Universe
Contact: Website

Re: Webserver

Thu Jan 07, 2016 8:30 am

ejolson wrote:I get about 94 mbps between a Pi 2B and a Linux PC using iperf. This is pretty close to the theoretical 100 mbps hardware maximum. A Pi should be able to utilize at least half that bandwidth when serving large static pages cached in RAM. However, many websites are moving to https with SSL to prevent the injection of advertising and worse into their content using man-in-the-middle techniques. Note, for example, how the Raspberry Pi forums themselves are served through an encrypted channel, even though no sensitive financial information is being transmitted. Therefore, to fully answer the original question, it may be necessary to know how fast SSL runs using an encrypted webserver benchmark on the Pi.
Hey ejolson - we want to be careful to point out that this sort of single-link network connection is highly atypical for what most users will be doing, which will usually involve multiple network devices on the same network segment, especially if there's a connection to the Internet. As others have pointed out, there are often bottlenecks further on in most networks, especially if a user is on a wireless link and particularly if on a mobile link in most places and when most people want access (early mornings, midday, and early evenings). I'm looking forward to seeing SSL-based test results over a wide variety of common scenarios and locations, since major sites now require SSL connections in the wake of revelations of intelligence agencies' monitoring of network communications that are not encrypted end-to-end.
The best things in life aren't things ... but, a Pi comes pretty darned close! :D
"Education is not the filling of a pail, but the lighting of a fire." -- W.B. Yeats
In theory, theory & practice are the same - in practice, they aren't!!!

User avatar
Jim Manley
Posts: 1600
Joined: Thu Feb 23, 2012 8:41 pm
Location: SillyCon Valley, California, and Powell, Wyoming, USA, plus The Universe
Contact: Website

Re: Webserver

Thu Jan 07, 2016 9:31 am

Heater wrote:Anyway, sounds like I have to try a little experiment to see how many simultaneous HTTP/HTTPS connections a Pi can handle. Got to back up my hand waving somehow right?
Actually delivering data over all those connections is another matter....those are the hard rocks.
Hey Heater - yeah, it would be interesting to see what realistic testing of a typically-modern site would reveal, and I suspect that the bottleneck will be the CPU, not DRAM, as most software suffers from on the Pii and other SBCs. Just look at the issues the Foundation has taken on in the other direction in terms of browser optimization (granted, a different problem wrt page rendering and GUI support that a server doesn't have to do). On the Pi 2B, it's not clear whether the OS yet would automagically distribute the processes across all four cores evenly at a performance level (not just a number-of-processes level that unsophisticated schemes used in the early days of heterogeneous-tasked, tightly-coupled, multiprocessor systems). I'd like to see if something like Monitorix can show whether resources are efficiently allocated across the cores and DRAM during services operation, and especially as various use cases are executed during testing. It would be good to know if there are scenarios that should be avoided as well as those that a Pi 2B can adequately support.

I would also like to see a complete Internet services suite tested where a web server, database server, mail server, all of the glueware (e.g., PHP, perl, JSP, and other cgi-bin components), and 1,001 other bits and bobs are represented that would make this post break my previous record for length and boredom if they were listed :lol: . Part of that testing would require a realistic test rig where simulated user browser activity is accurately modeled, and the last time I surveyed the available tools they were surprisingly anemic. I suspect there's a lot of in-house tool development that doesn't typically get the attention it deserves as it's not very sexy and often left to interns and newbie engineers. Either that, or it's not a big moneymaker for professional testing toolmakers as most site developers/owners don't budget for it (see again the lack-of-sexiness factor), but it's been years since I last looked and I would love to be pleasantly surprised.
The best things in life aren't things ... but, a Pi comes pretty darned close! :D
"Education is not the filling of a pail, but the lighting of a fire." -- W.B. Yeats
In theory, theory & practice are the same - in practice, they aren't!!!

Heater
Posts: 16870
Joined: Tue Jul 17, 2012 3:02 pm

Re: Webserver

Thu Jan 07, 2016 9:54 am

Jim,
I'm looking forward to seeing SSL-based test results over a wide variety of common scenarios and locations...
This is your lucky day :) See below.

ejolson,
I get about 94 mbps...
Very nice but essentially a very long way from realistic.

1) We are going to be using HTTPS. There is no hope of any security without it (Mind you that's just the beginning if you want to be even slightly serious about being secure).

2) We won't be serving large files cached in RAM. We will be reading files from SD. Or fetching data from a database or from sensors attached to the Pi. No doubt pages will be built dynamically in PHP or node.js or whatever.

3) SD cards are slow.

Just so happens I have a dead simple example of a web server using HTTPS here. So I gave it a try:

I can fetch 16MBytes of random data read from a file on my Pi to my PC using HTTPS over WIFI in 42 seconds. That is only 3.9Mbits/sec

Code: Select all

$ wget --no-check-certificate https://192.168.1.123/gpio2html/random.bin
--2016-01-07 11:27:04--  https://192.168.1.123/gpio2html/random.bin
Connecting to 192.168.1.123:443... connected.
WARNING: The certificate of ‘192.168.1.123’ is not trusted.
WARNING: The certificate of ‘192.168.1.123’ hasn't got a known issuer.
The certificate's owner does not match hostname ‘192.168.1.123’
HTTP request sent, awaiting response... 200 OK
Length: 16777216 (16M) [application/octet-stream]
Saving to: ‘random.bin.1’

random.bin.1                         100%[======================================================================>]  16.00M   313KB/s   in 42s    

2016-01-07 11:27:46 (391 KB/s) - ‘random.bin.1’ saved [16777216/16777216]
The same file fetched using scp takes almost exactly the same time. 3.9Mbits/sec

Code: Select all

$ scp pi@192.168.01.123:pigpio2html/random.bin .
pi@192.168.01.123's password: 
random.bin                                                                                                      100%   16MB 390.1KB/s   00:42
The code for this simple HTTPS server in node.js is here: https://bitbucket.org/zicog/pigpio2html/overview

I have a much more secure node.js server demoing a lot more features if anyone is interested.

Any other little tests we can do?

Edit: Ah Jim, you posted whist I was writing. I should not have asked, you want to see a lot of tests!
Memory in C++ is a leaky abstraction .

Return to “General discussion”