liquid_feedback_frontend

view app/main/_prefork/10_init.lua @ 1169:112a3add1637

Pass memory_limit configuration to listen() and changed max fork limit to 128
author bsw
date Tue Mar 24 20:02:30 2015 +0100 (2015-03-24)
parents 3b00c08a6b90
children 6b1f01c31092
line source
1 if config.fork == nil then
2 config.fork = {}
3 end
5 if config.fork.pre == nil then
6 config.fork.pre = 2
7 end
9 if config.fork.min == nil then
10 config.fork.min = 4
11 end
13 if config.fork.max == nil then
14 config.fork.max = 128
15 end
17 if config.fork.delay == nil then
18 config.fork.delay = 0.125
19 end
21 if config.fork.error_delay == nil then
22 config.fork.error_delay = 2
23 end
25 if config.fork.exit_delay == nil then
26 config.fork.exit_delay = 2
27 end
29 if config.fork.idle_timeout == nil then
30 config.fork.idle_timeout = 900
31 end
33 if config.port == nil then
34 config.port = 8080
35 end
37 if config.localhost == nil then
38 config.localhost = true
39 end
41 local listen_options = {
42 pre_fork = config.fork.pre,
43 min_fork = config.fork.min,
44 max_fork = config.fork.max,
45 fork_delay = config.fork.delay,
46 fork_error_delay = config.fork.error_delay,
47 exit_delay = config.fork.exit_delay,
48 idle_timeout = config.fork.idle_timeout,
49 memory_limit = config.fork.memory_limit,
50 min_requests_per_fork = config.fork.min_requests,
51 max_requests_per_fork = config.fork.max_requests,
52 http_options = config.http_options
53 }
55 if config.ipv6 then
56 listen_options[#listen_options+1] = { proto = "tcp6", port = config.port, localhost = config.localhost }
57 end
58 if config.ipv6 ~= "only" then
59 listen_options[#listen_options+1] = { proto = "tcp4", port = config.port, localhost = config.localhost }
60 end
62 listen(listen_options)
64 listen{
65 {
66 proto = "interval",
67 name = "send_pending_notifications",
68 delay = 5,
69 handler = function()
70 Event:send_pending_notifications()
71 end
72 },
73 min_fork = 1,
74 max_fork = 1
75 }
77 execute.inner()

Impressum / About Us