You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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..."
5
5
---
6
6
7
7
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`:
8
8
9
9
```
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
10
29
net.ipv4.tcp_tw_reuse = 1
11
30
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
23
33
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.
Copy file name to clipboardExpand all lines: content/momentum/4/conf-performance-tips.md
+19-19Lines changed: 19 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
---
2
-
lastUpdated: "05/21/2024"
2
+
lastUpdated: "11/04/2024"
3
3
title: "Performance Tips"
4
4
description: "This chapter provides you with some tips to optimize the Momentum performance ratings"
5
5
---
@@ -10,11 +10,12 @@ Momentum is an exceptionally powerful all-in-one email infrastructure solution.
10
10
11
11
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.
12
12
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:
14
14
15
15
```
16
16
msg_gen {
17
17
(...)
18
+
gen_count = 4
18
19
gen_transactional_threads = 4
19
20
}
20
21
```
@@ -23,7 +24,7 @@ Also, the CPU thread pool is expected to be used for a lot of functions in the R
23
24
24
25
```
25
26
ThreadPool "CPU" {
26
-
concurrency = 8
27
+
Concurrency = 8
27
28
}
28
29
```
29
30
@@ -50,15 +51,15 @@ Momentum has some built-in caches that can be tuned to improve performance. The
50
51
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:
51
52
52
53
```
53
-
generic_getter_cache_size = 4000000
54
+
generic_getter_cache_size = 4194304
54
55
```
55
56
56
57
### <aname="conf.tips.caches.match"></a> Regex Match
57
58
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:
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:
- 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:
135
135
136
136
> _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