1. Technology

G-Wan Superfast Webserver for C Scripting

By August 30, 2009

Follow me on:

G-wan isn't open source but it is free, runs on Windows and lets you run scripts written in C.

I unpacked the zip file and ran the 106KB exe and pow had a local web server running that appears robust, comes with a number of sample scripts and has a decent API and documentation. I ran the amortization example, showing monthly payments for my house loan over 25 years. That page took 2,736,400 cpu clock cycles to generate on my PC where 3 million = 1 ms. That's very quick! Reading the source code I notice that it uses Ajax to do the call to the C script.

For those that are skeptical about using C code in a web server, G-Wan implements dynamic buffers with a library of calls to load files from disk, do text manipulation, even find and replace strings. "Standard" scripting code such as PHP requires functions like url_encode, escape_html to deal with html or escape values. In G-Wan these functions are provided, as is high precision CPU time so you can measure how long it took to output a page to the CPU Cycle! Overall I get the feeling that it has been very well thought as a powerful yet light weight web-server.

I have one suggestion that could enhance G-Wan. Make it work with SQLite as it appears a natural fit.

August 30, 2009 at 2:33 pm
(1) Pierre says:

Hi David,

Thank you for the review -and for your pertinent suggestion.

SQLite will be very easy to integrate with G-WAN because G-WAN will soon show examples about how to drag & drop shared libraries in a folder to import all their function calls (without writing any interface code).

The same will go with graphic libraries, scientific libraries, encryption and so on.

Developers will also be able to instantly reuse any library they have used in the past whether or not they have its source code.

G-WAN is there to make coders’ life easier.


October 9, 2009 at 9:10 pm
(2) a. nonymous says:

interesting project.
it is a pitty the gentleman (Pierre) is relying
solely on a web form as means of electronic
contact and this form appears to be disfunctional.
so i’ll put my question here, he seems to read this page :]
btw. this is still the only page i have found that has
the closest thing to a review..

(just a tip for greater publicity: create a g-wan wikipedia page and put a see also link on all the other webservers..)

so the mail i tried to send to the author but getting
an error message all the time:

hi there,

a very interesting project.
it’s nice that c script can be run,
but what about using g-wan as general purpose web server? is it faster serving php sites than say nginx? do you have benchmarks for this? could you also use some other benchmarking tools than ab? like http_load and some others? thank you

October 18, 2009 at 10:06 am
(3) Don says:

I also tried to submit an email there, without success. I love the looks of this, but the only build right now is Windows. I’d love to see an OS X release.

October 29, 2009 at 3:10 am
(4) Pierre says:

Hello “a. nonymous”,

My email address xyz@twd-industries.com (my previous project) receives thousands of junk emails per day (after anti-SPAM filters do their job) because that’s pretty targetted text rather than just the usual crap.

I was not animated by the burning desire to expose xxxxxx@trustleap.com to the same feat (but you can just replace the ‘x’ with my first-name to reach me).

Regarding the web form, you have the source code as part of G-WAN samples. It is not dysfunctional. If your emails do not go through then this is because they are blocked (by an external player).

A couple of fans posted twice TrustLeap to Wikipedia and it was censored instantly.

Paid Web servers have no problem to be listed so the only reason why TrustLeap is rejected seems to be the fact that it is not appreciated by long-arm players…

For PHP, I explored the possibilities and, beleive me they are not pretty. So-called “FastCGI” is way too big and slow to serve the purpose it claims to fit: G-WAN would double in size by just linking with the FastCGI library.

People do not seem to realize that this is all about latency: everything must be carefully implemented to avoid bottlenecks.

Some hope for you:

The next version of G-WAN (expected for Nov. 2009) will let you use G-WAN as a socket-server (with Connection Handlers). It means that you will be able to implement an email server (IMAP, POP3, SMTP), or SSL, or an interface to anything else (like FastCGI or directly to PHP/Perl, etc.).

Connection Handlers will let you intervene:

- after accept
- after read
- before write
- after write

so G-WAN will be all yours for any project you might imagine.

Don, this release will also bring a Linux port. Solaris will follow. One requested NetBSD, and now you want Mac OS X. Hopefully, it will be easier within the Unix world than between Windows and Linux.

Benchmark tools:

I tried others than ab but as I need to compare platforms availability on Windows/Linux/Solaris/etc. is a must.

You are free to do your own test (please let me know what you got).

If you want to follow what is going on, have a look at:




November 30, 2009 at 4:55 pm
(5) Lex says:

1. Contact form http://www.gwan.com/en_contact.html takes 20 seconds to respond after “Send”, and there’s no ack of failure or success. I tried three times with long and short msgs. (Firefox 3.5.5, XP SP3)

2. Wikipedia: Don’t blame “long-arm players” for “censorship” in the deletion of a G-WAN article. It’s more likely a zealous editor acting on personal bias, not some company. Spend more time editing WP articles & reading policies, and you’ll see that there are lots of reasons badly written, ad-like, or unsubstantiated articles get proposed for deletion. You haven’t been singled out – just look at http://en.wikipedia.org/wiki/Lighttpd – it’s at risk of going away because it looks like a desperate ad.

See my followup email to you…

February 26, 2010 at 5:25 pm
(6) Oleksandr says:

Told ya Pierre, sophistication ratio. Bunch of people worried about what can your software do for them instead of drooling of the possibilities of what can THEY do with it.

October 20, 2010 at 9:02 am
(7) Proyb2 says:

Pierre will soon make it easy for us to copy and paste the C script example and many said features will see G-wan as a great solution for bespoke projects.

I’m looking for someone who willing to spend time converting PHP into C script, if you like to contribute, let me know and we will appreciate it.

September 11, 2011 at 2:49 am
(8) DcMON says:

Technical comment:

The gwan web server is compressed with upx (Ultimate Packer for eXecutables). After deflation the size of gwan executable is: 474584 bytes!

The C scripting capability provided by Fabrice Bellard’s
Tiny C Compiler

January 15, 2012 at 6:42 am
(9) Jerome says:


The Gwan server is around 100 KB in size, which leads to approx. 200 KB without compression.

Compare that with other application servers like IIS, GlassFish or Tomcat.

Further, C, C++ and Objective-C scripts are provided by GCC, the Linux compiler.

Just trying to keep the record straight…

May 23, 2012 at 10:38 am
(10) James says:

Now G-Wan’s forum look so dead since Pierre closed new comments and don’t even reply to my email. What is happening?

I decided to seek other technology and found Scala (better than Java) is a pretty simple language to learn and scalable too!

Together with Akka 2.x plus Lift framework, it’s an awesome innovation for distributed system ever! Sorry Pierre, Scala meet beyond my expectation.

May 24, 2012 at 12:31 pm
(11) Java says:

Seem like it has been quiet for G-Wan with no update since March. I guess the progress is either abandon.or the main developer is missing in action. Love G-wan with Java but Caucho Resin offer attractive solution for tomorrow problem.

Recently, Oracle is making a real effort to build a world-class JVM with Java 8 and 9, it’s certainly the hottest topic in the community for building mission critical, cloud, clustering and enterprise software. I believe Scala run on top of JVM will provide a significant benefits outweight G-Wan in term of market competitiveness and a balance of speed-feature rich.

We can finally gain even better performance with multi-cores which may probably displace Apache, Nginx and even G-Wan from top to bottom.

While we aren’t trying to be troll why G-Wan is bad, it’s a fact that G-Wan don’t guarantee you 99.9999% uptime availability in the case of hardware failure, right, it only has an A* grade in speed but poor documentation for developers is a big mistake to begin with. Where has the community disappear? StackOverflow? Closed source manage by one developer is a suicide innovation.

May 31, 2012 at 12:21 pm
(12) Better than GWan says:

Hmm, I like to suggest libsxe, where tested as of April 2012, has found to be faster than G-Wan in AB test. It’s confirmed.

June 16, 2012 at 3:04 am
(13) Update says:

Pierre (the solo developer of G-wan) is now working on PHP support for G-wan but has been facing difficulty due to not thread safe, it seem Zend company ignore Pierre’s calls that left him doing all the research himself, until then, might take another year to complete it.

For god sake, why not get a group of talent to work on this product rather than solo to speed up the progress and testing? Is he afraid that someone will stole the sourcecode therefore it has always been closed-source? Quite disappointed.

July 5, 2012 at 1:44 pm
(14) James says:

On G-wan website, it mentioned powered http://www.engineon.com as the massive Paas, where the site now? Taken offline for good?

July 9, 2012 at 2:37 am
(15) Peter says:

Where is the benefits of using G-wan?

Own G-wan sourcecode will cost you USD$8 100+, on the other hand, 2x 8-cores servers with opensource web server are about the same performance as G-wan. Nothing is free.

July 12, 2012 at 3:35 pm
(16) nodoubt g-wan slow says:

no doubt. it fare badly at dynamic page http://joshitech.blogspot.sg/2012/04/performance-nginx-netty-cppcms.html

the result is clear nobody benchmark using hello world.

July 12, 2012 at 3:39 pm
(17) James says:


who said g-wan is the fastest? it fare badly at dynamic page. so much for hello world benchmark which is useless for the real world.

July 12, 2012 at 3:52 pm
(18) Peter says:

Really good? Have Pierre tried it with a real world testing with G-wan?

These benchmark shown G-wan is bad at dynamic page.

July 12, 2012 at 3:55 pm
(19) Peter2 says:

Really? G-wan doesn’t performance great with real world testing which use dynamic page, however, it merely good for static page and that is useless. CPPCMS is found to be better with Nginx vs CPPCMS vs Play vs Gwan. Google it and you will see the truth.

October 13, 2012 at 9:07 am
(20) Eli says:

Haters hate…

“Great spirits have always found violent opposition from mediocrities. The latter cannot understand it when a man does not thoughtlessly submit to hereditary prejudices but honestly and courageously uses his intelligence.”

(Albert Einstein)

October 22, 2012 at 4:29 am
(21) Sarah says:


The “haters” seem to identify closely to the other server vendors.

Now G-WAN supports, Java, PHP and C# scripts (faster and more scalable than the respective vendor solutions), the question is not only that G-WAN is so much “faster”, the question is how fast G-WAN will get (what they see as) “their” market shares on “their” own ecosystem.

Therefore, facing no way out to compete with G-WAN, there’s no wonder why they have no other way (than “hate”) to express their frustration.

November 22, 2012 at 8:23 pm
(22) Reason says:

“Sarah” here, is clearly Pierre Gauthier, the author of G-WAN. Just look at that excessively-quoted, paranoid writing style.

Leave a Comment

Line and paragraph breaks are automatic. Some HTML allowed: <a href="" title="">, <b>, <i>, <strike>

©2014 About.com. All rights reserved.