# What are the freebsd O.S. things you don't understand ?



## Alain De Vos (Oct 31, 2022)

In fact this question is to reveal a bit of weakness.
I don't understand:
-Porters handbook
-PAM : Pluggable authentication module
-/etc/ttys.

Maybe you find other things different? Being difficulty relative , just like space-time.


----------



## zirias@ (Oct 31, 2022)

Hm, well, for example: How exactly the vfs subsystem works (and how it interacts with zfs).


----------



## mer (Oct 31, 2022)

zirias@ said:


> Hm, well, for example: How exactly the vfs subsystem works (and how it interacts with zfs).


How does changing sysctls relating to the scheduler and VM system actually affect the running of my system...


----------



## Alain De Vos (Oct 31, 2022)

I have

```
kern.sched.preempt_thresh=120            #80
```
I think it's not a bad idea. But what it's really doing ... ?
I have the feeling (not the science), it's better for desktop operations, but worse for server operations.
I think it gives more "tasks switching".


----------



## zirias@ (Oct 31, 2022)

That's not related to the VFS but obviously to the scheduler. Yes, the description is a bit terse:

```
$ sysctl -d kern.sched.preempt_thresh
kern.sched.preempt_thresh: Maximal (lowest) priority for preemption
```

A higher number means lower priority, so I interpret it as lowest priority (number!) a process must at least have to _cause_ preemption. Not sure whether this is fully correct, but on thing is for sure, increasing that number will cause _more_ preemption. This might be beneficial for a desktop workload (more preemption reduces latency), but would be bad for most server workloads (it also reduces throughput).


----------



## Alain De Vos (Oct 31, 2022)

Zirias, for completeness my vfs sysctls,

```
vfs.zfs.min_auto_ashift=12               #9
vfs.usermount=1                          #0,Unprivileged users may mount and unmount file systems
vfs.zfs.arc_min= 1500000000              #0
vfs.zfs.arc_max= 2500000000              #0
vfs.zfs.txg.timeout=5
```
If i'm correct a lower txg.timeout means less data lost in case of power-outage. At a price,less bulk writes ?


----------



## usdmatt (Oct 31, 2022)

> -PAM : Pluggable authentication module



Never really got that or ldap auth (although I only really tried briefly once or twice)
Often amazes me that some things, such as centralised auth for a group of systems, has always been so massively confusing and over complicated. Central auth is basically assumed in commercial windows environments and has been for ~30 years.

I'd love to be able to easily create a central authentication server and use that on all my servers with a couple of rc.conf settings, +1 to also support enabling 2fa per server/server-group for ssh.


----------



## mer (Oct 31, 2022)

Alain De Vos  my understanding:

 txg timeout is related to "how often ZFS looks to write data to a device (device is being used loosely here)".  There are a couple of variables that relate to writing a txg to the device, basically "how much data is outstanding" and the timeouts.  If you are doing something that causes lots of data needing to be written you may never hit the timeout.  The timeout is basically a failsafe:  "if we have not written any data in that time go check to see if there is data to be written and write it out".

Could setting it lower prevent some data loss?  Sure, but like everything else with tuning, you have to weigh it against everything else.  I/O bandwidth to the devices plays a part here too;  if your timeout is too long or your memory limit too great you can saturate your I/O to the devices which will stall the overall system until the data is flushed.

I think the default value of txg.timout is 5 secs, at least it is on my 13.1-RELEASE (I don't have a value set in sysctl.conf for it)


----------



## hardworkingnewbie (Oct 31, 2022)

Some sysctl settings. I occassionally run into problems where the solution is to set certain kernel parameters different by using sysctl. If you don't know about it, it often looks like the solution appeared out of thin air and be thankful that you got it working then. 

I really would like to see some centralised wiki/page in the handbook, which explains the most important sysctl variables, and can be used all the time.


----------



## mer (Oct 31, 2022)

hardworkingnewbie sysctl -d gives the description but it often isn't enough.  I'd like to have it at least print out the default value, but agree that something in or off the handbook along with "what are the implications of me changing it".
I'm sure the documentation team would love to have a patch for it.


----------



## yaslam (Nov 23, 2022)

I don't understand ZFS because I have never used it before, I have used BTRFS before though on Linux but I don't have any experience with ZFS at all and at first glance I find it alot more confusing than BTRFS which has simpler commands.


----------



## Phishfry (Nov 23, 2022)

Alain De Vos said:


> -/etc/ttys.


I understand this control file but device assignments in /dev/cua* and /dev/tty* can be confusing.
When should I use which? Why do we have a call-in interface?








						ttyu vs cuau
					

Hi,  What is/are the difference(s) between /dev/ttyu* devices and /dev/cuau*? I can connect to a remote host via /dev/cuau2 and also /dev/ttyu2.




					forums.freebsd.org
				



Much of this relates to the old days of teletype it seems.

How about sysctl settings in loader.conf versus sysctl.conf.
Why? Do they hit earlier in bootup?


----------

