Just linking the other thread, because it has the solution to my problem: https://forum.opnsense.org/index.php?topic=50783.0
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Show posts Menutop -S -m io -o total
procstat -f <pid_of_top_process_of_previous_command>/var/netflow.root@OPNsense:/var/netflow # procstat -f 7155
PID COMM FD T V FLAGS REF OFFSET PRO NAME
7155 sqlite3 text v r r------- - - - /usr/local/bin/sqlite3
7155 sqlite3 cwd v d r------- - - - /usr/local/opnsense/service
7155 sqlite3 root v d r------- - - - /
7155 sqlite3 0 v r r------- 1 13631488 - /var/netflow/src_addr_details_086400.sqlite.clean.sql
7155 sqlite3 1 v c rw------ 15 0 - /dev/null
7155 sqlite3 2 v c rw------ 15 0 - /dev/null
7155 sqlite3 3 v r rw------ 2 0 - /var/netflow/src_addr_details_086400.sqlite.fix
7155 sqlite3 4 v r rw------ 1 0 - /var/netflow/src_addr_details_086400.sqlite.fix-journal
root@OPNsense:/var/netflow # procstat -f 79089
PID COMM FD T V FLAGS REF OFFSET PRO NAME
79089 sqlite3 text v r r------- - - - /usr/local/bin/sqlite3
79089 sqlite3 cwd v d r------- - - - /
79089 sqlite3 root v d r------- - - - /
79089 sqlite3 0 v r r------- 1 12451840 - /var/netflow/src_addr_086400.sqlite.clean.sql
79089 sqlite3 1 v c rw------ 2 0 - /dev/null
79089 sqlite3 2 v c rw------ 2 0 - /dev/null
79089 sqlite3 3 v r rw------ 2 0 - /var/netflow/src_addr_086400.sqlite.fix
79089 sqlite3 4 v r rw------ 1 0 - /var/netflow/src_addr_086400.sqlite.fix-journal
root@OPNsense:/var/netflow # ls -lsa
total 634961
9 drwxr-x--- 2 root wheel 25 Feb 8 09:08 .
9 drwxr-xr-x 31 root wheel 31 Feb 3 14:04 ..
33 -rw-r----- 1 root wheel 102400 Feb 6 23:59 dst_port_000300.sqlite
13 -rw-r----- 1 root wheel 29240 Feb 7 14:33 dst_port_000300.sqlite-journal
29 -rw-r----- 1 root wheel 376832 Feb 6 23:59 dst_port_003600.sqlite
9 -rw-r----- 1 root wheel 21032 Feb 7 14:33 dst_port_003600.sqlite-journal
24705 -rw-r----- 1 root wheel 73572352 Feb 6 23:59 dst_port_086400.sqlite
13 -rw-r----- 1 root wheel 21032 Feb 7 14:33 dst_port_086400.sqlite-journal
105 -rw-r----- 1 root wheel 2527232 Feb 6 23:59 interface_000030.sqlite
905 -rw-r----- 1 root wheel 2355200 Feb 6 23:59 interface_000300.sqlite
453 -rw-r----- 1 root wheel 983040 Feb 6 23:59 interface_003600.sqlite
269 -rw-r----- 1 root wheel 585728 Feb 8 09:05 interface_086400.sqlite
5 -rw-r----- 1 root wheel 12288 Feb 6 23:59 metadata.sqlite
169 -rw-r----- 1 root wheel 495616 Feb 6 23:59 src_addr_000300.sqlite
109 -rw-r----- 1 root wheel 286720 Feb 8 09:03 src_addr_003600.sqlite
174105 -rw-r----- 1 root wheel 486756352 Feb 7 16:00 src_addr_086400.sqlite
92393 -rw-r----- 1 root wheel 431340383 Feb 8 09:01 src_addr_086400.sqlite.clean.sql
817 -rw-r----- 1 root wheel 2871296 Feb 8 09:08 src_addr_086400.sqlite.fix
1 -rw-r----- 1 root wheel 12824 Feb 8 09:08 src_addr_086400.sqlite.fix-journal
92401 -rw-r----- 1 root wheel 431340429 Feb 8 09:01 src_addr_086400.sqlite.sql
124177 -rw-r----- 1 root wheel 433369088 Feb 8 09:01 src_addr_details_086400.sqlite
62001 -rw-r----- 1 root wheel 353618428 Feb 8 09:05 src_addr_details_086400.sqlite.clean.sql
221 -rw-r----- 1 root wheel 1363968 Feb 8 09:08 src_addr_details_086400.sqlite.fix
1 -rw-r----- 1 root wheel 12824 Feb 8 09:08 src_addr_details_086400.sqlite.fix-journal
62021 -rw-r----- 1 root wheel 353618447 Feb 8 09:05 src_addr_details_086400.sqlite.sql
root@OPNsense:/var/netflow # ls -lsa
total 319059
9 drwxr-x--- 2 root wheel 13 Feb 8 09:37 .
9 drwxr-xr-x 31 root wheel 31 Feb 3 14:04 ..
13 -rw-r----- 1 root wheel 29240 Feb 7 14:33 dst_port_000300.sqlite-journal
9 -rw-r----- 1 root wheel 21032 Feb 7 14:33 dst_port_003600.sqlite-journal
13 -rw-r----- 1 root wheel 21032 Feb 7 14:33 dst_port_086400.sqlite-journal
92393 -rw-r----- 1 root wheel 431340383 Feb 8 09:01 src_addr_086400.sqlite.clean.sql
5029 -rw-r----- 1 root wheel 15032320 Feb 8 09:37 src_addr_086400.sqlite.fix
ls: ./src_addr_086400.sqlite.fix-journal: No such file or directory
1 -rw-r----- 1 root wheel 12824 Feb 8 09:37 src_addr_086400.sqlite.fix-journal
92401 -rw-r----- 1 root wheel 431340429 Feb 8 09:01 src_addr_086400.sqlite.sql
62001 -rw-r----- 1 root wheel 353618428 Feb 8 09:05 src_addr_details_086400.sqlite.clean.sql
5165 -rw-r----- 1 root wheel 17735680 Feb 8 09:37 src_addr_details_086400.sqlite.fix
ls: ./src_addr_details_086400.sqlite.fix-journal: No such file or directory
1 -rw-r----- 1 root wheel 12824 Feb 8 09:37 src_addr_details_086400.sqlite.fix-journal
62021 -rw-r----- 1 root wheel 353618447 Feb 8 09:05 src_addr_details_086400.sqlite.sql
The "No such file or directory" only comes up sometimes when doin an ls -lsa, and I suppose that those exist only for a fraction of a second. Maybe these are the files that sqlite3 writes to constantly? Like create the file, write, delete, repeat...?top -S -m io -o total
PID USERNAME VCSW IVCSW READ WRITE FAULT TOTAL PERCENT COMMAND
4640 root 484 1 0 2525 0 2525 100.00% sqlite3
47616 root 2 0 0 0 0 0 0.00% lighttpd
1 root 0 0 0 0 0 0 0.00% init
root@OPNsense:/dev/fd # procstat -f 4640
PID COMM FD T V FLAGS REF OFFSET PRO NAME
4640 sqlite3 text v r r------- - - - /usr/local/bin/sqlite3
4640 sqlite3 cwd v d r------- - - - /
4640 sqlite3 root v d r------- - - - /
4640 sqlite3 0 v r r------- 1 1572864 - /var/netflow/src_addr_086400.sqlite.clean.sql
4640 sqlite3 1 v c rw------ 6 0 - /dev/null
4640 sqlite3 2 v c rw------ 6 0 - /dev/null
4640 sqlite3 3 v r rw------ 2 0 - /var/netflow/src_addr_086400.sqlite.fix
4640 sqlite3 4 v r rw------ 1 0 - /var/netflow/src_addr_086400.sqlite.fix-journal
root@OPNsense:/dev/fd # procstat -f 88990
PID COMM FD T V FLAGS REF OFFSET PRO NAME
88990 sqlite3 text v r r------- - - - /usr/local/bin/sqlite3
88990 sqlite3 cwd v d r------- - - - /
88990 sqlite3 root v d r------- - - - /
88990 sqlite3 0 v r r------- 1 8519680 - /var/netflow/src_addr_086400.sqlite.clean.sql
88990 sqlite3 1 v c rw------ 6 0 - /dev/null
88990 sqlite3 2 v c rw------ 6 0 - /dev/null
88990 sqlite3 3 v r rw------ 1 0 - /var/netflow/src_addr_086400.sqlite.fix
88990 sqlite3 4 v r rw------ 2 0 - /var/netflow/src_addr_086400.sqlite.fix-journal
top -S -m io -o total shows: PID USERNAME VCSW IVCSW READ WRITE FAULT TOTAL PERCENT COMMAND
83231 root 481 0 2 2396 0 2398 97.44% sqlite3
35108 hostd 22 0 0 63 0 63 2.56% hostwatch
73985 root 0 0 0 0 0 0 0.00% php-cgi
70657 root 0 0 0 0 0 0 0.00% openvpn
59009 root 0 0 0 0 0 0 0.00% cron