ZeroHTTPd

Learning and science

teaching material for server architectures

SHOW HN2019

Legend

ZeroHTTPd

A web server to teach Linux performance, with benchmarks

unixism.net

#linux performance#epoll#web server#http benchmark

472points
57comments
#38of 2,195 in 2019
Top 2%of 2019 by points

How HN took it

CuriousMostly questions and neutral comments

4 positive, 13 neutral or asking, 0 mixed, 7 critical, out of 24 comments about the project. Thread score -0.04.

Performance: 1 for, 3 againstIdea: 1 for, 2 againstExecution: 0 for, 2 againstDocs: 1 for, 0 against

The thread, comment by comment

Each row is a top-level comment and its replies, in HN's order. Select a cell to open that comment on HN.

positive neutral or mixed critical about another commenter or something else the maker

What HN said

What people liked

  • Useful, well-written tutorial that explains server internals

    From 3 comments
    • Very insightful article. Thanks for putting it together. Looking forward to an update with io_uring.
      navinsylvester on HN
    • Great article, explains things better than most O'Reilly books.
      cadamangue on HN
    • Heh, you beat me to publishing my own simple HTTP server. Though the one I'm working on is even more dumbed down, only supporting GET to serve prepared HTTP messages from a hash…
      antisemiotic on HN

Objections

  • Not safe to run; uses unsafe strcpy and buffer handling

    From 2 comments
    • Had a quick glance and while the content seems worthwhile I am a little saddened by the code. There are numerous calls to strcpy() which is a buffer overflow waiting to happen. I…
      marios on HN
    • strcpy() is actually fine when used with literal/constant strings and the buffer is large enough. The compiler can even optimize it and issue warnings in case of overflow.…
      GuB-42 on HN
  • Benchmarks omit HTTP keep-alive, making results misleading

    From 2 comments
    • So there is no keep alive in these tests including lb to application? Makes sense why the qps is so low on a single core for all versions tested if nginx is having to reopening a…
      tele_ski on HN
    • Testing "Linux server architectures" without considering keepalive is worse than useless.
      otabdeveloper3 on HN
  • Only HTTP/1.0 and minimal header handling

    From 1 comment
    • > I guess it is 1.1 Negative ghost rider, it's hard-coded to 1.0: https://github.com/shuveb/zerohttpd/blob/master/01_iterative/main.c#L468 (in reality it's barely even that e.g.…
      masklinn on HN

Requests

  • Add io_uring variant

    From 2 comments
  • Add kqueue-based version for BSD

    From 2 comments
    • Notably lacks part VIII, kqueue-based server. This is because Linux doesn't support kqueue. Got to make do with their pointless NiH syndrome fueled epoll().
      snvzz on HN
    • I've never really done any serious work on anything other than Linux. But I always wanted to try out kqueue(). Even if I don't add a separate section on kqueue(), I think it…
      shuss on HN
  • Report memory usage in benchmarks

    From 1 comment
    • It would be nice to also compare memory use, which will vary between implementations.
      megous on HN

Questions

  • Would it scale on many-core machines?

    From 1 comment
    • Awesome comparison, super curious how this would scale out on the current generation of big CPU machines. E.g. Epyc with 64 cores, would threads still perform that well?
      dominicl on HN
  • Does it work with sendfile on OpenBSD?

    From 2 comments
    • OpenBSD doesn't have sendfile as far as I know so maybe s/Open// there too
      cyberpunk on HN
    • That manpage is an import from freebsd, not part of base -- As far as I can see on my system it's not there: OpenBSD: ``` $ man 2 sendfile man: No entry for sendfile in section 2…
      cyberpunk on HN

Alternatives named

  • Nginx

    From 2 comments
    • Yes, IIRC, even Nginx uses the general structure you're describing.
      shuss on HN
    • nginx and others use worker processes instead of worker threads, with epoll in each worker. This is for robustness and garbage collection, AFAIK.…
      wolf550e on HN
  • lwan

    From 1 comment
    • Another project in the performance oriented Linux HTTP servers is https://lwan.ws/ (using pervasive zero copy), but as far as I know it does not cover a lot of features yet.
      _pmf_ on HN
  • Apache mpm_event

    From 1 comment
    • So does Apache with mpm_event, which has been around for close to 15 years now. The fact that you can run Apache in a process pool model doesn't mean you should. That mode was…
      xorcist on HN

Category, keywords, summaries and labels on this page were made by AI (Thread Reader v2) and not checked by hand. Each point links to the comments it came from.

Add a badge to your READMEShown on HackerShow
[![Shown on HackerShow](https://hackershow.org/badge.svg)](https://hackershow.org/show/20081488)