Live data from Hacker News

Self-Contained Pure-Go Web Server with Lua, MD, HTTP/2, QUIC, Redis Support

github.com

1–10 of 64 posts

Re: Self-Contained Pure-Go Web Server with Lua, MD, HTTP/2, QUIC, Redis Support

#3
post #2

This is quite impressive, but this claim is a bit wrong: > All in one small self-contained executable. Size of algernon executable: 24.4 MiB Size of nginx-full executable: 1.1 MiB Size of apache2 executable: 648K

If that's the main criticism you have of the project, I'd say that's pretty good.

In fact, the readme of this project is really thorough!

Re: Self-Contained Pure-Go Web Server with Lua, MD, HTTP/2, QUIC, Redis Support

#4
post #2

This is quite impressive, but this claim is a bit wrong: > All in one small self-contained executable. Size of algernon executable: 24.4 MiB Size of nginx-full executable: 1.1 MiB Size of apache2 executable: 648K

A big part is almost certainly the difference between dynamic and static linking.

Can you run ldd on all of these and then report the combined size for each binary+libraries?

Re: Self-Contained Pure-Go Web Server with Lua, MD, HTTP/2, QUIC, Redis Support

#5
post #4
post #2

This is quite impressive, but this claim is a bit wrong: > All in one small self-contained executable. Size of algernon executable: 24.4 MiB Size of nginx-full executable: 1.1 MiB Size of apache2 executable: 648K

A big part is almost certainly the difference between dynamic and static linking. Can you run ldd on all of these and then report the combined size for each binary+libraries?

I don't have nginx installed (got the number from a web download of the .deb package), but running this for apache:

$ echo $((`ldd /usr/sbin/apache2 | cut -d">" -f 2 | sed "s/(.*$//;s/ //" | xargs du -L | cut -f 1 | sed "s/$/+/" | xargs echo` 0))

3200

So 3.2 MB of shared library dependencies. 1.8 MB just being the libc which is almost guaranteed to be used by a different program already.

Re: Self-Contained Pure-Go Web Server with Lua, MD, HTTP/2, QUIC, Redis Support

#6
post #3
post #2

This is quite impressive, but this claim is a bit wrong: > All in one small self-contained executable. Size of algernon executable: 24.4 MiB Size of nginx-full executable: 1.1 MiB Size of apache2 executable: 648K

If that's the main criticism you have of the project, I'd say that's pretty good. In fact, the readme of this project is really thorough!

Well yeah it's definitely an interesting approach. I guess it's much more lean than running a whole Ubuntu container VM that has all of these things installed, or running a gigantic bloated Javascript toolchain just to convert the scss or md files to css or html.

Re: Self-Contained Pure-Go Web Server with Lua, MD, HTTP/2, QUIC, Redis Support

#7
post #2

This is quite impressive, but this claim is a bit wrong: > All in one small self-contained executable. Size of algernon executable: 24.4 MiB Size of nginx-full executable: 1.1 MiB Size of apache2 executable: 648K

apache2 is mostly modules that are loaded at runtime.

Re: Self-Contained Pure-Go Web Server with Lua, MD, HTTP/2, QUIC, Redis Support

#9
post #2

This is quite impressive, but this claim is a bit wrong: > All in one small self-contained executable. Size of algernon executable: 24.4 MiB Size of nginx-full executable: 1.1 MiB Size of apache2 executable: 648K

For self-contained architecture-specific server binaries, there is no practical difference between 240KB, or 2.4MB, or 24.4MB, or even, at a stretch, 244MB. It's not worth mentioning or optimizing for, except as novelty. I wish people would stop golfing with these numbers.

Re: Self-Contained Pure-Go Web Server with Lua, MD, HTTP/2, QUIC, Redis Support

#10
post #8

"Files that are sent to the client are compressed with gzip, unless they are under 4096 bytes." That's interesting. Is that a common optimization? I hadn't heard of any other web server doing that.

I'd be surprised if it didn't exist in every compression middleware.

For example, https://github.com/expressjs/compression/blob/dd5055dc92fdea...

Post reply on HN