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
  • And also here is a active/passive cluster, with two 220 UTM devices.
    Same issue, same swapping . Configuration is ok.
    The users notices it, the performance of the proxy is very bad.


    SwapTotal: 1024.0 MB
    SwapUsed:   1138.1 MB
    ========================================
    MB      %       PID     process
    595.2   58.1    5806    httpproxy
    92.4    9.0     6656    snort_inline
    56.4    5.5     6103    afcd
    31.0    3.0     4288    confd.plx
    30.1    2.9     17939   index.plx
    28.1    2.7     4128    mdw.plx
    23.7    2.3     3466    confd.plx
    19.0    1.9     3141    confd.plx
    18.4    1.8     5850    httpd
    16.9    1.7     5787    httpd
    15.2    1.5     1758    awed
    14.2    1.4     7686    smtpd.bin
    14.2    1.4     8324    awed
    13.9    1.4     25716   confd.plx
    13.2    1.3     7633    smtpd.bin
    12.2    1.2     27068   smtpd.bin
    10.5    1.0     7169    confd-sync
    9.9     1.0     7574    awed
    9.9     1.0     31332   index.plx
    9.0     0.9     9134    index.plx
    7.9     0.8     3507    notifier.plx
    7.3     0.7     3270    aua.bin
    6.3     0.6     4284    selfmonng.plx
    4.1     0.4     4172    selfmonng.plx
    3.3     0.3     5608    sockd
    3.0     0.3     5758    ctasd
    2.8     0.3     4601    sockd
    2.6     0.3     3125    haveged
    2.4     0.2     5345    sockd
    2.4     0.2     5347    sockd
    2.4     0.2     5613    sockd
    2.4     0.2     5353    sockd
    2.4     0.2     3184    sockd
    2.4     0.2     12079   sockd
    2.4     0.2     12080   sockd
    2.4     0.2     3159    sockd
    2.0     0.2     5396    named
    1.9     0.2     3172    confd-qrunner.p
    1.9     0.2     7275    ha_proxy
    1.9     0.2     3210    sysmond
    1.9     0.2     7274    ha_proxy
    1.8     0.2     7385    dns-resolver.pl
    1.8     0.2     3875    slon_control
    1.3     0.1     5059    snmpd
    1.2     0.1     13604   postgres
    1.1     0.1     6004    dhcpd
    1.1     0.1     3072    irqd
    1.0     0.1     7681    httpd
    1.0     0.1     7704    httpd
    1.0     0.1     7673    openvpn
    0.8     0.1     31333   postgres
    0.7     0.1     7617    postgres
    0.7     0.1     25562   httpd
    0.7     0.1     9136    postgres
    0.7     0.1     5830    ctipd.bin
    0.7     0.1     25563   httpd
    0.7     0.1     13619   postgres
    0.6     0.1     13594   postgres
    0.6     0.1     13621   postgres
    0.6     0.1     13618   postgres
    0.6     0.1     13616   postgres
    0.6     0.1     11803   postgres
    0.6     0.1     13610   postgres
    0.6     0.1     13622   postgres
    0.6     0.1     13586   postgres
    0.6     0.1     13592   postgres
    0.5     0.0     13625   postgres
    0.5     0.0     11674   postgres
    0.5     0.0     7782    postgres
    0.5     0.0     13593   postgres
    0.5     0.0     5110    pluto
    0.5     0.0     13617   postgres
    0.5     0.0     13680   postgres
    0.4     0.0     5611    sockd
    0.4     0.0     3139    sockd
    0.4     0.0     5344    sockd
    0.4     0.0     7662    udevd
    0.4     0.0     5610    sockd
    0.4     0.0     5612    sockd
    0.4     0.0     2330    udevd
    0.4     0.0     8154    syslog-ng
    0.4     0.0     3138    sockd
    0.4     0.0     13595   postgres
    0.4     0.0     4030    postgres
    0.4     0.0     5609    sockd
    0.4     0.0     30086   udevd
    0.4     0.0     5343    sockd
    0.4     0.0     3569    rrdcached
    0.3     0.0     6420    master
    0.3     0.0     4013    postgres
    0.3     0.0     4031    postgres
    0.3     0.0     8151    syslog-ng
    0.3     0.0     4032    postgres
    0.3     0.0     4029    postgres
    0.3     0.0     13070   qmgr
    0.3     0.0     3014    hald
    0.3     0.0     14542   tlsmgr
    0.2     0.0     3015    hald-runner
    0.2     0.0     3053    hald-addon-acpi
    0.2     0.0     21860   postgres
    0.2     0.0     5532    sshd
    0.2     0.0     5605    sockd
    0.2     0.0     27069   postgres
    0.2     0.0     7675    openvpn
    0.2     0.0     5756    ctasd
    0.2     0.0     3036    hald-addon-inpu
    0.2     0.0     5109    starter
    0.2     0.0     27077   postgres
    0.2     0.0     7742    ulogd
    0.2     0.0     2768    dbus-daemon
    0.1     0.0     2752    acpid
    0.1     0.0     4218    mingetty
    0.1     0.0     3142    logger
    0.1     0.0     8242    slon
    0.1     0.0     8241    slon
    0.1     0.0     4216    mingetty
    0.1     0.0     3598    atd
    0.1     0.0     4220    mingetty
    0.1     0.0     3271    logger
    0.1     0.0     13606   slon
    0.1     0.0     3086    lcm-162
    0.1     0.0     4217    mingetty
    0.1     0.0     4215    mingetty
    0.1     0.0     4558    conntrackd
    0.1     0.0     5392    _pluto_adns
    0.1     0.0     8115    ntpd
    0.1     0.0     4219    mingetty
    0.1     0.0     1       init
    0.1     0.0     11802   hotspotd
    0.1     0.0     13582   slon
    0.1     0.0     5517    cron
     utm:/root # free -m
                 total       used       free     shared    buffers     cached
    Mem:          1974       1924         49          0         33        463
    -/+ buffers/cache:       1427        546
    Swap:         1023       1023          0
     utm:/root # uptime
     12:35pm  up 6 days 15:14,  1 user,  load average: 0.77, 1.00, 0.94
     utm:/root # version

    Current software version...: 9.006005
    Hardware type..............: 220r5
    Serial number..............: ************xx
    Installation image.........: 9.000-8.1
    Installation type..........: ssi
    Installed pattern version..: 44846
    Downloaded pattern version.: 44846
    Up2Dates applied...........: 10 (see below)
                                 sys-9.000-9.001-8.18.1.tgz (Sep  5  2012)
                                 sys-9.001-9.002-18.12.1.tgz (Sep  6  2012)
                                 sys-9.002-9.003-12.15.1.tgz (Oct 10  2012)
                                 sys-9.003-9.003-15.16.4.tgz (Oct 16  2012)
                                 sys-9.003-9.004-15.29.1.tgz (Oct 31 12:02)
                                 sys-9.004-9.004-29.33.1.tgz (Nov 16 04:00)
                                 sys-9.004-9.004-33.34.1.tgz (Dec 28 12:00)
                                 sys-9.004-9.005-29.15.2.tgz (Feb 12 19:51)
                                 sys-9.005-9.005-15.16.1.tgz (Mar  5 22:04)
                                 sys-9.005-9.006-15.5.2.tgz (Mar 24 23:05)
    Up2Dates available.........: 0
    Factory resets.............: 0
    Timewarps detected.........: 0


    Remark to the Memory Usage Graph - 1. reboot of the devices

    Nice greetings
Reply
  • And also here is a active/passive cluster, with two 220 UTM devices.
    Same issue, same swapping . Configuration is ok.
    The users notices it, the performance of the proxy is very bad.


    SwapTotal: 1024.0 MB
    SwapUsed:   1138.1 MB
    ========================================
    MB      %       PID     process
    595.2   58.1    5806    httpproxy
    92.4    9.0     6656    snort_inline
    56.4    5.5     6103    afcd
    31.0    3.0     4288    confd.plx
    30.1    2.9     17939   index.plx
    28.1    2.7     4128    mdw.plx
    23.7    2.3     3466    confd.plx
    19.0    1.9     3141    confd.plx
    18.4    1.8     5850    httpd
    16.9    1.7     5787    httpd
    15.2    1.5     1758    awed
    14.2    1.4     7686    smtpd.bin
    14.2    1.4     8324    awed
    13.9    1.4     25716   confd.plx
    13.2    1.3     7633    smtpd.bin
    12.2    1.2     27068   smtpd.bin
    10.5    1.0     7169    confd-sync
    9.9     1.0     7574    awed
    9.9     1.0     31332   index.plx
    9.0     0.9     9134    index.plx
    7.9     0.8     3507    notifier.plx
    7.3     0.7     3270    aua.bin
    6.3     0.6     4284    selfmonng.plx
    4.1     0.4     4172    selfmonng.plx
    3.3     0.3     5608    sockd
    3.0     0.3     5758    ctasd
    2.8     0.3     4601    sockd
    2.6     0.3     3125    haveged
    2.4     0.2     5345    sockd
    2.4     0.2     5347    sockd
    2.4     0.2     5613    sockd
    2.4     0.2     5353    sockd
    2.4     0.2     3184    sockd
    2.4     0.2     12079   sockd
    2.4     0.2     12080   sockd
    2.4     0.2     3159    sockd
    2.0     0.2     5396    named
    1.9     0.2     3172    confd-qrunner.p
    1.9     0.2     7275    ha_proxy
    1.9     0.2     3210    sysmond
    1.9     0.2     7274    ha_proxy
    1.8     0.2     7385    dns-resolver.pl
    1.8     0.2     3875    slon_control
    1.3     0.1     5059    snmpd
    1.2     0.1     13604   postgres
    1.1     0.1     6004    dhcpd
    1.1     0.1     3072    irqd
    1.0     0.1     7681    httpd
    1.0     0.1     7704    httpd
    1.0     0.1     7673    openvpn
    0.8     0.1     31333   postgres
    0.7     0.1     7617    postgres
    0.7     0.1     25562   httpd
    0.7     0.1     9136    postgres
    0.7     0.1     5830    ctipd.bin
    0.7     0.1     25563   httpd
    0.7     0.1     13619   postgres
    0.6     0.1     13594   postgres
    0.6     0.1     13621   postgres
    0.6     0.1     13618   postgres
    0.6     0.1     13616   postgres
    0.6     0.1     11803   postgres
    0.6     0.1     13610   postgres
    0.6     0.1     13622   postgres
    0.6     0.1     13586   postgres
    0.6     0.1     13592   postgres
    0.5     0.0     13625   postgres
    0.5     0.0     11674   postgres
    0.5     0.0     7782    postgres
    0.5     0.0     13593   postgres
    0.5     0.0     5110    pluto
    0.5     0.0     13617   postgres
    0.5     0.0     13680   postgres
    0.4     0.0     5611    sockd
    0.4     0.0     3139    sockd
    0.4     0.0     5344    sockd
    0.4     0.0     7662    udevd
    0.4     0.0     5610    sockd
    0.4     0.0     5612    sockd
    0.4     0.0     2330    udevd
    0.4     0.0     8154    syslog-ng
    0.4     0.0     3138    sockd
    0.4     0.0     13595   postgres
    0.4     0.0     4030    postgres
    0.4     0.0     5609    sockd
    0.4     0.0     30086   udevd
    0.4     0.0     5343    sockd
    0.4     0.0     3569    rrdcached
    0.3     0.0     6420    master
    0.3     0.0     4013    postgres
    0.3     0.0     4031    postgres
    0.3     0.0     8151    syslog-ng
    0.3     0.0     4032    postgres
    0.3     0.0     4029    postgres
    0.3     0.0     13070   qmgr
    0.3     0.0     3014    hald
    0.3     0.0     14542   tlsmgr
    0.2     0.0     3015    hald-runner
    0.2     0.0     3053    hald-addon-acpi
    0.2     0.0     21860   postgres
    0.2     0.0     5532    sshd
    0.2     0.0     5605    sockd
    0.2     0.0     27069   postgres
    0.2     0.0     7675    openvpn
    0.2     0.0     5756    ctasd
    0.2     0.0     3036    hald-addon-inpu
    0.2     0.0     5109    starter
    0.2     0.0     27077   postgres
    0.2     0.0     7742    ulogd
    0.2     0.0     2768    dbus-daemon
    0.1     0.0     2752    acpid
    0.1     0.0     4218    mingetty
    0.1     0.0     3142    logger
    0.1     0.0     8242    slon
    0.1     0.0     8241    slon
    0.1     0.0     4216    mingetty
    0.1     0.0     3598    atd
    0.1     0.0     4220    mingetty
    0.1     0.0     3271    logger
    0.1     0.0     13606   slon
    0.1     0.0     3086    lcm-162
    0.1     0.0     4217    mingetty
    0.1     0.0     4215    mingetty
    0.1     0.0     4558    conntrackd
    0.1     0.0     5392    _pluto_adns
    0.1     0.0     8115    ntpd
    0.1     0.0     4219    mingetty
    0.1     0.0     1       init
    0.1     0.0     11802   hotspotd
    0.1     0.0     13582   slon
    0.1     0.0     5517    cron
     utm:/root # free -m
                 total       used       free     shared    buffers     cached
    Mem:          1974       1924         49          0         33        463
    -/+ buffers/cache:       1427        546
    Swap:         1023       1023          0
     utm:/root # uptime
     12:35pm  up 6 days 15:14,  1 user,  load average: 0.77, 1.00, 0.94
     utm:/root # version

    Current software version...: 9.006005
    Hardware type..............: 220r5
    Serial number..............: ************xx
    Installation image.........: 9.000-8.1
    Installation type..........: ssi
    Installed pattern version..: 44846
    Downloaded pattern version.: 44846
    Up2Dates applied...........: 10 (see below)
                                 sys-9.000-9.001-8.18.1.tgz (Sep  5  2012)
                                 sys-9.001-9.002-18.12.1.tgz (Sep  6  2012)
                                 sys-9.002-9.003-12.15.1.tgz (Oct 10  2012)
                                 sys-9.003-9.003-15.16.4.tgz (Oct 16  2012)
                                 sys-9.003-9.004-15.29.1.tgz (Oct 31 12:02)
                                 sys-9.004-9.004-29.33.1.tgz (Nov 16 04:00)
                                 sys-9.004-9.004-33.34.1.tgz (Dec 28 12:00)
                                 sys-9.004-9.005-29.15.2.tgz (Feb 12 19:51)
                                 sys-9.005-9.005-15.16.1.tgz (Mar  5 22:04)
                                 sys-9.005-9.006-15.5.2.tgz (Mar 24 23:05)
    Up2Dates available.........: 0
    Factory resets.............: 0
    Timewarps detected.........: 0


    Remark to the Memory Usage Graph - 1. reboot of the devices

    Nice greetings
Children
No Data