[Samba] nmbd causing very high CPU utilization

Jeremy Allison
2002-06-26T17:11:02Z

On Wed, Jun 26, 2002 at 06:11:10PM -0400, Windsor Dave (AdW/MOE2.1)
wrote:
> OK, attached is the output of the trace command on nmbd.  I'm not sure
> how helpful it will be, but there are quite a few lseeks and reads
> taking place.
>
> Summary of software versions:
> Samba 2.2.4
> HP-UX 10.20
> trace 1.6
>
> Thanks and Best Regards,

Ok, the lseek/read pairs are searching within a tdb for free
space on a system that doesn't support mmap correctly.

My guess is that you are being hit with a lot of unexpected
udp packets on port 137, you may want to look into what is
causing this on your network.

To make the tdb space allocation more efficient you might
want to increase the hash size in libsmb/unexpected.c by
using the following patch :

Hope this helps,

	Jeremy.

Index: libsmb/unexpected.c
==================================================================RCS file:
/data/cvs/samba/source/libsmb/unexpected.c,v
retrieving revision 1.4.8.6
diff -u -r1.4.8.6 unexpected.c
--- libsmb/unexpected.c 2002/01/23 03:15:04     1.4.8.6
+++ libsmb/unexpected.c 2002/06/27 00:09:47
@@ -47,7 +47,7 @@
        int len=0;

        if (!tdbd) {
-               tdbd = tdb_open_log(lock_path("unexpected.tdb"), 1,
+               tdbd = tdb_open_log(lock_path("unexpected.tdb"), 1024,
                               TDB_CLEAR_IF_FIRST|TDB_DEFAULT,
                               O_RDWR | O_CREAT, 0644);
                if (!tdbd) {