lua-users home
lua-l archive

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


On Mon, 12 Feb 2007, Javier Guerra wrote:

> On Monday 12 February 2007, jbarciela jbarciela wrote:
> > I'm surprised that mod_lua behaves like cgi, in my mind the point of
> > using a mod_X (mod_perl for example) is to avoid just that, and run
> > in-process with the server.
> 
> so was i, and that's why i wrote an alternative.
> 
> the tradeoff they chose is about isolation.  in theory, nothing you do for one 
> request would affect the environment for the next one. to get that, they 
> create and destroy a lot of it each time.
	This isolation avoids problems like:

cgilua = nil

	which would destroy everything the script could do :-(
	Some argue that there is too much time spent on creating and
destroying the Lua State, but anyone showed numbers.  When I started
to play with Apache modules, I tried to measure the time spent by Lua
in the initialization of a Lua State.  The time spent on registering
the libraries was superior of that spent on creating the state.  But
the time spent to load a script with some functions inside it was
much more.  I didn't measured the time a script spent on making a
query to a database connection...
	IMHO the time to do all that stuff is worthless comparing
to the time of transfering things over the net (in my applications
the overall performance is very reasonable).  But I could be wrong.
Anyway, we decided to start with robustness and get to performance
step by step.  Unfortunatelly, we are on the first step yet...
Anyone would like to join us :-)

	Regards,
		Tomás