snmpd eats memory

Bug #189504 reported by Ervin Hegedüs
8
Affects Status Importance Assigned to Milestone
net-snmp (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

Here are several Ubuntu 7.10 server, them have snmpd. Snmpd runs with this options:

/usr/sbin/snmpd -Lsd -Lf /dev/null -u snmp -I -smux -p /var/run/snmpd.pid

After few days, on those systems the size of free memory looks like decrease (we look them with several tools, like cacti, and top also shows up, snmpd eats about 3-4% of total memory).

Here are some output when I have restarted snmpd:

# free
             total used free shared buffers cached
Mem: 775568 567488 208080 0 190412 119996
-/+ buffers/cache: 257080 518488
Swap: 979832 0 979832

output of top:
  PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
13453 snmp 15 0 20444 16m 2376 S 0.0 2.7 3:12.69 snmpd

# /etc/init.d/snmpd stop

# free
             total used free shared buffers cached
Mem: 775568 412464 363104 0 190412 120000
-/+ buffers/cache: 102052 673516
Swap: 979832 0 979832

# /etc/init.d/snmpd start

# free
             total used free shared buffers cached
Mem: 775568 413604 361964 0 190412 120000
-/+ buffers/cache: 103192 672376
Swap: 979832 0 979832

After the restart the top command shows up:

  PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
28655 snmp 15 0 7500 4320 2376 S 0.0 0.6 0:01.09 snmpd

When we sense this first time, one of those systems has crashed - the system has ran out of memory.
After this affair we look those systems, which has snmpd, and restart the service on every week.

We didn't find with this effect on any other Linux (including Ubuntu) version.

Any suggestion?

Thanks:

airween

Revision history for this message
mikmak (mikmak) wrote :

I am running 2 gutsy amd64 servers (xen/drbd) (exact same setup on both hosts)
snmpd was running on the hosts for about a month and today got them very high in memory usage causing some problems in other services (network for example),
restarted both of them for now but there is definitely some leak

Mik

Revision history for this message
Marty (marty-supine) wrote :

We have two Gutsy servers that experience high memory usage after a few weeks.

Checking with top and ps shows snmpd grows to a few hundred MB of memory.

i.e.
ps
snmp 6958 0.0 18.0 377772 374680 ? S Apr28 7:43 /usr/sbin/snmpd -Lsd -Lf /dev/null -u snmp -I -smux -p /var/run/snmpd.pid 0.0.0.0

top
 6958 snmp 15 0 368m 365m 2304 S 0 18.1 7:43.47 snmpd

Revision history for this message
Michael (mboelen) wrote :

This seems to be related to an issue we encountered with the net-snmp libraries.

Both the snmp lib and daemon have several memory leaking fixes in version 5.4.1

Related parts from changelog [1]:
snmplib:
      - [PATCH 1616912]: fix memory leak in UDP transport code
      - [PATCH 1592706]: fix memory leak when cloning varbinds

snmpd:
      - [BUG 1558823]: fix ipAddressTable memory leak
      - [BUG 1596638]: fix memory leak in ipCidrRouteTable, inetCidrRouteTable
      - [BUG 1611524]: fix tcp connection table file descriptor leak

Possible solution is updating to this version manually, upgrading to Hardy (which has the new version), or waiting for an upgraded version in repository.

[1] http://net-snmp.sourceforge.net/about/ChangeLog.html

Revision history for this message
Ervin Hegedüs (airween) wrote :

I have upgraded that server a few week ago - the situation is better, snmpd doesn't eat memory as soon. Previously, it must to restart every week, but at this time snmpd runs since about 10 days, and there are some free memory.
But I can see (we use cacti to collect data's), the memory usage of snmpd is more and more at day after day.

Revision history for this message
Chuck Short (zulcss) wrote :

Is this still a problem for you in hardy?

Thanks
chuck

Changed in net-snmp:
status: New → Incomplete
Revision history for this message
Duncan (jdwannam) wrote :

This is affecting several of our 64-bit Ubuntu 7.10 (Gutsy) servers. The memory usage climbs faster the more oid's are pulled. Looping snmpwalk from my desktop causes the process to grow 128kbytes every iteration.

dpkg -l |grep snmp :
ii libsnmp-base 5.3.1-6ubuntu2 NET SNMP (Simple Network Management Protocol
ii libsnmp10 5.3.1-6ubuntu2 NET SNMP (Simple Network Management Protocol
ii snmp 5.3.1-6ubuntu2 NET SNMP (Simple Network Management Protocol
ii snmpd 5.3.1-6ubuntu2 NET SNMP (Simple Network Management Protocol

Hopefully the repository will include 5.4 sooner than later.

Revision history for this message
Chuck Short (zulcss) wrote :

Ok but I asked if you could try this on hardy?

Thanks
chuck

Revision history for this message
Ervin Hegedüs (airween) wrote : Re: [Bug 189504] Re: snmpd eats memory

Hello,

first, thanks for your help,

> Ok but I asked if you could try this on hardy?

currently no, that's a productive server, and we don't have any backup
hardware for that.

btw: the problem has solved partially, snmp eats the memory, but
system hasn't crashed till I upgraded it.

a.

> Thanks
> chuck
>
> --
> snmpd eats memory
> https://bugs.launchpad.net/bugs/189504
> You received this bug notification because you are a direct subscriber
> of the bug.
>

Revision history for this message
Johnathon (kirrus) wrote :

As we're not able to replicate the problem, and this bug hasn't had any activity for over 100 days I'm closing it. Let us know if you're still affected by this issue, and we'll re-open it.

Changed in net-snmp:
status: Incomplete → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.