Skip to content

Commit 4f5a1e7

Browse files
authored
EOP-253: Change documentation to reflect updated cloud settings (#779)
Signed-off-by: Doug Koerich <[email protected]>
1 parent 5bf3436 commit 4f5a1e7

File tree

2 files changed

+43
-38
lines changed

2 files changed

+43
-38
lines changed

content/momentum/4/byb-sysctl-conf.md

Lines changed: 24 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,35 @@
11
---
2-
lastUpdated: "03/26/2020"
2+
lastUpdated: "11/04/2024"
33
title: "Adjusting /etc/sysctl.conf"
44
description: "Momentum 4 uses a large number of connections and is able to establish them quickly This can overwhelm the operating system if special parameters are not used These issues can be addressed by configuring the following lines in etc sysctl conf These options are described below net ipv 4 tcp..."
55
---
66

77
Momentum 4 uses a large number of connections and is able to establish them quickly. This can overwhelm the operating system if special parameters are not used. These issues can be addressed by configuring the following lines in `/etc/sysctl.conf`:
88

99
```
10+
fs.file-max = 9721865
11+
12+
net.core.netdev_max_backlog = 262144
13+
net.core.optmem_max = 16777216
14+
net.core.rmem_default = 67108864
15+
net.core.rmem_max = 67108864
16+
net.core.somaxconn = 8192
17+
net.core.wmem_default = 67108864
18+
net.core.wmem_max = 67108864
19+
20+
net.ipv4.tcp_base_mss = 1024
21+
net.ipv4.tcp_fastopen = 1
22+
net.ipv4.tcp_fin_timeout = 15
23+
net.ipv4.tcp_max_syn_backlog = 65535
24+
net.ipv4.tcp_max_tw_buckets = 2000000
25+
net.ipv4.tcp_mem = 2885568 3847424 67108864
26+
net.ipv4.tcp_mtu_probing = 1
27+
net.ipv4.tcp_rmem = 4096 87380 67108864
28+
net.ipv4.tcp_slow_start_after_idle = 0
1029
net.ipv4.tcp_tw_reuse = 1
1130
net.ipv4.tcp_tw_recycle = 1
12-
net.core.somaxconn = 1024
13-
net.core.rmem_max = 262144
14-
vm.max_map_count = 768000
15-
net.core.wmem_max = 262144
16-
```
17-
18-
These options are described below:
19-
20-
* `net.ipv4.tcp_tw_reuse` – Reuse sockets in the TIME_WAIT state for new connections when it is safe from a protocol viewpoint. Setting this to `1` enables reuse of open connections, increasing efficiency.
21-
22-
* `net.ipv4.tcp_tw_recycle` – This kernel parameter enables fast recycling of TIME_WAIT sockets. A setting of `1` enables the reuse of sockets without the normal wait time.
31+
net.ipv4.tcp_wmem = 4096 65536 67108864
32+
net.ipv4.udp_mem = 2885568 3847424 67108864
2333
24-
* `net.core.somaxconn = 1024` – This kernel parameter controls the number of incoming connections. Increasing it to `1024` allows Momentum to process more open connections.
25-
26-
* `net.core.rmem_max` – This kernel parameter raises the maximum operating system receive buffer size for all types of connections.
27-
28-
* `vm.max_map_count` – This kernel parameter controls mapped areas and needs to be increased.
29-
30-
* `net.core.wmem_max` – This kernel parameter raises the maximum operating system send buffer size for all types of connections.
34+
vm.max_map_count = 1048575
35+
```

content/momentum/4/conf-performance-tips.md

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
lastUpdated: "05/21/2024"
2+
lastUpdated: "11/04/2024"
33
title: "Performance Tips"
44
description: "This chapter provides you with some tips to optimize the Momentum performance ratings"
55
---
@@ -10,11 +10,12 @@ Momentum is an exceptionally powerful all-in-one email infrastructure solution.
1010

1111
With [Supercharger](/momentum/4/licensed-features-supercharger) licensed feature, Momentum runs on top of several [event loop](/momentum/4/multi-event-loops) schedulers and uses multicore CPUs with improved efficiency. In this model, it is also possible to assign dedicated event loops to listeners (e.g. the HTTP one) with desired concurrency. On the other hand, the default configuration is based solely on the thread pools to offload specific tasks, therefore Momentum keeps running on top of the original master event loop only, and it can be occasionally bottlenecked.
1212

13-
The Supercharger's *"75% of CPU cores"* formula works fine on systems largely SMTP-driven. For systems with larger [message generation](momentum/4/message-gen) flows (i.e., REST injections), the number of event loops can be limited to 4 or 5, with higher concurrency values assigned to the `msg_gen` thread pools (see `gen_transactional_threads` configuration [here](momentum/4/modules/msg-gen)). For instance:
13+
The Supercharger's *"75% of CPU cores"* formula works fine on systems largely SMTP-driven. For systems with larger [message generation](/momentum/4/message-gen) flows (i.e., REST injections), the number of event loops can be limited to 4 or 5, with higher concurrency values assigned to the `msg_gen` thread pools (see `gen_count` and `gen_transactional_threads` configurations [here](/momentum/4/modules/msg-gen)). For instance:
1414

1515
```
1616
msg_gen {
1717
(...)
18+
gen_count = 4
1819
gen_transactional_threads = 4
1920
}
2021
```
@@ -23,7 +24,7 @@ Also, the CPU thread pool is expected to be used for a lot of functions in the R
2324

2425
```
2526
ThreadPool "CPU" {
26-
concurrency = 8
27+
Concurrency = 8
2728
}
2829
```
2930

@@ -50,15 +51,15 @@ Momentum has some built-in caches that can be tuned to improve performance. The
5051
This cache is used for parameters that are not in a binding/domain scope. So anything that's global, or module configuration, exist in the generic getter cache. This cache gets a lot of traffic, so setting it in `ecelerity.conf` to something like few million entries is reasonable:
5152

5253
```
53-
generic_getter_cache_size = 4000000
54+
generic_getter_cache_size = 4194304
5455
```
5556

5657
### <a name="conf.tips.caches.match"></a> Regex Match
5758

58-
The match cache saves results of queries against regular expression domain stanzas. This cache is enabled by default, but its [size](momentum/4/config/ref-match-cache-size) is very small by default (16384 entries). Making it larger is a great idea, especially if user is using any regular expression domain stanzas:
59+
The match cache saves results of queries against regular expression domain stanzas. This cache is enabled by default, but its [size](/momentum/4/config/ref-match-cache-size) is very small by default (16384 entries). Making it larger is a great idea, especially if user is using any regular expression domain stanzas:
5960

6061
```
61-
match_cache_size = 2000000
62+
match_cache_size = 2097152
6263
```
6364

6465
## <a name="conf.tips.jemalloc"></a> Boosting `jemalloc` Performance
@@ -81,20 +82,21 @@ Lua has a garbage collector that can be tuned to improve performance. The follow
8182
In the `ecelerity.conf` file:
8283

8384
```
84-
ThreadPool "gc" {
85-
concurrency = 10
85+
ThreadPool gc {
86+
concurrency = 4
8687
}
8788
(...)
8889
scriptlet "scriptlet" {
8990
(...)
9091
gc_every = 20
9192
gc_step_on_recycle = true
93+
gc_step_on_trash_state = false
9294
gc_stepmul = 300
93-
gc_threadpool = “gc”
94-
gc_trace_thresh = 1000
95-
gc_trace_xref_thresh = 1000
95+
gc_threadpool = gc
96+
gc_trace_thresh = 2147483647
9697
global_trace_interval = 13
9798
max_uses_per_thread = 5000
99+
pin_thread_for_completion_in_event_loop = false
98100
reap_interval = 13
99101
use_reusable_thread = true
100102
}
@@ -118,19 +120,17 @@ export LUA_NON_SIGNAL_COLLECTOR
118120
These are `ecelerity.conf` settings that are known to improve performance on different tasks of Momentum. Before applying them, however, review their documentation and make sure they fit to your environment and use cases:
119121

120122
```
121-
fully_resolve_before_smtp = false
122-
growbuf_size = 32768
123-
inline_transfail_processing = 0
123+
growbuf_size = 262144
124124
initial_hash_buckets = 64
125125
keep_message_dicts_in_memory = true
126-
large_message_threshold = 262144
127-
max_resident_active_queue = 1000
128-
max_resident_messages = 100000
126+
max_resident_active_queue = 5000
127+
max_resident_messages = 50000
129128
```
130129

131130
## <a name="conf.tips.misc"></a> Miscellaneous Tips
132131

133-
- Don't forget to [adjust `sysctl` settings](momentum/4/byb-sysctl-conf) for best TCP connections performance;
134-
- Prefer [chunk_logger](momentum/4/modules/chunk-logger) over logging to `paniclog`. The reasons are taken from the `chunk_logger` page:
132+
- Don't forget to [adjust `sysctl` settings](/momentum/4/byb-sysctl-conf) for best TCP connections performance;
133+
- Avoid using `ec_console` commands `summary` and `mailq` for monitoring purposes. Prefer their [HTTP API](/momentum/4/http-api-stats) counterparts, which are less intrusive and more efficient;
134+
- Prefer [chunk_logger](/momentum/4/modules/chunk-logger) over logging to `paniclog`. The reasons are taken from the `chunk_logger` page:
135135

136136
> _Logging to the_ `paniclog` _in the scheduler thread (the main thread) can limit throughput and cause watchdog kills. (...) [It] involves disk I/O, and writing to the_ `paniclog` _in the scheduler thread may block its execution for a long time, thereby holding up other tasks in the scheduler thread and decreasing throughput._

0 commit comments

Comments
 (0)