Author Topic: Samba - High memory usage  (Read 7722 times)

itiab

  • Zen Apprentice
  • *
  • Posts: 5
  • Karma: +2/-0
    • View Profile
Samba - High memory usage
« on: February 29, 2016, 08:58:15 am »
We just installed a new Zentyal server. It has 8Gb of ram, not a huge amount but it is only serving 5 -6 people maximum. On boot up it uses 1.7Gb.

We copied in files from the old server and had long pauses and I tracked the issue down to the Zentyal server. It had a top value of 128 , 115, 87  and no those are not typos - the load was 128.0 current, 115.0 5 minutes and 87.0 in the last minute. Memory usage was also through the roof with 7.9Gb ram allocated and swap file / cache in use for over 1Gb of swap.

The major culprit seemed to be samba.

We crashed the server (it was unresponsive), restarted and checked again. Again 1.7Gb on startup. Copied more files and again up to 7.9Gb ram used with some swap in play. Only four people on the server.  I turned off antivirus checking and a few other services. We have had no Top load over 0.5 (this is a 4 Core CPU)

I see from historical posts and bugs Samba and high usage seems to be a recurring theme. We are really not wanting to risk another crash like we saw today. There are a lot of tight deadlines coming up. We do run another Zentyal server (it was commercial but after a couple of appalling lack of support issues with the parent company we decided not to pay them any more). It is on Ubuntu 12.04, 16Gb ram and using 95% of it but runs stable.
 
This version 4.2.2 .

top - 20:49:34 up  4:30,  2 users,  load average: 0.10, 0.09, 0.06
Tasks: 174 total,   1 running, 172 sleeping,   0 stopped,   1 zombie
%Cpu(s):  3.1 us,  1.3 sy,  0.0 ni, 95.3 id,  0.3 wa,  0.0 hi,  0.1 si,  0.0 st
KiB Mem:   8032656 total,  7801008 used,   231648 free,   293580 buffers
KiB Swap: 16485372 total,    43500 used, 16441872 free.  5982484 cached Mem


Is it normal to see many samba threads and 05% of Ram in play?

Cheers
shane

itiab

  • Zen Apprentice
  • *
  • Posts: 5
  • Karma: +2/-0
    • View Profile
Re: Samba - High memory usage
« Reply #1 on: February 29, 2016, 09:28:57 am »
to add to this post. i notice there was a post re a newer Zentyal server hanging with a CPU time  out. We had the same thing which contributed to our crash.

el: [11649.843047] NMI watchdog: BUG: soft lockup - CPU#2 stuck for 22s! [smbd:12328]

Again linked to Samba. Debug in syslog can be provided.


LaM

  • Zen Apprentice
  • *
  • Posts: 41
  • Karma: +0/-0
    • View Profile
Re: Samba - High memory usage
« Reply #2 on: February 29, 2016, 09:29:56 am »
Hi,

check this thread out!

https://forum.zentyal.org/index.php?topic=27362.new;topicseen#new

Which kernel are U running?

L

itiab

  • Zen Apprentice
  • *
  • Posts: 5
  • Karma: +2/-0
    • View Profile
Re: Samba - High memory usage
« Reply #3 on: February 29, 2016, 10:40:08 pm »
I posted in that thread - will check ut what kernel am using but it was the bog standard iso from the latest download.

Samba file shares slow as slow can be and then really quick. disaster for client.

LaM

  • Zen Apprentice
  • *
  • Posts: 41
  • Karma: +0/-0
    • View Profile
Re: Samba - High memory usage
« Reply #4 on: March 01, 2016, 09:36:54 am »
Sorry itiab,

many ppl, haven't read all the names.  :-\ ???
It's a strange behavior...

Can You run htop while copying, checking memory and processors? aaaand plz check kernel, so we can start to exclude things and narrow down the research

L

insigIT

  • Zen Apprentice
  • *
  • Posts: 14
  • Karma: +0/-0
    • View Profile
Re: Samba - High memory usage
« Reply #5 on: March 03, 2016, 03:37:58 pm »
I posted in that thread - will check ut what kernel am using but it was the bog standard iso from the latest download.

Samba file shares slow as slow can be and then really quick. disaster for client.

Are you still having the issues? I am shaving the same issues with a new server install. 8GB Ram and Zentyal is using it all!!

LaM

  • Zen Apprentice
  • *
  • Posts: 41
  • Karma: +0/-0
    • View Profile
Re: Samba - High memory usage
« Reply #6 on: March 03, 2016, 04:14:45 pm »
I posted in that thread - will check ut what kernel am using but it was the bog standard iso from the latest download.

Samba file shares slow as slow can be and then really quick. disaster for client.

Are you still having the issues? I am shaving the same issues with a new server install. 8GB Ram and Zentyal is using it all!!

Which kernel is it running?

insigIT

  • Zen Apprentice
  • *
  • Posts: 14
  • Karma: +0/-0
    • View Profile
Re: Samba - High memory usage
« Reply #7 on: March 03, 2016, 07:03:48 pm »
Kernel = 3.19.0-51-generic

insigIT

  • Zen Apprentice
  • *
  • Posts: 14
  • Karma: +0/-0
    • View Profile
Re: Samba - High memory usage
« Reply #8 on: March 03, 2016, 07:07:26 pm »
Linux version 3.19.0-51-generic (buildd@lgw01-44) (gcc version 4.8.4 (Ubuntu 4.8.4-2ubuntu1~14.04.1) ) #58~14.04.1-Ubuntu SMP

insigIT

  • Zen Apprentice
  • *
  • Posts: 14
  • Karma: +0/-0
    • View Profile
Re: Samba - High memory usage
« Reply #9 on: March 03, 2016, 08:16:49 pm »
See this picture. System was not in use and RAM is soo high.
I then rebooted and you can see it go to the normal 1.62GB.


insigIT

  • Zen Apprentice
  • *
  • Posts: 14
  • Karma: +0/-0
    • View Profile
Re: Samba - High memory usage
« Reply #10 on: March 30, 2016, 05:58:28 pm »
Hi all

Still having this problem. I thought it the problem had been resolved from doing an update last week but again it is very slow on my NEW server.

Anyone have any input for me. Please I need your help.

LaM

  • Zen Apprentice
  • *
  • Posts: 41
  • Karma: +0/-0
    • View Profile
Re: Samba - High memory usage
« Reply #11 on: March 31, 2016, 04:02:17 pm »
Hi insigIT,

plz refer to this thread https://forum.zentyal.org/index.php/topic,27362.new.html#new for further infos.

All kernels from Linux 3.19.0-47-generic (included) are afflicted bye the bug.

desperados

  • Zen Monk
  • **
  • Posts: 64
  • Karma: +4/-0
    • View Profile
Re: Samba - High memory usage
« Reply #12 on: October 06, 2016, 11:37:09 am »
with kernel 3.19.0-69 samba still rise until it fills all memory

segelfreak

  • Zen Monk
  • **
  • Posts: 80
  • Karma: +9/-0
    • View Profile
Re: Samba - High memory usage
« Reply #13 on: October 08, 2016, 11:06:15 am »
Folks,

Could we try to have a better view on this topic, please?
It appears even with kernel 4.4.0-38-generic, RAM is filling up virtually over night using >2GB (on a 3GB usable RAM / 4GB total memory system) and leaving only bit and pieces free. Soon the server tends to become highly unresponsive. Restarting samba module cleans up memory.
I do not want to believe this is strictly kernel related and ignored from the samba community. If this would be a general issue with samba 4 (and/or its AD capabilities), I'm sure it would have been solved already.

This is really getting annoying as it leaves the server unstable and barely usable, but I'm not a samba pro with enough insight to solve this on my own.
Anybody having an idea how to pin this down?
Zentyal 6.1

segelfreak

  • Zen Monk
  • **
  • Posts: 80
  • Karma: +9/-0
    • View Profile
Re: Samba - High memory usage
« Reply #14 on: October 09, 2016, 01:21:20 pm »
Hi insigIT,

plz refer to this thread https://forum.zentyal.org/index.php/topic,27362.new.html#new for further infos.

All kernels from Linux 3.19.0-47-generic (included) are afflicted bye the bug.

I think this is not the same. This issue was about a CPU lock, but it seems solved with newer kernels. I'm using 4.x now and it doesn't happen anymore.
However, this issue here is about the memory being eaten up by the samba process.
Zentyal 6.1