summaryrefslogtreecommitdiffhomepage
path: root/libs
diff options
context:
space:
mode:
authorSteven Barth <steven@midlink.org>2009-07-10 16:39:30 +0000
committerSteven Barth <steven@midlink.org>2009-07-10 16:39:30 +0000
commit7ba12e9c5eafd809237fa69464e8b601926e9513 (patch)
tree1ffb90f2a9e2034ab209953d86f39a88668d91db /libs
parent128437f67103c980a8c963bf2510fe38ba1f4e54 (diff)
Move memory limit to lucid, reincrease thread limit
Diffstat (limited to 'libs')
-rw-r--r--libs/core/luasrc/init.lua5
-rw-r--r--libs/lucid-http/luasrc/lucid/http/server.lua6
-rw-r--r--libs/lucid/root/etc/config/lucid4
3 files changed, 9 insertions, 6 deletions
diff --git a/libs/core/luasrc/init.lua b/libs/core/luasrc/init.lua
index 3297901acc..dc91a36a0f 100644
--- a/libs/core/luasrc/init.lua
+++ b/libs/core/luasrc/init.lua
@@ -26,11 +26,6 @@ limitations under the License.
local require = require
--- Set memory limit if supported
-if _G.set_memory_limit then
- set_memory_limit(1024 * 1024 * 1.5)
-end
-
-- Make sure that bitlib is loaded
if not _G.bit then
_G.bit = require "bit"
diff --git a/libs/lucid-http/luasrc/lucid/http/server.lua b/libs/lucid-http/luasrc/lucid/http/server.lua
index 25f2535d99..4bbec31a13 100644
--- a/libs/lucid-http/luasrc/lucid/http/server.lua
+++ b/libs/lucid-http/luasrc/lucid/http/server.lua
@@ -14,6 +14,7 @@ $Id$
local ipairs, pairs = ipairs, pairs
local tostring, tonumber = tostring, tonumber
local pcall, assert, type = pcall, assert, type
+local set_memory_limit = set_memory_limit
local os = require "os"
local nixio = require "nixio"
@@ -408,6 +409,11 @@ function Server.process(self, client, env)
local close = false
local stat, code, msg, message, err
+ env.config.memlimit = tonumber(env.config.memlimit)
+ if env.config.memlimit and set_memory_limit then
+ set_memory_limit(env.config.memlimit)
+ end
+
client:setsockopt("socket", "rcvtimeo", 5)
client:setsockopt("socket", "sndtimeo", 5)
diff --git a/libs/lucid/root/etc/config/lucid b/libs/lucid/root/etc/config/lucid
index b9be1dd975..c5a3f3d8ee 100644
--- a/libs/lucid/root/etc/config/lucid
+++ b/libs/lucid/root/etc/config/lucid
@@ -1,6 +1,6 @@
config lucid main
option pollinterval 15000
- option threadlimit 2
+ option threadlimit 10
option daemonize 1
option debug 0
list supports tcpserver
@@ -30,6 +30,7 @@ config daemon http
list publisher webroot
list publisher luciweb
option nokeepalive 1
+ option memlimit 1572864
option enabled 1
config daemon https
@@ -38,6 +39,7 @@ config daemon https
list publisher webroot
list publisher luciweb
option nokeepalive 1
+ option memlimit 1572864
option enabled 1
option tls maincert
option encryption enable