aboutsummaryrefslogtreecommitdiff
path: root/etc/sysctl.conf
diff options
context:
space:
mode:
Diffstat (limited to 'etc/sysctl.conf')
-rw-r--r--etc/sysctl.conf20
1 files changed, 20 insertions, 0 deletions
diff --git a/etc/sysctl.conf b/etc/sysctl.conf
new file mode 100644
index 0000000..69a1460
--- /dev/null
+++ b/etc/sysctl.conf
@@ -0,0 +1,20 @@
+# shared memory is a method of sharing a common memory space for inter-processes communication (IPC)
+# modern browsers, multimedia apps, databases, games, containers, vms
+
+kern.shminfo.shmall=1966080 # total number of pages, 1 page per 4096 bytes. ill put 1966080 pages for my 8gb tp ((8GB-512M)/4096)
+kern.shminfo.shmmax=536870912 # cap for each shm segment, for safety, ill set it dividing my memory by 16. 512mb is enough (db shared_buffer, browser cache).
+kern.shminfo.shmmni=2048 # max number of segments in a system (enough space for multitasks, containers, vms)
+kern.shminfo.shmseg=2048 # max number of segments a single process can attach to (allows browsers/multimedia with many tabs/processes use multiple segments)
+
+# IPC semaphores (sync between processes)
+kern.seminfo.semmns=4096 # total semaphores
+kern.seminfo.semmni=1024 # total sets of semaphores, 1024 x average semaphores per set should equal to SEMMNS
+
+# Max processes and open file descriptors (enough for me. browsers, compiling, multitasking)
+kern.maxproc=8192
+kern.maxfiles=16384
+
+# Vnode is a kernel abstraction of a file system, it represents a file system object (good for caching)
+kern.maxvnodes=100000 # max tracked filesystem objects by the kernel (open files, dirs, sockets, etc.)
+
+hw.blockcpu=L # enable hyperthreading, check https://www.openbsd.org/faq/faq10.html before