[luci] LuCId daemon explicit garbage collection

Jo-Philipp Wich xm at subsignal.org
Wed Jul 20 23:13:42 CEST 2011


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi.

> So the result here is that it will only do the garbage collect if it
> isn't polling any descriptors.  I don't think this is the desired
> behavior.  I would suggest just making it a straight "else" branch.

you're right, that probably got broken ages ago and since the default
configurations always work in CGI mode (1 request, 1 lifetime) it never
really was noticed.

> That got me thinking about the forked processes serving luci web pages. 
> They share the same LUA state as the parent process by definition. 
> Wouldn't it be a better idea to explicitly garbage collect before a
> fork() instead / in addition?  It would add a small amount of delay to
> the servicing of each request but I think it serves a benefit because
> then the child process receives a gc()ed LUA state and therefore will
> have less of a chance of undergoing its own gc cycle.

Yes, you're right here. I think the most reasonable thing to do is
gc'ing before the work. I attached a patch which should implement your
proposal.


~ Jow
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk4nRQYACgkQdputYINPTPNc0gCePgTX8kftxvgEOIoLY+4n3adR
Ai0AnRlr6ilKC7+u9OBYDt1Etj/cQsnu
=SiMU
-----END PGP SIGNATURE-----
-------------- next part --------------
A non-text attachment was scrubbed...
Name: lucid-gc-before-fork.patch
Type: text/x-diff
Size: 621 bytes
Desc: not available
URL: <http://lists.subsignal.org/pipermail/luci/attachments/20110720/3f42e541/attachment.patch>


More information about the luci mailing list