Software /
code /
prosody-modules
Annotate
mod_log_events_by_memory/README.markdown @ 5160:8474a3b80200
mod_firewall: Fix 'is_admin' internal dependency rule #1797 (thanks diane)
Looks like the boolean logic was inverted here. Instead, for now,
simply check if is_admin is there. It is deprecated in trunk and was
briefly removed before being brought back with a 'deprecated' warning as
part of the new roles and permissions work. Making this dependency
conditioned on the existence of the underlying function should make it
work until it actually goes away for real.
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Fri, 27 Jan 2023 23:06:25 +0100 |
parent | 3618:f781a90018f4 |
rev | line source |
---|---|
3615
5fe34e5f9829
mod_log_events_by_memory: Log events where Lua memory usage increased
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
1 This module compares the memory usage reported by Lua before and after |
5fe34e5f9829
mod_log_events_by_memory: Log events where Lua memory usage increased
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
2 each event and reports it to the log if it exceeds the configuration |
5fe34e5f9829
mod_log_events_by_memory: Log events where Lua memory usage increased
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
3 setting `log_memory_threshold` (in bytes). |
5fe34e5f9829
mod_log_events_by_memory: Log events where Lua memory usage increased
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
4 |
5fe34e5f9829
mod_log_events_by_memory: Log events where Lua memory usage increased
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
5 ``` lua |
5fe34e5f9829
mod_log_events_by_memory: Log events where Lua memory usage increased
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
6 log_memory_threshold = 20*1024 |
5fe34e5f9829
mod_log_events_by_memory: Log events where Lua memory usage increased
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
7 ``` |
5fe34e5f9829
mod_log_events_by_memory: Log events where Lua memory usage increased
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
8 |
3618
f781a90018f4
mod_log_events_by_memory: Add link to post explaining different kinds of memory leaks
Kim Alvefur <zash@zash.se>
parents:
3617
diff
changeset
|
9 If you are looking to identify memory leaks, please first read [Three |
f781a90018f4
mod_log_events_by_memory: Add link to post explaining different kinds of memory leaks
Kim Alvefur <zash@zash.se>
parents:
3617
diff
changeset
|
10 kinds of memory |
f781a90018f4
mod_log_events_by_memory: Add link to post explaining different kinds of memory leaks
Kim Alvefur <zash@zash.se>
parents:
3617
diff
changeset
|
11 leaks](https://blog.nelhage.com/post/three-kinds-of-leaks/). |
f781a90018f4
mod_log_events_by_memory: Add link to post explaining different kinds of memory leaks
Kim Alvefur <zash@zash.se>
parents:
3617
diff
changeset
|
12 |
3617
61b9c89db212
mod_log_events_by_memory: Add a rant to README about uselessness of this module
Kim Alvefur <zash@zash.se>
parents:
3615
diff
changeset
|
13 Prosody runs on Lua which uses automatic memory management with garbage |
61b9c89db212
mod_log_events_by_memory: Add a rant to README about uselessness of this module
Kim Alvefur <zash@zash.se>
parents:
3615
diff
changeset
|
14 collection, so the numbers reported by this module are very likely to be |
61b9c89db212
mod_log_events_by_memory: Add a rant to README about uselessness of this module
Kim Alvefur <zash@zash.se>
parents:
3615
diff
changeset
|
15 useless for the purpose of identifying memory leaks. Large, but |
61b9c89db212
mod_log_events_by_memory: Add a rant to README about uselessness of this module
Kim Alvefur <zash@zash.se>
parents:
3615
diff
changeset
|
16 temporary, increases in memory usage can however highlight other kinds |
61b9c89db212
mod_log_events_by_memory: Add a rant to README about uselessness of this module
Kim Alvefur <zash@zash.se>
parents:
3615
diff
changeset
|
17 of performance problems and sometimes even provide hits for where to |
61b9c89db212
mod_log_events_by_memory: Add a rant to README about uselessness of this module
Kim Alvefur <zash@zash.se>
parents:
3615
diff
changeset
|
18 look for memory leaks. |