lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On 10/16/2011 6:38 PM, Luciano de Souza wrote:
> What is the simplest way to run a Lua script in Apache producing web
> pages?

Does it have to be Apache? Or would you rather support 10x-100x or more
users on the same hardware?

Because there's a great package that includes Nginx+Lua called OpenResty
[1]. They claim you can serve 30k Lua-based pages/second on decent
hardware, and I'm getting 1800/second on a cheap VPS with no
optimization (and my benchmark may have been limited by the computer I
was requesting pages from or the benchmarking software).

The reason for the speed is that it's deeply integrated into Nginx:
Queries from Lua can yield so that the event loop doesn't block, and so
you get epoll speed from an app server driven by Lua code. The API is
really straightforward too -- good for someone who doesn't want to do
anything more complicated.

Tim

[1] http://openresty.org/