This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

[9.006-5] swap usage results

.
.
Script developed by Anonymous, automation by BAlfson:

How to grab theres stats very easy...Login as root and then copy and paste the following blocks of commands:

wget www.mediasoftusa.com/swapusage
md5sum swapusage

The result should be: 0ed29febd7d70393b43d7a86e92e257c

If that's correct, continue with:
mv swapusage swap-usage.pl
chmod u+x swap-usage.pl
./swap-usage.pl
free -m
uptime
version


#!/usr/bin/perl
use warnings;
use strict;

my $overall = 0;
my %out = ();

opendir(my $dh, '/proc/') || die "Can't open /proc: $!";
my @pids = grep { -d "/proc/".$_ && /^[0-9]+$/} readdir($dh);
closedir($dh);
foreach my $pid (@pids) {
    my $sum = 0;
    next unless -d "/proc/$pid";
    print ".";
    foreach my $swap ( `grep Swap /proc/$pid/smaps 2>/dev/null` ){
        next unless $swap;
        $swap = (split(/\s+/,$swap))[-2];
        $sum += $swap;
        $overall += $swap;
    }

    my $progname = `ps -p $pid  -o comm --no-headers`;
    chomp($progname);
    $sum = t($sum);
    $out{$pid} = [$progname,$sum] unless $sum == 0;
}
$overall = t($overall);
my $total = t(`grep SwapTotal /proc/meminfo`);
print "\nSwapTotal: $total MB\n";
print "SwapUsed:   $overall MB\n";
print "========================================\n";
print "MB\t%\tPID\tprocess\n";
foreach my $pid ( sort{ $out{$b}[1]  $out{$a}[1] } keys(%out) ) {
  print $out{$pid}[1]."\t".p($total,$out{$pid}[1])."\t".$pid."\t".$out{$pid}[0]."\n";
}

sub t {
    my $x = shift;
    $x = (split(/\s+/,$x))[-2] if $x =~ /\s/;
    sprintf("%.1f",$x/1024);
}

sub p {
    my $total = shift;
    my $x = shift;
    return sprintf("%.1f",100*$x/$total);
}


Here's my output:


SwapTotal: 1024.0 MB
SwapUsed:   358.6 MB
========================================
MB      %       PID     process
125.8   12.3    6813    snort_inline
52.3    5.1     5787    afcd
32.0    3.1     7548    snort_inline
23.8    2.3     3513    confd.plx
17.7    1.7     28339   index.plx
16.2    1.6     23224   confd.plx
15.5    1.5     16384   confd.plx
15.4    1.5     5659    screenmgr.plx
13.6    1.3     5711    httpproxy
11.8    1.2     3159    confd.plx
6.6     0.6     4060    mdw.plx
5.9     0.6     4135    selfmonng.plx
5.7     0.6     3286    aua.bin
3.7     0.4     3508    notifier.plx
2.7     0.3     4103    selfmonng.plx
1.8     0.2     3237    sysmond
1.3     0.1     3190    confd-qrunner.p
0.9     0.1     5377    named
0.7     0.1     3090    irqd
0.6     0.1     5724    ctasd
0.6     0.1     5709    ctipd.bin
0.3     0.0     6048    master
0.2     0.0     3550    rrdcached
0.2     0.0     2335    udevd
0.2     0.0     5435    sshd
0.2     0.0     31050   awed
0.2     0.0     1474    udevd
0.2     0.0     31027   awed
0.2     0.0     3054    hald-addon-inpu
0.2     0.0     3070    hald-addon-acpi
0.2     0.0     5719    ctasd
0.2     0.0     1473    udevd
0.1     0.0     2784    dbus-daemon
0.1     0.0     5693    frox
0.1     0.0     1       init
0.1     0.0     8730    smtpd.bin
0.1     0.0     3287    logger
0.1     0.0     5136    ipv6_watchdog
0.1     0.0     4130    mingetty
0.1     0.0     3032    hald
0.1     0.0     4129    mingetty
0.1     0.0     6811    argos
0.1     0.0     3104    lcm-162
0.1     0.0     3118    haveged
0.1     0.0     3579    atd
0.1     0.0     4131    mingetty
0.1     0.0     2768    acpid
0.1     0.0     4133    mingetty
0.1     0.0     4128    mingetty
0.1     0.0     4132    mingetty



 astaro:/tmp # free -m
             total       used       free     shared    buffers     cached
Mem:          7957       7711        246          0        249       4155
-/+ buffers/cache:       3307       4650
Swap:         1023        321        702



 astaro:/tmp # uptime
 15:02pm  up 12 days 12:58,  1 user,  load average: 3.11, 3.46, 3.31



 astaro:/tmp # version

Current software version...: 9.006005
Hardware type..............: 320C
Serial number..............:
Installation image.........: 9.004-33.1
Installation type..........: ssi
Installed pattern version..: 44684
Downloaded pattern version.: 44684
Up2Dates applied...........: 4 (see below)
                             sys-9.004-9.004-33.34.1.tgz (Jan 31 14:19)
                             sys-9.004-9.005-29.15.2.tgz (Feb 13 07:57)
                             sys-9.005-9.005-15.16.1.tgz (Mar  7 02:05)
                             sys-9.005-9.006-15.5.2.tgz (Apr  6 02:01)
Up2Dates available.........: 0
Factory resets.............: 0
Timewarps detected.........: 0


This thread was automatically locked due to age.
Parents
  • So, here is the next Cluster with this issue, but with the software version 9.005016.


    SwapTotal: 1024.0 MB
    SwapUsed:   1076.0 MB
    ========================================
    MB      %       PID     process
    794.0   77.5    5140    httpproxy
    56.8    5.5     5391    afcd
    26.4    2.6     3472    confd.plx
    17.9    1.7     22397   confd.plx
    16.4    1.6     3156    confd.plx
    15.9    1.6     28688   confd-sync
    14.8    1.4     27627   confd.plx
    11.6    1.1     29007   smtpd.bin
    11.2    1.1     29045   smtpd.bin
    10.3    1.0     27802   smtpd.bin
    6.9     0.7     3278    aua.bin
    6.5     0.6     4058    mdw.plx
    6.3     0.6     4111    selfmonng.plx
    5.5     0.5     29246   red_server.plc
    5.4     0.5     3531    notifier.plx
    3.8     0.4     4090    selfmonng.plx
    3.4     0.3     23481   red_server.plc
    3.2     0.3     29664   ctasd
    2.9     0.3     28884   red_server.plc
    2.8     0.3     4368    conntrackd
    2.8     0.3     18912   red_server.plc
    2.7     0.3     14115   index.plx
    2.2     0.2     3140    haveged
    2.1     0.2     4961    named
    1.9     0.2     28790   ha_proxy
    1.9     0.2     28788   ha_proxy
    1.9     0.2     5127    ctipd.bin
    1.8     0.2     3221    sysmond
    1.7     0.2     5994    slon_control
    1.7     0.2     3187    confd-qrunner.p
    1.6     0.2     7350    index.plx
    1.5     0.1     6211    dhcpd
    1.5     0.1     25094   snmpd
    1.4     0.1     29052   dns-resolver.pl
    1.0     0.1     3087    irqd
    1.0     0.1     24441   postgres
    0.9     0.1     28839   postgres
    0.8     0.1     29308   httpd
    0.8     0.1     29311   httpd
    0.7     0.1     311     index.plx
    0.7     0.1     27709   httpd
    0.7     0.1     27704   httpd
    0.6     0.1     29463   winbindd
    0.6     0.1     310     index.plx
    0.6     0.1     1407    postgres
    0.5     0.0     1364    postgres
    0.5     0.0     29764   winbindd
    0.5     0.0     1306    postgres
    0.5     0.0     6110    pluto
    0.5     0.0     1326    postgres
    0.5     0.0     1298    postgres
    0.5     0.0     1373    postgres
    0.5     0.0     29384   winbindd
    0.5     0.0     1309    postgres
    0.5     0.0     1368    postgres
    0.4     0.0     1410    postgres
    0.4     0.0     1370    postgres
    0.4     0.0     1285    postgres
    0.4     0.0     1736    winbindd
    0.4     0.0     1369    postgres
    0.4     0.0     29652   winbindd
    0.4     0.0     29655   winbindd
    0.4     0.0     29122   postgres
    0.4     0.0     3561    rrdcached
    0.4     0.0     1374    postgres
    0.4     0.0     29390   winbindd
    0.4     0.0     1304    postgres
    0.4     0.0     1305    postgres
    0.4     0.0     1307    postgres
    0.3     0.0     3975    postgres
    0.3     0.0     3976    postgres
    0.3     0.0     3977    postgres
    0.3     0.0     3978    postgres
    0.3     0.0     2329    udevd
    0.2     0.0     3068    hald-addon-acpi
    0.2     0.0     3052    hald-addon-inpu
    0.2     0.0     8764    udevd
    0.2     0.0     27803   postgres
    0.2     0.0     29739   syslog-ng
    0.2     0.0     29662   ctasd
    0.2     0.0     3030    hald
    0.2     0.0     32109   cssd
    0.2     0.0     3960    postgres
    0.2     0.0     1749    postgres
    0.2     0.0     29304   openvpn
    0.2     0.0     29364   ulogd
    0.2     0.0     4890    sshd
    0.2     0.0     25281   qmgr
    0.2     0.0     29740   syslog-ng
    0.2     0.0     27995   udevd
    0.2     0.0     7353    postgres
    0.2     0.0     14134   postgres
    0.2     0.0     318     postgres
    0.2     0.0     5388    master
    0.2     0.0     317     postgres
    0.1     0.0     27612   webadmin.plx
    0.1     0.0     2782    dbus-daemon
    0.1     0.0     2766    acpid
    0.1     0.0     4107    mingetty
    0.1     0.0     1360    slon
    0.1     0.0     4874    cron
    0.1     0.0     4105    mingetty
    0.1     0.0     29057   slon
    0.1     0.0     27809   postgres
    0.1     0.0     6498    _pluto_adns
    0.1     0.0     4104    mingetty
    0.1     0.0     28986   DSL.sh
    0.1     0.0     4103    mingetty
    0.1     0.0     29056   slon
    0.1     0.0     4106    mingetty
    0.1     0.0     3157    logger
    0.1     0.0     29303   openvpn
    0.1     0.0     3101    lcm-162
    0.1     0.0     3590    atd
    0.1     0.0     26645   postgres
    0.1     0.0     1294    slon
    0.1     0.0     1406    hotspotd
    0.1     0.0     5085    frox
    0.1     0.0     3031    hald-runner
    0.1     0.0     6107    starter
     asg:/root # free -m
                 total       used       free     shared    buffers     cached
    Mem:          3260       3232         28          0         14        940
    -/+ buffers/cache:       2277        983
    Swap:         1023        992         31
     asg:/root # uptime
     11:24am  up 44 days 11:42,  1 user,  load average: 2.45, 2.60, 2.37
     asg:/root # version

    Current software version...: 9.005016
    Hardware type..............: 425A2
    Serial number..............: ******************
    Installation image.........: 9.000-8.1
    Installation type..........: ssi
    Installed pattern version..: 44844
    Downloaded pattern version.: 44844
    Up2Dates applied...........: 9 (see below)
                                 sys-9.000-9.001-8.18.1.tgz (Nov 15 12:14)
                                 sys-9.001-9.002-18.12.1.tgz (Nov 15 12:15)
                                 sys-9.002-9.003-12.15.1.tgz (Nov 15 12:17)
                                 sys-9.003-9.003-15.16.4.tgz (Nov 15 12:17)
                                 sys-9.003-9.004-15.29.1.tgz (Nov 15 12:18)
                                 sys-9.004-9.004-29.33.1.tgz (Dec 27 17:35)
                                 sys-9.004-9.004-33.34.1.tgz (Dec 27 17:35)
                                 sys-9.004-9.005-29.15.2.tgz (Feb 14 18:17)
                                 sys-9.005-9.005-15.16.1.tgz (Mar  9 22:39)
    Up2Dates available.........: 1
    Factory resets.............: 0
    Timewarps detected.........: 0
Reply
  • So, here is the next Cluster with this issue, but with the software version 9.005016.


    SwapTotal: 1024.0 MB
    SwapUsed:   1076.0 MB
    ========================================
    MB      %       PID     process
    794.0   77.5    5140    httpproxy
    56.8    5.5     5391    afcd
    26.4    2.6     3472    confd.plx
    17.9    1.7     22397   confd.plx
    16.4    1.6     3156    confd.plx
    15.9    1.6     28688   confd-sync
    14.8    1.4     27627   confd.plx
    11.6    1.1     29007   smtpd.bin
    11.2    1.1     29045   smtpd.bin
    10.3    1.0     27802   smtpd.bin
    6.9     0.7     3278    aua.bin
    6.5     0.6     4058    mdw.plx
    6.3     0.6     4111    selfmonng.plx
    5.5     0.5     29246   red_server.plc
    5.4     0.5     3531    notifier.plx
    3.8     0.4     4090    selfmonng.plx
    3.4     0.3     23481   red_server.plc
    3.2     0.3     29664   ctasd
    2.9     0.3     28884   red_server.plc
    2.8     0.3     4368    conntrackd
    2.8     0.3     18912   red_server.plc
    2.7     0.3     14115   index.plx
    2.2     0.2     3140    haveged
    2.1     0.2     4961    named
    1.9     0.2     28790   ha_proxy
    1.9     0.2     28788   ha_proxy
    1.9     0.2     5127    ctipd.bin
    1.8     0.2     3221    sysmond
    1.7     0.2     5994    slon_control
    1.7     0.2     3187    confd-qrunner.p
    1.6     0.2     7350    index.plx
    1.5     0.1     6211    dhcpd
    1.5     0.1     25094   snmpd
    1.4     0.1     29052   dns-resolver.pl
    1.0     0.1     3087    irqd
    1.0     0.1     24441   postgres
    0.9     0.1     28839   postgres
    0.8     0.1     29308   httpd
    0.8     0.1     29311   httpd
    0.7     0.1     311     index.plx
    0.7     0.1     27709   httpd
    0.7     0.1     27704   httpd
    0.6     0.1     29463   winbindd
    0.6     0.1     310     index.plx
    0.6     0.1     1407    postgres
    0.5     0.0     1364    postgres
    0.5     0.0     29764   winbindd
    0.5     0.0     1306    postgres
    0.5     0.0     6110    pluto
    0.5     0.0     1326    postgres
    0.5     0.0     1298    postgres
    0.5     0.0     1373    postgres
    0.5     0.0     29384   winbindd
    0.5     0.0     1309    postgres
    0.5     0.0     1368    postgres
    0.4     0.0     1410    postgres
    0.4     0.0     1370    postgres
    0.4     0.0     1285    postgres
    0.4     0.0     1736    winbindd
    0.4     0.0     1369    postgres
    0.4     0.0     29652   winbindd
    0.4     0.0     29655   winbindd
    0.4     0.0     29122   postgres
    0.4     0.0     3561    rrdcached
    0.4     0.0     1374    postgres
    0.4     0.0     29390   winbindd
    0.4     0.0     1304    postgres
    0.4     0.0     1305    postgres
    0.4     0.0     1307    postgres
    0.3     0.0     3975    postgres
    0.3     0.0     3976    postgres
    0.3     0.0     3977    postgres
    0.3     0.0     3978    postgres
    0.3     0.0     2329    udevd
    0.2     0.0     3068    hald-addon-acpi
    0.2     0.0     3052    hald-addon-inpu
    0.2     0.0     8764    udevd
    0.2     0.0     27803   postgres
    0.2     0.0     29739   syslog-ng
    0.2     0.0     29662   ctasd
    0.2     0.0     3030    hald
    0.2     0.0     32109   cssd
    0.2     0.0     3960    postgres
    0.2     0.0     1749    postgres
    0.2     0.0     29304   openvpn
    0.2     0.0     29364   ulogd
    0.2     0.0     4890    sshd
    0.2     0.0     25281   qmgr
    0.2     0.0     29740   syslog-ng
    0.2     0.0     27995   udevd
    0.2     0.0     7353    postgres
    0.2     0.0     14134   postgres
    0.2     0.0     318     postgres
    0.2     0.0     5388    master
    0.2     0.0     317     postgres
    0.1     0.0     27612   webadmin.plx
    0.1     0.0     2782    dbus-daemon
    0.1     0.0     2766    acpid
    0.1     0.0     4107    mingetty
    0.1     0.0     1360    slon
    0.1     0.0     4874    cron
    0.1     0.0     4105    mingetty
    0.1     0.0     29057   slon
    0.1     0.0     27809   postgres
    0.1     0.0     6498    _pluto_adns
    0.1     0.0     4104    mingetty
    0.1     0.0     28986   DSL.sh
    0.1     0.0     4103    mingetty
    0.1     0.0     29056   slon
    0.1     0.0     4106    mingetty
    0.1     0.0     3157    logger
    0.1     0.0     29303   openvpn
    0.1     0.0     3101    lcm-162
    0.1     0.0     3590    atd
    0.1     0.0     26645   postgres
    0.1     0.0     1294    slon
    0.1     0.0     1406    hotspotd
    0.1     0.0     5085    frox
    0.1     0.0     3031    hald-runner
    0.1     0.0     6107    starter
     asg:/root # free -m
                 total       used       free     shared    buffers     cached
    Mem:          3260       3232         28          0         14        940
    -/+ buffers/cache:       2277        983
    Swap:         1023        992         31
     asg:/root # uptime
     11:24am  up 44 days 11:42,  1 user,  load average: 2.45, 2.60, 2.37
     asg:/root # version

    Current software version...: 9.005016
    Hardware type..............: 425A2
    Serial number..............: ******************
    Installation image.........: 9.000-8.1
    Installation type..........: ssi
    Installed pattern version..: 44844
    Downloaded pattern version.: 44844
    Up2Dates applied...........: 9 (see below)
                                 sys-9.000-9.001-8.18.1.tgz (Nov 15 12:14)
                                 sys-9.001-9.002-18.12.1.tgz (Nov 15 12:15)
                                 sys-9.002-9.003-12.15.1.tgz (Nov 15 12:17)
                                 sys-9.003-9.003-15.16.4.tgz (Nov 15 12:17)
                                 sys-9.003-9.004-15.29.1.tgz (Nov 15 12:18)
                                 sys-9.004-9.004-29.33.1.tgz (Dec 27 17:35)
                                 sys-9.004-9.004-33.34.1.tgz (Dec 27 17:35)
                                 sys-9.004-9.005-29.15.2.tgz (Feb 14 18:17)
                                 sys-9.005-9.005-15.16.1.tgz (Mar  9 22:39)
    Up2Dates available.........: 1
    Factory resets.............: 0
    Timewarps detected.........: 0
Children
  • So, here is the next Cluster with this issue, but with the software version 9.005016.


    I've forgotten that the newest proxy is already installed.
    In agreement with the support - the only temporary solution is to configure a cronjob, to restart the http proxy every night.

    Sophos, please solve this issue!

    Nice greetings
  • ....
    Sophos, please solve this issue!

    Yes and it would be interesting to know how their QA testing machines are equipped. I guess they have more than 2gb of RAM, otherwise they should have easily found the swapping problem.
    My production machine has 16gb RAM and is up and running on 9.006-15 for nearly 15 days. Swapping is still zero, the average memory usage is about 25%.