
Gwan – a fast 150kb web server supporting 14 scripting languages - MrBuddyCasino
http://www.gwan.ch/benchmark
======
eik3_de
"GWAN isn't designed to be a robust webserver, it's designed to perform
exceptionally well in contrived and outlandish benchmarks [...]"

from [http://tomoconnor.eu/blogish/gwan-snakeoil-
beware/](http://tomoconnor.eu/blogish/gwan-snakeoil-beware/)

~~~
userbinator
_Oh, and their examples are weird. I found this snippet earlier on, and it
made me go “Huh?”_

    
    
        if(s[0] == '%' && s[1] == '2' && s[2] == '0') // escaped space?
    

That can read past the end of the string if it ends in a '%'. The length check
is missing. Maybe it's not such a big deal here, and this is only an example,
but if the author's examples are this sloppy, and we can't see the actual
source code of his server, then it's hard not to generalise.

~~~
FooBarWidget
It will not read past the string if it's null-terminated.

~~~
viraptor
It took me a moment to figure out why that won't happen. It could use a
comment in that place.

------
simula67
I kind of feel bad when this project gets a bad rap online. Lets look at the
pros and cons :

Pros

1\. Very fast

Cons

1\. Author looks unstable. (S)He may leave the project causing technical debt.
Mitigation : Use the proxy in some standard way ?

2\. Author's criticism of open source. Seriously ? You will not use someone's
software because of his/her political opinion ?

3\. Non-open source. How many of us use Windows ? Linux with binary blobs ?
Fully open processors ?

4\. Author seems conceited. So what ? (S)He managed to do something no one
else has, shouldn't (s)he be proud ?

~~~
WoodenChair
I agree with you. There are legitimate reasons to only want to use open source
software, but the people who take it to the extreme and get angry at other
people for choosing to use closed source software, or who think closed source
software should not exist, kind've irk me.

This is probably not a product I would ever recommend to anyone. It's not a
product I would deploy myself on an important project, but the level of
negativity and name calling against the product and the author is completely
unwarranted. He has a right to his opinion, and he has a right to distribute
his product however he wants. You have a right not to use it and to criticize
him - but keep it respectful!

------
foxhill
whilst performance does look staggeringly good, it is entirely negated by the
pitiful rationalisations made against not being open source. given everything
that's happened regarding privacy recently, why on earth should anyone trust
their binaries?

it might fly in the world of Windows, but i can't see this becoming a thing on
Linux.

~~~
asuffield
Yeah, it inspires a reaction of "these numbers look surprisingly good"
followed by "the only evidence I have for its performance is that a person who
is clearly crazy claimed they got these results".

I would like to see some independent testing, by somebody who is alert for
benchmark-cheating hacks.

------
dattanin
if you are considering it for any serious use, may be you want to refer
previous discussion.

[https://news.ycombinator.com/item?id=4109698](https://news.ycombinator.com/item?id=4109698)

~~~
yread
This comment is helpful:
[https://news.ycombinator.com/item?id=4110471](https://news.ycombinator.com/item?id=4110471)

it seems to do what it says

------
cordite
Awhile back I tested this by making my own lib which did sleep and then print
a random number, it worked fine, but the moment I did a benchmark, with
randomized cookies and other things, which is read from inside the source, all
requests returned the same result.

This server will not respect contexts which will change what the user sees. It
just games the benchmarks with an in-memory cache.

------
userbinator
150KB? No... it's packed with UPX. Unpacked size is over 400KB.

This, and the fact that he seemingly chose to obfuscate random strings in the
binary with an absolutely trivial cipher, make me quite wary of trusting this.

~~~
zorgium
A few releases ago, it was also killing (with segv!) whatever process was
observing the server with ptrace(), such as gdb or strace. I ended up
unpacking and firing IDA; found the routine, and yes, that was exactly what
was happening. I don't know if the current version does that anymore.

------
Mithaldu
The frontpage describes what it actually supports:

[http://gwan.ch/](http://gwan.ch/)

Interestingly they do not provide a windows version of the server, citing it
being slower than the _nix one, which entirely ignores that quite a few people
develop on windows and deploy to_ nix.

Edit: Oh wow.

[http://gwan.ch/insurance](http://gwan.ch/insurance) : "To Secure your
Investment on G-WAN... ...Buy G-WAN's Source Code!"

~~~
ckluis
To be fair in enterprise software we end up with escrow agreements all the
time. It’s not that crazy. Can’t speak to the author of the project, just this
one little snippet.

------
kellros
Looks interesting, but the C# benchmark is horrible.

There's no way a properly written C# program would take IIS + ASP.Net C#
............ 171.8 ms! A bare bone Katana/OWIN self-hosted hello world echoing
endpoint can easily surpass 5K+ req/s while the equivalent ASP.NET MVC hello
world echoing endpoint can surpass 3.5K+ req/s with the standard routing.

I suspect the biggest contributor to the slowness is all that string
concatenation - because every 'version' of a string is hashed and stored in
memory e.g. "a" ["a"], "a" \+ "b" ["a","b","ab"] etc. (use StringBuilder or
write directly to the output)

I suspect the Java benchmark also suffers due to this. (use StringBuffer)

------
FractalNerve
I couldn't find the windows version, sorry. But I found someone who has built
a cms ontop of this server.

[http://solicms.com/](http://solicms.com/)

Also there seem to be some people creating projects with it on Github:
[https://github.com/search?p=1&q=gwan&ref=cmdform&type=Reposi...](https://github.com/search?p=1&q=gwan&ref=cmdform&type=Repositories)
I thought you might be interested in the code :)

------
ck2
So where is it in use?

I am always skeptical of any claim of more than twice of an improvement over
things that are already highly optimized (like nginx).

Found this list of "customers" [http://twd-
industries.com/customers.html](http://twd-industries.com/customers.html) but
not sure if gwan users or what websites.

g-wan website needs a redesign for certain

------
gamebak
I think it performs really well on some crappy vps's. That floating point
exception is happening with the newer kernels, but who really cares. The claim
with php (500k requests) they actually managed to get there with ph7 (which is
way off). Still, even so, you could use gwan to get some high performance out
of your static files.

------
vomitcuddle
Unless you're only serving static files (on a 10Gbit+ connection) or are still
running Apache/IIS, the web server is not the bottleneck, it's either your
(Python/Ruby/Node/...) code or the underlying database.

------
DrinkWater
[http://www.gwan.ch/about](http://www.gwan.ch/about)

How trustworthy, the person that is listed after the Developer is his legal
backup.

