On 6/7/10 9:16 AM, "Dan Poirier" <poir...@pobox.com> wrote: > Did you profile httpd? I'm wondering if you had a few non-trivial hooks > in lua, if it would be a significant part of the CPU consumption, or > would it be swamped by the rest of the processing that always goes on > for a request?
Increasingly, httpd is just there to provide a base to run Lua stuff for us. You'd be surprised how easily problems get solved with a few if's and else's instead of mounds of rewrite rules. At "normal" load it doesn't really matter - the trade off is worth it ("speed" vs simplicity). However, as the servers get more and more loaded, Lua takes a rather large percentage of the CPU. And it's the "Lua stuff" not the part that does work. The constant string hashing, metatable lookups, etc. So, just as a test I converted a large amount of Lua into C. It was easy enough and was a huge improvement. So, just for Paul's benefit - we generate .so's from C ;) -- Brian Akins