From e93b6dfa682e792f39c548dd3d93fae68431ab5a Mon Sep 17 00:00:00 2001 From: "Rob Swindell (on Windows 11)" <rob@synchro.net> Date: Thu, 22 Aug 2024 21:19:54 -0700 Subject: [PATCH] Don't call utime() on the node.dab file for every read ... this was the cause of some observed unnecessarily high disk/file server (Samba) utilization, as we call getnodedat() a lot. utime() opens and closes the file, which was already open - and we're not modifying the file, so updating the 'modification time' here is wrong anyway. Disabling this 21-year old bit of logic resulted in a pretty dramatic reduction in Samba (smbd) CPU utilization on Vertrauen. If a BBS actually needes this hack (e.g. for NFS compatibility, as Deuce eluded in the comment), they'd be better off just setting the "Keep Node File Open" node setting (in SCFG->Nodes) to "No". --- src/sbbs3/getnode.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/sbbs3/getnode.cpp b/src/sbbs3/getnode.cpp index 476252cf10..3bf2e3bb08 100644 --- a/src/sbbs3/getnode.cpp +++ b/src/sbbs3/getnode.cpp @@ -52,9 +52,10 @@ int sbbs_t::getnodedat(uint number, node_t *node, bool lockit) return(errno); } } +#if 0 // This leads to high disk (or Samba/file server) utilization as we call getnodedat() a lot else utime(str,NULL); /* NFS fix... utime() forces a cache refresh */ - +#endif number--; /* make zero based */ for(count=0;count<LOOP_NODEDAB;count++) { if(count) -- GitLab