All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] Slow SNMP daemon startup
@ 2020-12-15 15:52 Grant Edwards
  2020-12-15 16:00 ` Grant Edwards
  0 siblings, 1 reply; 3+ messages in thread
From: Grant Edwards @ 2020-12-15 15:52 UTC (permalink / raw)
  To: buildroot

After upgrading from an older version of net-snmp (5.7.3 -> 5.8) it
now takes the snmp daemon anywhere from 5s to a minute to start up. It
used to start with no noticeable delay.

Has anybody else noticed this?

Does anybody have any guesses on where to start looking for the problem?

There's nothing in the syslog to indicate any problem:

 # grep snmp /var/log/messages
 Jan  1 00:00:08 (none) daemon.info snmpd[944]: Created directory: /var/lib/snmp
 Jan  1 00:00:08 (none) daemon.info snmpd[944]: Created directory: /var/lib/snmp/cert_indexes
 Dec 15 15:17:26 (none) daemon.info snmpd[944]: Created directory: /var/lib/snmp/mib_indexes
 Dec 15 15:17:26 (none) daemon.info snmpd[946]: NET-SNMP version 5.8

Though it looks like the ntp daemon has stepped the time while snmpd
is starting up, so perhaps that's causing a problem...

--
Grant

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Buildroot] Slow SNMP daemon startup
  2020-12-15 15:52 [Buildroot] Slow SNMP daemon startup Grant Edwards
@ 2020-12-15 16:00 ` Grant Edwards
  2020-12-15 16:55   ` Grant Edwards
  0 siblings, 1 reply; 3+ messages in thread
From: Grant Edwards @ 2020-12-15 16:00 UTC (permalink / raw)
  To: buildroot

On 2020-12-15, Grant Edwards <grant.b.edwards@gmail.com> wrote:
> After upgrading from an older version of net-snmp (5.7.3 -> 5.8) it
> now takes the snmp daemon anywhere from 5s to a minute to start up. It
> used to start with no noticeable delay.
>
> Has anybody else noticed this?
>
> Does anybody have any guesses on where to start looking for the problem?
>
> There's nothing in the syslog to indicate any problem:
>
>  # grep snmp /var/log/messages
>  Jan  1 00:00:08 (none) daemon.info snmpd[944]: Created directory: /var/lib/snmp
>  Jan  1 00:00:08 (none) daemon.info snmpd[944]: Created directory: /var/lib/snmp/cert_indexes
>  Dec 15 15:17:26 (none) daemon.info snmpd[944]: Created directory: /var/lib/snmp/mib_indexes
>  Dec 15 15:17:26 (none) daemon.info snmpd[946]: NET-SNMP version 5.8
>
> Though it looks like the ntp daemon has stepped the time while snmpd
> is starting up, so perhaps that's causing a problem...

That's not it. I disable ntp, and it got even worse (over two minutes):

   # grep snmp /var/log/messages
   Jan  1 00:00:08 (none) daemon.info snmpd[942]: Created directory: /var/lib/snmp
   Jan  1 00:00:08 (none) daemon.info snmpd[942]: Created directory: /var/lib/snmp/cert_indexes
   Jan  1 00:02:34 (none) daemon.info snmpd[942]: Created directory: /var/lib/snmp/mib_indexes
   Jan  1 00:02:34 (none) daemon.info snmpd[944]: NET-SNMP version 5.8

--
Grant

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Buildroot] Slow SNMP daemon startup
  2020-12-15 16:00 ` Grant Edwards
@ 2020-12-15 16:55   ` Grant Edwards
  0 siblings, 0 replies; 3+ messages in thread
From: Grant Edwards @ 2020-12-15 16:55 UTC (permalink / raw)
  To: buildroot

On 2020-12-15, Grant Edwards <grant.b.edwards@gmail.com> wrote:
> On 2020-12-15, Grant Edwards <grant.b.edwards@gmail.com> wrote:

>> After upgrading from an older version of net-snmp (5.7.3 -> 5.8) it
>> now takes the snmp daemon anywhere from 5s to a minute to start up.

If there's no network traffic, it can take _several_minutes_ for snmpd
to start. This makes one suspect a lack of entropy, and strace
confirms that:

 00:00:09 gettimeofday({9, 266859}, NULL) = 0
 00:00:09 futex(0x4044bc3c, FUTEX_WAKE_PRIVATE, 2147483647) = 0
 00:00:09 getrandom(0x3f830, 32, 0)      = -1 ENOSYS (Function not implemented)
 00:00:09 shmget(0x72, 1, 000)           = -1 ENOENT (No such file or directory)
 00:00:09 uname({sysname="Linux", nodename="grant-eip-4", ...}) = 0
 00:00:09 open("/dev/random", O_RDONLY|O_LARGEFILE) = 9
 00:00:09 _newselect(10, [9], NULL, NULL, NULL) = 1 (in [9])
 00:01:23 close(9)                       = 0
 00:01:23 shmget(0x72, 1, IPC_CREAT|0444) = 0
 00:01:23 shmat(0, NULL, SHM_RDONLY)     = 0x4000a000
 00:01:23 open("/dev/urandom", O_RDONLY|O_LARGEFILE) = 9
 00:01:23 fstat64(9, {st_mode=S_IFCHR|0660, st_rdev=makedev(1, 9), ...}) = 0
 00:01:23 read(9, "\330\3311\376\346\213\362\5Ib\365\347*BS\354\351\375\t<\346\310\24C\254\365h\330-.\372\230", 32) = 32
 00:01:23 gettimeofday({83, 792926}, NULL) = 0

Why do application developers consider this acceptable behavior?

--
Grant

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-12-15 16:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-15 15:52 [Buildroot] Slow SNMP daemon startup Grant Edwards
2020-12-15 16:00 ` Grant Edwards
2020-12-15 16:55   ` Grant Edwards

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.