Advice when migrating Internet forum from CentOS7 to FreeBSD

Maybe the OOM killer got it? Anything in the logs? Dmesg?

I've never had the OOM killer attack, so I don't know exactly what to look for in the logs. Maybe something like this?
Code:
Sep 29 15:07:21 remote kernel: swap_pager_getswapspace(20): failed
Sep 29 15:07:21 remote kernel: swap_pager_getswapspace(18): failed
Sep 29 15:07:21 remote kernel: swap_pager_getswapspace(32): failed
Sep 29 15:07:21 remote syslogd: last message repeated 1 times
Sep 29 15:07:26 remote kernel: pid 5913 (mysqld), uid 88, was killed: out of swap space
Sep 29 15:07:27 remote kernel: pid 888 (ntpd), uid 123, was killed: out of swap space
Sep 29 15:07:27 remote kernel: swap_pager_getswapspace(32): failed
Many thanks Jose! It looks like unfortunately my dmesg logs have rolled over by now. And no mention of swap in the dmesg logs that I have, at least. I will look next time ...

One concerning thing, is that I seem to have no swap space enabled on my VPS! But there is actually 1.0G of swap available ...
# swapinfo
Device 1K-blocks Used Avail Capacity

# swapctl -l
Device: 1024-blocks Used:
No numbers coming out of those commands. However:
# gpart show -p
=> 40 167772080 vtbd0 GPT (80G)
40 1024 vtbd0p1 freebsd-boot (512K)
1064 165675008 vtbd0p2 freebsd-ufs (79G)
165676072 2096048 vtbd0p3 freebsd-swap (1.0G)
There is a /dev/vtbd0p3, so I guess I can just do swapon /dev/vtbd0p3 and then also add it into /etc/fstab, if I can trust the Handbook:
/dev/vtbd0p3 none swap sw 0 0

BTW, what is up with that URL in your post??
 
I executed the swapon command and added the entry in fstab. Now I get:
# swapinfo
Device 1K-blocks Used Avail Capacity
/dev/vtbd0p3 1048024 0 1048024 0%
... which I guess looks good!
 
If you look at post numbers with your mouse, the URLs for specific posts can be reftrieved that way. hth
Hmm, I think this is something different. Where it says "Maybe something like this?" there is a URL code which, if I inspect it, says:
Code:
Maybe [URL='http://EDIT: And this is malware called %22nginx%22 to hide. It%27s not the well-known Web server.']something like this[/URL]?
Just a little bit strange!
 
Hmm, I think this is something different. Where it says "Maybe something like this?" there is a URL code which, if I inspect it, says:
Code:
Maybe [URL='http://EDIT: And this is malware called %22nginx%22 to hide. It%27s not the well-known Web server.']something like this[/URL]?
Just a little bit strange!
Ah, then it's a typo by Jose ...
 
Another thing: periodic scripts. Sometimes they can stuck and eat all memory and cpu.
OK, thanks. I don't think I've modified them much, except I added something for reloading of a couple of services in my weekly_certbot_post_hook.

Anyway, my swap space is being used now:
# swapinfo
Device 1K-blocks Used Avail Capacity
/dev/vtbd0p3 1048024 398984 649040 38%
... which I think is a good sign.

I also came across this Klara Systems article, which explains in more detail how swap works on FreeBSD. I think there are some sound reasons there for why having swap space enabled in my use-case could be a useful. But the proof is in the pudding, as they say, and maybe I don't have enough?
 
Back
Top