I'm certainly not in the market for a webserver with lua support, but if I were I would definitely be looking at nginx first. May I suggest that you make a subsection/table that delineates why someone would go for this rather than nginx? There is a section that says that if you think of apache/nginx first then that {nginx/apache} is probably best for you, but I think lumping in apache and nginx together may be a mistake, and even if I'm giving preferential treatment to nginx I may be swayed nonetheless.
With a small code base there is also h2o and it already has http2 and a very good https performance (can serve around twice as much than nginx).
After looking for most of available http servers h2o is my preferred one right now.
Also I have a fork of h2o compiled as C++ (right now it cleans a bit redundancy/verbosity of C) and add SquiLu and Lua scripting (h2o comes with mruby only).
... however, my h2o servers get a lower score with Qualys SSL Labs in their default configuration than Nginx does. This is due to the fact that h2o seems to support ciphers per default that are considered less secure (according to Qualys SSL Labs while testing servers using h2o).
I've looked at h2o website and seems that someone asked this question and there is an example of a stronger configuration.
Using it I did a test on a raspberry pi 3 and here https://gist.github.com/mingodad/e5a46c809ee030befc18 is the output.
What I noticed is that with nginx there is more connections even using keepalive (h2o 4 connections, nginx 102 connections).
Ha, I remember when we picked nginx because it was small, fast and simple years ago (compared to Apache). It is interesting how the cycle repeats. This is the new fast and simple, kind of what nginx started with.
Replacing the epoll() with kevent() looks pretty straightforward if you want to try it out, but FreeBSD should be able to do other tricks as well (e.g. http filters)
It seems like a cool project with a nice clean coding style, but the lack of API documentation makes it less inviting. I'm sitting here grepping through the repo without much of an idea of what to try next besides reading the whole code base.
Or closer to one, anyway. Support for RTOS's like QNX and INTEGRITY puts it ahead in a big way. Someone might port this to GenodeOS, MINIX 3, or something similar. Nonetheless, it's a start that might save someone some money. If it's well-done internally, it might also be easy to port to other languages or secure CPU's in development. That rids us of need for garbage collection or JIT.
More or less. There was a minor parser combinator arms race in the Rust community a few months ago using http parsing as the benchmark and my takeaway (only half paid attention, I haven't needed to write a parser) was that they got to roughly as fast as handwritten C parsers. Example:
Lua is a simple and only slightly quirky (1-based arrays) dynamic programming language. It has exceptionally small and high quality implementations in Lua and LuaJIT. It has very good documentation.
Its main downside is that the language changes in backward-compatible ways between releases. And worse, LuaJIT has in some sense forked the language. Lua 5.3 introduced integer support, but there are no plans to add this to LuaJIT AFAIK.
Speaking to its small and high quality implementations, Verisign gave a talk on how they used it for their high availability/performance servers. Rather than the usual throw more hardware redundancy at the problem, they went the other extreme and audited and understood every line of code in Lua so they could create a reliable system by eliminating bugs.
And Wikipedia (Wikimedia) uses Lua for their multimedia scripting engine. Besides good performance, the implementation was good and small enough that it could be audited for security.
The 1-based indexing isn't particularly bothersome. It's the method vs. function determination at call site combined with default nil for unspecified arguments that really gets you.
Isn't this what most scripting languages do? I know it's the case with Python and PHP.
And I disagree about the 1-based array indexing. With algorithms that require a lot of 1-off values, it can be a huge pain in the ass, particularly if you're trying to integrate it with C (and its 0-based array indexing). Still not sure why the creators chose it, given that Lua was designed for easy and close C interop.
I agree 1-based indexing isn't ideal, but in the grand scheme of things, the default nils and the method/function syntax are a constant source of mistakes and frustration for me. In Lua you have to call `obj:method()` which to pass `obj` as the first argument. If you accidentally do `obj.method()` - there is no error, but the first argument becomes `nil`.
In Python, there the call syntax is consistent and `obj` is automatically passed as the first argument for methods.
It was in the 90s, especially after the Dr Dobbs article about it, and tons of late 90s and early 2000s games, like Grim Fandango, Baldurs Gate and Escape from Monkey Island used Lua due to its hotness.
Actually, Grim Fandango was the very first known game to use Lua and wasn't due to any hotness. Bret Mogilefsky, who against skepticism, dared to try to create a new scripting engine to replace the aging SCUMM engine. He was given the Dr. Dobbs article by a colleague and things came together. After the technical success of Grim Fandango, it was applied to Escape from Monkey Island.
A few years(?) later at GDC, there was a 2 hour session to discuss scripting in games. Near the end, after everybody was depressed with no viable solutions, Bret's colleague exclaimed, "Or you can do what Bret did" and he was dragged up on stage. Bret gave an impromptu spiel about what Lua was and how they used it at LucasArts. Everybody else frantically scribbled down notes and that was how the video game industry adopted Lua as the dominant game scripting language.
*Source: Bret Mogilefsky's talk at the very first Lua Workshop in 2005
I'm interested in it because the machine learning library Torch is using it (and by extension Facebook and other big tech companies). It's also one of the fastest dynamic languages for web applications