Hello,
I am running ubuntu 14.04 in a server with 32GB ram.
Due to receiving "high load" errors during ssh connection, I took a look at what's happening from command line. I detected that 20GB of total memory was allocated to a program.
Below you can see some initial part of installation script. As I believed this issue is not classified as shell scripting issue, I opened the thread under "general & beginners" field. Hope I am right.
#!/bin/sh
chmod 777 *.*
chmod 777 *
echo 2062780 > /proc/sys/kernel/threads-max
if ! cat /etc/sysctl.conf | grep -v grep | grep -c 1677721600 > /dev/null; then
echo 'net.core.wmem_max= 1677721600' >> /etc/sysctl.conf
echo 'net.core.rmem_max= 1677721600' >> /etc/sysctl.conf
echo 'net.ipv4.tcp_rmem= 1024000 8738000 1677721600' >> /etc/sysctl.conf
echo 'net.ipv4.tcp_wmem= 1024000 8738000 1677721600' >> /etc/sysctl.conf
echo 'net.ipv4.udp_mem =1024000 8738000 1677721600' >> /etc/sysctl.conf
echo 'net.ipv4.tcp_window_scaling = 1' >> /etc/sysctl.conf
echo 'net.ipv4.tcp_timestamps = 1' >> /etc/sysctl.conf
echo 'net.ipv4.tcp_sack = 1' >> /etc/sysctl.conf
echo 'net.ipv4.tcp_no_metrics_save = 1' >> /etc/sysctl.conf
echo 'net.core.netdev_max_backlog = 5000' >> /etc/sysctl.conf
echo 'net.ipv4.route.flush=1' >> /etc/sysctl.conf
echo 'fs.file-max=65536' >> /etc/sysctl.conf
sysctl -p
fi
#...
#..
#.
#the rest of the code is related to installation of the application
Do you think that when I change "2062780" to half of the value, could it be the solution and what about other values? I believe 1031390 memory is enough for this application as it was not much busy.
free -m
total used free shared buffers cached
Mem: 31882 30995 887 8 263 19988
-/+ buffers/cache: 10742 21139
Swap: 4093 0 4093
cat /proc/meminfo
MemTotal: 32648164 kB
MemFree: 267172 kB
MemAvailable: 21145252 kB
Buffers: 270424 kB
Cached: 20632720 kB
SwapCached: 0 kB
Active: 14189768 kB
Inactive: 16692520 kB
Active(anon): 8927760 kB
Inactive(anon): 1063128 kB
Active(file): 5262008 kB
Inactive(file): 15629392 kB
Unevictable: 9548 kB
Mlocked: 9548 kB
SwapTotal: 4192248 kB
SwapFree: 4192248 kB
Dirty: 3240844 kB
Writeback: 178960 kB
AnonPages: 9969652 kB
Mapped: 67196 kB
Shmem: 8300 kB
Slab: 526704 kB
SReclaimable: 454312 kB
SUnreclaim: 72392 kB
KernelStack: 14784 kB
PageTables: 38632 kB
NFS_Unstable: 0 kB
Bounce: 0 kB
WritebackTmp: 0 kB
CommitLimit: 20516328 kB
Committed_AS: 11570060 kB
VmallocTotal: 34359738367 kB
VmallocUsed: 0 kB
VmallocChunk: 0 kB
HardwareCorrupted: 0 kB
AnonHugePages: 5294080 kB
ShmemHugePages: 0 kB
ShmemPmdMapped: 0 kB
HugePages_Total: 0
HugePages_Free: 0
HugePages_Rsvd: 0
HugePages_Surp: 0
Hugepagesize: 2048 kB
DirectMap4k: 14560 kB
DirectMap2M: 2772992 kB
DirectMap1G: 30408704 kB
My /etc/sysctl.conf
file:
net.core.somaxconn = 65535
net.ipv4.route.flush=1
net.ipv4.tcp_no_metrics_save=1
net.ipv4.tcp_moderate_rcvbuf = 1
fs.file-max = 6815744
fs.aio-max-nr = 6815744
fs.nr_open = 6815744
net.ipv4.ip_local_port_range = 1024 65000
net.ipv4.tcp_sack = 1
net.ipv4.tcp_rmem = 10000000 10000000 10000000
net.ipv4.tcp_wmem = 10000000 10000000 10000000
net.ipv4.tcp_mem = 10000000 10000000 10000000
net.core.rmem_max = 524287
net.core.wmem_max = 524287
net.core.rmem_default = 524287
net.core.wmem_default = 524287
net.core.optmem_max = 524287
net.core.netdev_max_backlog = 300000
net.ipv4.tcp_max_syn_backlog = 300000
net.netfilter.nf_conntrack_max=1215196608
net.ipv4.tcp_window_scaling = 1
vm.max_map_count = 655300
net.ipv4.tcp_max_tw_buckets = 1440000
kernel.shmmax=134217728
kernel.shmall=134217728
net.core.wmem_max= 1677721600
net.core.rmem_max= 1677721600
net.ipv4.tcp_rmem= 1024000 8738000 1677721600
net.ipv4.tcp_wmem= 1024000 8738000 1677721600
net.ipv4.tcp_window_scaling = 1
net.ipv4.tcp_timestamps = 1
net.ipv4.tcp_sack = 1
net.ipv4.tcp_no_metrics_save = 1
net.core.netdev_max_backlog = 5000
net.ipv4.route.flush=1
fs.file-max=65536
I'd appreciate your comments.
Thank you
Boris