Hi everyone, every now and then I leave the crypt. I read the paragraph 14.7. Adding Swap Space in the FreeBSD Handbook, in particular the sub-paragraph 14.7.2. Creating a Swap File. I want to have more swap space but I guess is not easy to enlarge partition 3 and shrink partition 2 (see below) without a data loss. So perhaps, creating a swap file is the best choice for me now, without backup all disk and reinstall/reconfigure all the daemons, it's only a small home server but this operation eat me a lot of time.
My intent is to return back at the status of 11.x-RELEASE, at that time I never ran in troubles compiling ports. Starting from 12.x-RELEASE on, I get strange clang errors, here and there, not due to error in the source, but randomly, in different sources of the same port restarting the compilation (I guess an internal clang error, surely not a source error, I never investigated more). The first thing I thought about to solve this problem was to stop all services (named, apache24, mysql_server, cups, dovecot, svnserve, xrdp and xrdp_sesman) and this operation had calmed things down, but it didn't solve much.
I come to a conclusion: 'I need to fine tuning something in loader.conf and variables in sysctl'. I found something about that in this forum and tuned the system (more or less), but the problem still exist, not often like before, but exists. So it's about one month I experimented the make.conf variable MAKE_JOBS_NUMBER and set it to value 2 (4 in total), and the error no more come out.
Anyways, the last thing it come me in mind to have more breath, is to enlarge the swap space.
QUESTION 1: Can I create the swap file anywhere on the disk (except in /tmp, the content will be erased at reboot)? For example in /var directory, insted of /usr, like the example in the handbook (i.e. /var/swap0).
QUESTION 2: For your experience, a swap file can help to resolve what I guess (low resources and tuning).
thanks to you all for the answers.
My intent is to return back at the status of 11.x-RELEASE, at that time I never ran in troubles compiling ports. Starting from 12.x-RELEASE on, I get strange clang errors, here and there, not due to error in the source, but randomly, in different sources of the same port restarting the compilation (I guess an internal clang error, surely not a source error, I never investigated more). The first thing I thought about to solve this problem was to stop all services (named, apache24, mysql_server, cups, dovecot, svnserve, xrdp and xrdp_sesman) and this operation had calmed things down, but it didn't solve much.
I come to a conclusion: 'I need to fine tuning something in loader.conf and variables in sysctl'. I found something about that in this forum and tuned the system (more or less), but the problem still exist, not often like before, but exists. So it's about one month I experimented the make.conf variable MAKE_JOBS_NUMBER and set it to value 2 (4 in total), and the error no more come out.
Anyways, the last thing it come me in mind to have more breath, is to enlarge the swap space.
QUESTION 1: Can I create the swap file anywhere on the disk (except in /tmp, the content will be erased at reboot)? For example in /var directory, insted of /usr, like the example in the handbook (i.e. /var/swap0).
QUESTION 2: For your experience, a swap file can help to resolve what I guess (low resources and tuning).
thanks to you all for the answers.
Code:
ft-admin at master
~> df -achT
Filesystem Type Size Used Avail Capacity Mounted on
/dev/ada0p2 ufs 285G 81G 181G 31% /
devfs devfs 1,0K 1,0K 0B 100% /dev
tmpfs tmpfs 1,1G 15M 1,1G 1% /tmp
fdescfs fdescfs 1,0K 1,0K 0B 100% /dev/fd
procfs procfs 4,0K 4,0K 0B 100% /proc
total 286G 81G 182G 31%
ft-admin at master
~> gpart show
=> 34 625142381 ada0 GPT (298G)
34 6 - free - (3.0K)
40 1024 1 freebsd-boot (512K)
1064 616561656 2 freebsd-ufs (294G)
616562720 8388608 3 freebsd-swap (4.0G)
624951328 191087 - free - (93M)
ft-admin at master
~> neofetch
``` ` ft-admin@master.void.lan
` `.....---.......--.``` -/ --------------------
+o .--` /y:` +. OS: FreeBSD 13.2-RELEASE-p4 amd64
yo`:. :o `+- Uptime: 27 days, 6 hours, 22 mins
y/ -/` -o/ Packages: 1153 (pkg)
.- ::/sy+:. Shell: tcsh 6.22.04
/ `-- / Terminal: /dev/pts/1
`: :` CPU: Intel Atom D525 (4) @ 1.800GHz [8.0°C]
`: :` GPU: Atom Processor D4xx/D5xx/N4xx/N5xx Integrated Graphics Controller
/ / Memory: [---============] 989MiB / 4043MiB
.- -. CPU Usage: [---------------] 100%
-- -. Disk (/): [----===========] 81G / 285G (31%)
`:` `:` Battery:
.-- `--. Local IP: 192.168.1.3
.---.....----. Users: ft-admin, root
Locale: it_IT.UTF-8