Home
Help
Search
Login
Register
OPNsense Forum
»
English Forums
»
General Discussion
»
Swap Partition on OPNsense
« previous
next »
Print
Pages: [
1
]
Author
Topic: Swap Partition on OPNsense (Read 6306 times)
Bogotrax
Newbie
Posts: 30
Karma: 0
Swap Partition on OPNsense
«
on:
December 29, 2021, 08:55:45 am »
Hello guys,
I want to enable a swap file on my opnsense, since I want to use suricata, which eats all my memory and then deaktivates itself.
The cpu is not an issue as far as I can see but my APU is very low on memory. I know how to use a terminal in ubuntu and how to add a swap file in there, so if there is a decent link with commands that i can follow, i would be able to do it in freeBSD, if there is that option. Altohugh I would prefer the WebGUI, if by any means possible.
If specifying my setup helps, I am glad to do so. Just let me know.
Best,
Bogotrax
Logged
bartjsmit
Hero Member
Posts: 2018
Karma: 194
Re: Swap Partition on OPNsense
«
Reply #1 on:
December 29, 2021, 09:49:46 am »
Try this:
https://www.cyberciti.biz/faq/create-a-freebsd-swap-file/
Logged
franco
Administrator
Hero Member
Posts: 17678
Karma: 1613
Re: Swap Partition on OPNsense
«
Reply #2 on:
December 29, 2021, 12:11:26 pm »
There is a built-in 2G swap file option under System: Settings: Misc. 2G is probably pretty low for what you try to work around, but the real issue is forcing the system (not just Suricata) into swapping mode, which slows it down further.
Cheers,
Franco
Logged
Bogotrax
Newbie
Posts: 30
Karma: 0
Re: Swap Partition on OPNsense
«
Reply #3 on:
December 29, 2021, 12:57:42 pm »
Amazing! This is what i was searching for. I don't know what do you mean by forcing, is this also a setting thing? That would be perfect. My problem is not slowing down, but simply suricata deactivates itself. Nothing much i can do i thought, but i think it is a memory issue because the memory level reaching 94 % then suricata is down and memory goes back to 23 percent.
I hope that settles it.
Update: swap is not shown in the dashboard - any idea why?
https://ibb.co/r4p35Dz
just shortly when I enter dashboard:
https://ibb.co/vQM2nMr
Also yes, suricata doesn't use the swap - I have the same issue - memory rises - suricata deactivates itself and takes unbound dns with it so i have no internet. Manually activating unbound dns, but after all thats that..
«
Last Edit: December 29, 2021, 01:17:53 pm by Bogotrax
»
Logged
franco
Administrator
Hero Member
Posts: 17678
Karma: 1613
Re: Swap Partition on OPNsense
«
Reply #4 on:
December 29, 2021, 01:20:50 pm »
Did you reboot?
What I mean by "force" is the system will try to use more swap but more pages in swap means slower system. Suricata (and Unbound) are both resource-hungry in certain configurations, but the actual behaviour in the swap is that ANY service might take up that swap slowing down everything, not just one or two memory-hungry services.
Cheers,
Franco
Logged
Bogotrax
Newbie
Posts: 30
Karma: 0
Re: Swap Partition on OPNsense
«
Reply #5 on:
December 29, 2021, 03:17:23 pm »
Oh my god, it works - I am so happy. Thought about buying a "bigger" system the couple last days. You saved my small setup! Thanks a lot franco!
Logged
Print
Pages: [
1
]
« previous
next »
OPNsense Forum
»
English Forums
»
General Discussion
»
Swap Partition on OPNsense