Results 1 to 7 of 7

Thread: server is swapping ...

  1. #1
    Join Date
    Nov 2006
    Location
    Olten, Switzerland
    Posts
    82
    Rep Power
    9

    Default server is swapping ...

    Hi

    I have setup a zimbra 8 server:

    16G Ram, 4 CPU

    I have:

    35 Web Client Sessions
    106 IMAP Sessions

    the machine is partly swapping ...
    I thought it should run with much less

    what is the normal usage or is there something wrong in my configuration?

    thanks Manuel

  2. #2
    Join Date
    Oct 2012
    Posts
    10
    Rep Power
    3

    Default

    Hi !

    Could you please show us TOP with the memory usage sorted?

    Code:
     top # followed by P, which will sort by memory usage
    For the swap usage you could use the script posted here to find out.

    Please post the results !!

    N.

  3. #3
    Join Date
    Nov 2006
    Location
    Olten, Switzerland
    Posts
    82
    Rep Power
    9

    Default

    Hi

    I did rise the memory from 16G to 22G now the swapping has stooped

    top - 17:38:02 up 1 day, 19:32, 2 users, load average: 0.49, 0.55, 0.71
    Tasks: 212 total, 1 running, 211 sleeping, 0 stopped, 0 zombie
    Cpu(s): 24.2%us, 3.3%sy, 0.0%ni, 72.2%id, 0.3%wa, 0.0%hi, 0.0%si, 0.0%st
    Mem: 22629036k total, 22414020k used, 215016k free, 176684k buffers
    Swap: 9765884k total, 507824k used, 9258060k free, 13856560k cached

    PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
    13464 zimbra 20 0 2250m 256m 13m S 3 1.2 3:35.11 java
    25707 zimbra 20 0 981m 13m 7276 S 2 0.1 0:00.07 java
    25666 zimbra 20 0 44112 7344 2232 S 2 0.0 0:00.06 zmcontrol
    594 root 20 0 37352 2012 1352 S 1 0.0 3:25.83 ssh
    3194 zimbra 20 0 6426m 4.2g 10m S 1 19.7 699:57.99 java
    12177 zimbra 20 0 44052 9428 3012 S 1 0.0 0:04.82 zmlogger
    25654 zimbra 20 0 37724 4940 2180 S 1 0.0 0:00.02 zmstatuslog
    19 root 20 0 0 0 0 S 0 0.0 0:12.73 ksoftirqd/3
    593 root 20 0 69096 5392 816 S 0 0.0 0:52.67 rsync
    1210 root 20 0 73124 4456 1740 S 0 0.0 0:34.61 syslog-ng
    3927 zimbra 20 0 38736 4288 2268 S 0 0.0 0:40.43 zmstat-proc
    12176 zimbra 20 0 37652 10m 1016 S 0 0.0 0:01.49 /opt/zimbra/lib
    25439 zimbra 20 0 11100 1280 888 R 0 0.0 0:00.01 top
    1 root 20 0 17988 1660 880 S 0 0.0 0:05.54 init


    Overall swap used: 784796 kB
    ========================================
    kB pid name
    ========================================
    299732 3123 mysqld
    62664 3274 /opt/zimbra/ama
    60112 28243 /opt/zimbra/ama
    60112 26351 /opt/zimbra/ama
    32008 10544 /opt/zimbra/ama
    31696 12646 /opt/zimbra/ama
    31320 2367 /opt/zimbra/ama
    31100 28635 /opt/zimbra/ama
    30960 6070 /opt/zimbra/ama
    30740 13421 /opt/zimbra/ama
    30272 31881 /opt/zimbra/ama
    25348 3194 java
    8432 1883 slapd
    4576 3939 zmstat-fd
    3064 3949 zmstat-ldap
    3064 3929 zmstat-cpu
    3056 3937 zmstat-io
    3048 3933 zmstat-io
    3016 3935 zmstat-df
    3012 3947 zmstat-mtaqueue
    2948 3927 zmstat-proc
    2944 3931 zmstat-vm
    2840 4424 zmstat-fd
    2632 3943 zmstat-mysql
    2332 3941 zmstat-allprocs
    2028 3945 zmstat-convertd
    1212 1210 syslog-ng
    1144 2592 httpd
    836 3876 opendkim
    756 3877 opendkim
    636 8777 sshd
    600 3513 freshclam
    452 1057 sshd
    428 1911 ntpd
    424 3868 saslauthd
    424 3867 saslauthd
    424 3866 saslauthd
    356 1094 dbus-daemon
    288 3870 saslauthd
    276 3869 saslauthd
    264 1587 sshguard
    260 1217 acpid
    256 4422 sudo
    204 2649 mysqld_safe
    196 3367 clamd
    196 1127 avahi-daemon
    184 733 upstart-socket-
    124 1215 getty
    124 1213 getty
    124 1194 getty
    124 1126 avahi-daemon
    120 9099 tcsh
    120 3951 getty
    120 1212 getty
    120 1188 getty
    116 1219 atd
    116 1 init
    104 3193 zmmailboxdmgr
    84 3856 master
    80 449 upstart-udev-br
    80 1222 irqbalance
    76 452 udevd
    72 2593 rotatelogs
    68 4766 vmstat
    52 1220 cron
    44 4764 iostat
    44 4759 iostat
    12 31138 cron

  4. #4
    Join Date
    Oct 2012
    Posts
    10
    Rep Power
    3

    Default

    Hi.

    My mistake. TOP should be followed by "M" to sort by memory. :}

    Anyway, it seems that either you have not configured your swappiness to be "0" or your Mysql is taking the most of the memory and the server is swapping despite the swappiness being set to 0.

    1. So first check the TOP command once more with "M".
    2. Check the swappiness: cat /proc/sys/vm/swappiness.
    3. Check the size of your mysql database (mysql dir #du -hs /opt/zimbra/db).

    If Mysql is the culprit then you can either try to tune it (CAREFULLY!!) or to read this post, vote for the "bug" and wait .

    N.

  5. #5
    Join Date
    Nov 2006
    Location
    Olten, Switzerland
    Posts
    82
    Rep Power
    9

    Default

    Hi

    1. by M

    top - 22:26:45 up 25 min, 3 users, load average: 1.10, 1.11, 0.88
    Tasks: 185 total, 2 running, 183 sleeping, 0 stopped, 0 zombie
    Cpu0 : 0.3%us, 0.0%sy, 0.0%ni, 99.7%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
    Cpu1 : 0.0%us, 88.6%sy, 0.0%ni, 8.0%id, 3.3%wa, 0.0%hi, 0.0%si, 0.0%st
    Cpu2 : 0.0%us, 0.0%sy, 0.0%ni,100.0%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
    Cpu3 : 0.3%us, 0.0%sy, 0.0%ni, 99.3%id, 0.3%wa, 0.0%hi, 0.0%si, 0.0%st
    Mem: 22629036k total, 4175176k used, 18453860k free, 247624k buffers
    Swap: 9765884k total, 0k used, 9765884k free, 572572k cached

    PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
    3771 zimbra 20 0 6382m 1.3g 15m S 0 5.9 0:57.55 java
    3700 zimbra 20 0 5344m 674m 7104 S 0 3.1 0:03.65 mysqld
    2486 zimbra 20 0 2250m 198m 14m S 0 0.9 0:31.64 java
    3962 zimbra 20 0 300m 117m 5724 S 0 0.5 0:05.66 clamd
    3912 zimbra 20 0 218m 109m 4408 S 0 0.5 0:01.67 /opt/zimbra/ama
    3906 zimbra 20 0 217m 109m 4192 S 0 0.5 0:00.91 /opt/zimbra/ama
    3903 zimbra 20 0 217m 108m 4184 S 0 0.5 0:00.62 /opt/zimbra/ama
    3909 zimbra 20 0 217m 108m 4196 S 0 0.5 0:00.61 /opt/zimbra/ama
    3911 zimbra 20 0 217m 108m 4312 S 0 0.5 0:00.54 /opt/zimbra/ama
    3904 zimbra 20 0 217m 108m 4184 S 0 0.5 0:00.47 /opt/zimbra/ama
    3908 zimbra 20 0 217m 108m 4136 S 0 0.5 0:00.44 /opt/zimbra/ama
    3905 zimbra 20 0 216m 107m 4280 S 0 0.5 0:00.26 /opt/zimbra/ama
    3846 zimbra 20 0 209m 104m 2764 S 0 0.5 0:01.78 /opt/zimbra/ama
    3907 zimbra 20 0 209m 103m 1112 S 0 0.5 0:00.00 /opt/zimbra/ama
    3910 zimbra 20 0 209m 103m 1112 S 0 0.5 0:00.00 /opt/zimbra/ama
    8345 root 20 0 111m 94m 884 R 88 0.4 15:01.32 resize2fs
    2076 zimbra 20 0 80.2g 40m 5156 S 0 0.2 0:00.86 slapd
    16722 zimbra 20 0 37648 11m 2128 S 0 0.1 0:00.17 perl
    16613 zimbra 20 0 37652 10m 1016 S 0 0.0 0:00.08 /opt/zimbra/lib
    4545 zimbra 20 0 40056 10m 2372 S 0 0.0 0:00.88 zmstat-ldap
    16717 zimbra 20 0 35008 9624 2180 S 0 0.0 0:00.08 swatch
    16614 zimbra 20 0 44040 9416 3012 S 0 0.0 0:00.34 zmlogger
    4537 zimbra 20 0 39392 7820 2224 S 0 0.0 0:01.96 zmstat-allprocs
    4541 zimbra 20 0 38844 7304 2240 S 0 0.0 0:00.46 zmstat-convertd
    4523 zimbra 20 0 36516 7156 2248 S 0 0.0 0:00.40 zmstat-proc
    4539 zimbra 20 0 36380 6996 2244 S 0 0.0 0:00.18 zmstat-mysql
    4529 zimbra 20 0 36380 6932 2252 S 0 0.0 0:00.10 zmstat-io
    4527 zimbra 20 0 36248 6876 2240 S 0 0.0 0:00.08 zmstat-vm
    4533 zimbra 20 0 36248 6876 2240 S 0 0.0 0:00.08 zmstat-io
    4020 zimbra 20 0 99160 6864 2552 S 0 0.0 0:00.04 httpd
    4531 zimbra 20 0 36248 6816 2236 S 0 0.0 0:00.28 zmstat-df
    4525 zimbra 20 0 36248 6812 2216 S 0 0.0 0:00.08 zmstat-cpu
    4535 zimbra 20 0 38348 6808 2228 S 0 0.0 0:00.05 zmstat-fd
    4543 zimbra 20 0 36240 6772 2240 S 0 0.0 0:00.08 zmstat-mtaqueue
    5048 root 20 0 38200 6672 2292 S 0 0.0 0:00.08 zmstat-fd
    1253 root 20 0 72736 6132 2684 S 0 0.0 0:00.24 syslog-ng
    16712 zimbra 20 0 41888 5772 872 S 0 0.0 0:00.00 zmlogger: zmrrd
    17845 postfix 20 0 91272 5616 4304 S 0 0.0 0:00.01 smtpd

    2. set to 60

    3. 6.5G /opt/zimbra/db

  6. #6
    Join Date
    Oct 2012
    Posts
    10
    Rep Power
    3

    Default

    Quote Originally Posted by moetiker View Post
    2. set to 60

    3. 6.5G /opt/zimbra/db
    Hey,

    so first of all you should configure your swappiness to be 0 on zimbra server.

    ##############################
    To change the swappiness value A temporary change (lost on reboot) with a swappiness value of 10 can be made with
    sudo sysctl vm.swappiness=0
    To make a change permanent, edit the configuration file with your favorite editor:
    nano /etc/sysctl.conf
    Search for vm.swappiness and change its value as desired. If vm.swappiness does not exist, add it to the end of the file like so:
    vm.swappiness=0
    ##############################

    More on this can be found at this ubuntu website.

    With swappiness 0 your server won't be swapping unless it's absolutely necessary.

    This should improve performance. If your server will continue swapping Mysql then your users will probably experience lag.. more or less.

    N.

  7. #7
    Join Date
    Nov 2006
    Location
    Olten, Switzerland
    Posts
    82
    Rep Power
    9

    Default

    thanks, I changed the setting.

Similar Threads

  1. Replies: 0
    Last Post: 08-01-2012, 07:55 AM
  2. Replies: 5
    Last Post: 03-31-2010, 01:30 PM
  3. slowdown/swapping unresponsiveness
    By jwilke in forum Administrators
    Replies: 1
    Last Post: 01-15-2009, 10:29 AM
  4. Replies: 1
    Last Post: 11-07-2008, 11:05 AM
  5. Swapping out 32bit java for 64 bit java
    By jnetman1 in forum Installation
    Replies: 1
    Last Post: 04-25-2006, 11:32 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •