From: Daniel Gruno
Date: Sun, 5 Aug 2012 20:07:13 +0000 (+0000)
Subject: Add some information about the thread and server values in LuaScope
X-Git-Tag: 2.5.0-alpha~6500
X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ed77e8227d9499cf959786aa3c378412d963ef77;p=apache
Add some information about the thread and server values in LuaScope
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1369659 13f79535-47bb-0310-9956-ffa450edef68
---
diff --git a/docs/manual/mod/mod_lua.xml b/docs/manual/mod/mod_lua.xml
index cbf439d6e7..dbeec10810 100644
--- a/docs/manual/mod/mod_lua.xml
+++ b/docs/manual/mod/mod_lua.xml
@@ -225,7 +225,8 @@ performing access control, or setting mimetypes:
Check Access |
LuaHookAccessChecker |
This phase checks whether a client has access to a resource. This
- phase is run before the user is authenticated, so beware. |
+ phase is run before the user is authenticated, so beware.
+
Check User ID |
@@ -623,7 +624,7 @@ end
LuaScope
One of once, request, conn, thread -- default is once
-LuaScope once|request|conn|thread
+LuaScope once|request|conn|thread|server [min] [max]
LuaScope once
server configvirtual host
directory.htaccess
@@ -642,17 +643,30 @@ end
request scoped.
conn: Same as request but attached to the connection_rec
+
thread: Use the interpreter for the lifetime of the thread
handling the request (only available with threaded MPMs).
-
+ resource list. The min
and max
arguments
+ specify the minimum and maximum number of Lua states to keep in the
+ pool.
+
+ Generally speaking, the thread
and server
scopes
+ execute roughly 2-3 times faster than the rest, because they don't have to
+ spawn new Lua states on every request (especially with the event MPM, as
+ even keepalive requests will use a new thread for each request). If you are
+ satisfied that your scripts will not have problems reusing a state, then
+ the thread
or server
scopes should be used for
+ maximum performance. While the thread
scope will provide the
+ fastest responses, the server
scope will use less memory, as
+ states are pooled, allowing f.x. 1000 threads to share only 100 Lua states,
+ thus using only 10% of the memory requried by the thread
scope.
+