lua-users home
lua-l archive

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



On Apr 26, 2009, at 5:05 PM, Tobias Kieslich wrote:

On Sun, 26 Apr 2009, gary ng wrote:
I believe that depends more on how to 'scale out' rather than scale within a single process(what libevent wants to solve) or machine.

Almost all the containers(like apache, lighttpd etc.) can already handle the role of dispatching(massive connections) quite efficiently. I see no point implementing that in lua or other languages unless your need is very specific.

I like to second that, when you hit 1,000+ connections, the sockets are the least of your problem. Serving businesslogic to 1,000 clients blows
up a single server anyway and at that point you will have to look at
horizontal scaling. That means you will have to run multiple application
servers proxied by something that can handle 1,000 + connections light
lighttpd, nginx ... the usual suspects. It's probably not a good idea to
do that in Lua and server business logic from the same machine.

	-Tobias


There are other protocols and applications other than HTTP to web servers. I don't understand, for instance, how I'd use lighttpd to build an XMPP server that needs to manage a large number of TCP connections. Likewise, "business logic" need not be a heavyweight operation that hits a database, or even a disk arm. An XMPP server might have lightweight per-connection state in memory for a few thousand
sessions.

Using an alternative to select(), like kqueue() is a huge win because you don't have to continually pass an indication of interest back and forth across the kernel system call interface for each invocation. A small change like this can avoid a lot of complexity in your system in managing multiple instances of
an application.

louie