Live data from Hacker News

A fast and static web server for serving web apps

shortfin.io

101–110 of 135 posts

Re: A fast and static web server for serving web apps

#101

Earlier quoted context omitted.

I don't understand (and am interested). What's "static" about it? With Apache and mod_rewrite and CGI, I could make the functionality you want (which is, of course, completely not low footprint, but I don't understand how what you want is different from CGI).

Static in the sense that it always executes the one function (doesn't load it from disk, its part of the executable) and so there is never any risk that some other path might get you 'out' of the docs directory and into the cgi_bin directory. So in this case static is code for 'compiled in' versus 'dynamically loaded.'

Openresty is a good option for this - Lua in nginx.

Re: A fast and static web server for serving web apps

#102
post #34

I think the landing page would greatly benefit from two short paragraphs: Why Shortfin when we have Nginx/Lighttpd? Why Shortfin when we have thttpd?

1. Shortfin is not a replacement for nginx. I use it myself to create other projects, e.g. fast API servers with one purpose only and a REST server that uses redis as storage. 2. See #1. 3. I don't try to sell anything, it's just an open-source project that I think maybe someone could benefit from. I've learned a lot while coding it.

OK, Shortfin is just trying to be an efficient HTTP server, without a radical differentiating feature or implementation approach.

Well, let a hundred flowers blossom.

Re: A fast and static web server for serving web apps

#103
post #27

Earlier quoted context omitted.

It's a lot worse than the standard configure, make and make install. For one, it's only requiring one simple script to get compromised and replaced to compromise your entire machine. At least when I download the tarball, unpack it, etc. I've got several steps before I even get to the make install that I would run as root. And I might not even do that depending on my install target. If I do, I have ample opportunity t…

I'm a Windows user. Virtually every piece of software I install comes in the form of an executable, that I download-and-run directly from the browser. I often give this executable administrator priviledges. The executable can then do whatever it wants on my computer. Usually it will install said piece of software (except when it was made by Oracle, it'll install said software and the Ask.com toolbar) This has been st…

>Or are Windows sysadmins simply dumber/less paranoid than Linux sysadmins?

cough

Re: A fast and static web server for serving web apps

#104
This code is far off from being production ready. Skimming through the code quickly, there's barely any error handling. HTTP parsing is not compliant either.

https://github.com/timothyej/Shortfin/blob/master/src/respon...

I am not sure what's the point of using it instead of nginx.

Re: A fast and static web server for serving web apps

#105

Close. Can add this to the list like thttpd. Something I keep thinking I'll build is a fast, high connection count, limited HTTP server, something that is essentially a wrapper around a program that works like 'regular' and emits HTML. It is a corner case in a custom corner, but the target it something which is essentially a 'transponder.' In the 'Internet of Things' I want to build a wrapper/environment such that my…

I've used Snorkel[1] for a few C/C++ projects in the past, you may want to check it out; it sounds like it could be what you're looking for (or quite close). Link it with your code, pass it a few config parameters and let it serve static files -- or you can overload GET/POST functions to provide dynamic functionality. 1: http://snorkelembedded.webs.com/

That looks interesting, if somewhat abandoned.

Re: A fast and static web server for serving web apps

#106
post #74

Earlier quoted context omitted.

Hm, I see your point. How would you then recommend installing non open source software on a production system? E.g. a freeware (but proprietary) FTP server or a database engine.

If you are taking recommendations, I wouldn't recommend installing them at all. You could ask the authors to support a platform which has a better security model. (Given that there are open-source and robuster-than-Windows platforms freely available.).

Cool, I'll just email MS and ask them to port Sharepoint to BSD.

Re: A fast and static web server for serving web apps

#107

Earlier quoted context omitted.

From the footer: > It was created in 2011 by Timothy E. Johansson and is the base for the send-API and the tracking server for AlphaMail. > It also powers this website (though behind nginx). You can reach it directly on port 88 : shortfin.io:88

I read that. But why? What's the point in using this if you're going to have nginx in front?

I suppose he is hosting other stuff too, and nginx proxies.

Re: A fast and static web server for serving web apps

#108
post #96

Earlier quoted context omitted.

I've never stated that it was as good as nginx? The answer to "why" is answered in these comments: https://news.ycombinator.com/item?id=6168052 https://news.ycombinator.com/item?id=6168541

If I understand, it's "lighter" than Nginx. Why not writing how much lighter and in which aspects? Of course I can compare the code bases, but you know exactly as you wrote yours, so it would be really nice if you'd write what you know. Thanks.

[deleted]

Re: A fast and static web server for serving web apps

#109
post #79
post #29

Earlier quoted context omitted.

thttpd is probably the most well known "simple" webserver, and is very, very fast[1]. In fact, I think the op needs to explicitly mention thttpd on the page for shortfin and provide a performance comparison, since that's all anyone really cares about ... "is it faster than thttpd ?" [1] http://acme.com/software/thttpd/benchmarks.html

The citation should include a caveat that the benchmarks are from 1998 and that they were ran on a Pentium 100Mhz.

The notes very clearly state, "The benchmark test system is a 297MHz Ultra Sparc with 256MB RAM / 512MB swap running Solaris 2.6".

What you're referring to is merely an observation about the actual capabilities of web servers in general at the time: "Most of these servers have enough oomph to keep a T1 saturated, running on a lowly 100MHz Pentium or maybe even a 486."

Re: A fast and static web server for serving web apps

#110
A lot of you wanted benchmarks so here's one comparing Shortfin with Nginx. The tests was performed with a 56.1 kB PNG image with keep-alive turned off on my laptop. The best result out of 3 tests is shown below.

tl;dr:

Shortfin: 18 914 req/sec

Nginx: 15 603 req/sec

SHORTFIN

  sudo ab -n 100 -c 100 http://127.0.0.1:40/timothy-johansson.png

  Server Software:        shortfin/0.9.5
  Server Hostname:        127.0.0.1
  Server Port:            40

  Document Path:          /timothy-johansson.png
  Document Length:        56089 bytes

  Concurrency Level:      100
  Time taken for tests:   0.005 seconds
  Complete requests:      100
  Failed requests:        0
  Write errors:           0
  Total transferred:      5618000 bytes
  HTML transferred:       5608900 bytes
  Requests per second:    18914.32 [#/sec] (mean)
  Time per request:       5.287 [ms] (mean)
  Time per request:       0.053 [ms] (mean, across all concurrent requests)
  Transfer rate:          1037701.56 [Kbytes/sec] received

  Connection Times (ms)
              min  mean[+/-sd] median   max
  Connect:        1    2   0.0      1       2
  Processing:     2    2   0.1      2       2
  Waiting:        1    1   0.2      1       2
  Total:          4    4   0.1      4       4
  ERROR: The median and mean for the initial connection time are more than twice the standard
       deviation apart. These results are NOT reliable.

  Percentage of the requests served within a certain time (ms)
  50%      4
  66%      4
  75%      4
  80%      4
  90%      4
  95%      4
  98%      4
  99%      4
  100%     4 (longest request)


NGINX

  sudo ab -n 100 -c 100 http://127.0.0.1:41/timothy-johansson.png

  Server Software:        nginx/1.2.6
  Server Hostname:        127.0.0.1
  Server Port:            41

  Document Path:          /timothy-johansson.png
  Document Length:        56089 bytes

  Concurrency Level:      100
  Time taken for tests:   0.006 seconds
  Complete requests:      100
  Failed requests:        0
  Write errors:           0
  Total transferred:      5631000 bytes
  HTML transferred:       5608900 bytes
  Requests per second:    15603.06 [#/sec] (mean)
  Time per request:       6.409 [ms] (mean)
  Time per request:       0.064 [ms] (mean, across all concurrent requests)
  Transfer rate:          858015.83 [Kbytes/sec] received

  Connection Times (ms)
              min  mean[+/-sd] median   max
  Connect:        1    2   0.7      2       3
  Processing:     1    2   0.5      1       3
  Waiting:        0    1   0.7      1       3
  Total:          2    4   0.9      4       5
  WARNING: The median and mean for the processing time are not within a normal deviation
        These results are probably not that reliable.

  Percentage of the requests served within a certain time (ms)
  50%      4
  66%      4
  75%      4
  80%      4
  90%      5
  95%      5
  98%      5
  99%      5
  100%     5 (longest request)
Post reply on HN