WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: TC 4.2 + Samba - RAM usage & CPU stall  (Read 16094 times)

Offline Kenavru

  • Newbie
  • *
  • Posts: 10
TC 4.2 + Samba - RAM usage & CPU stall
« on: January 04, 2012, 06:33:56 PM »
Hi,
I'm using TC on thin client Igel2110 (x86 VIA C7 & CN700 ) with 256/512 MB of RAM and 128MB CF - as a NAS server.
Previously I had Debian 8.0.3 - Worked fine but it was too large & had tooo long BootUP.

Now on TC4.2 I have strange problem with Samba3 & LAN transfer - It works but every transfered MB stays in RAM in process (/usr/local/sbin/smbd -D)
Quote
Mem: 240588K used, 3728K free, 0K shrd, 3264K buff, 218448K cached
CPU0:  1.7% usr 13.0% sys  0.0% nic 81.0% idle  0.0% io  0.0% irq  4.1% sirq
Load average: 0.15 0.06 0.05 2/55 853
  PID  PPID USER     STAT   VSZ %VSZ CPU %CPU COMMAND
  849   811 nobody   S    10792  4.4   0 12.0 /usr/local/sbin/smbd -D
and when amout of free RAM drops to ~4MB I receive (or NOT - just system freeze)
Quote
INFO: rcu_sched_state detected stall on CPU
& PC is not responsive ...

What to do ?
How to disable this data caching ?

I have no SWAP partition - TC creates by def. RAMdisk and mounts it as swap.
PC is connected to USB HDD 1TB Ext4.
There is nothin else installed - just core & samba3

ps. Sorry for my english  - its not my native language :)
« Last Edit: January 04, 2012, 06:49:03 PM by Kenavru »

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: TC 4.2 + Samba - RAM usage & CPU stall
« Reply #1 on: January 04, 2012, 06:48:56 PM »

Offline Kenavru

  • Newbie
  • *
  • Posts: 10
Re: TC 4.2 + Samba - RAM usage & CPU stall
« Reply #2 on: January 04, 2012, 06:54:53 PM »
I know that ;)
but its not fine ;)
I cannot transfer via LAN file/files larger than my RAM becouse system freeze :)

Online Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11705
Re: TC 4.2 + Samba - RAM usage & CPU stall
« Reply #3 on: January 04, 2012, 06:59:47 PM »
Hi Kenavru
Most of the Tinycore directory structure resides in RAM. It sounds like you mapped your share into
RAM. What is the path you told Samba to share?

Offline Kenavru

  • Newbie
  • *
  • Posts: 10
Re: TC 4.2 + Samba - RAM usage & CPU stall
« Reply #4 on: January 04, 2012, 07:21:33 PM »
/mnt
Becouse I wonna share every pendrive/usbHDD that's pluged in :)

Online Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11705
Re: TC 4.2 + Samba - RAM usage & CPU stall
« Reply #5 on: January 04, 2012, 07:28:00 PM »
Hi Kenavru
If you save stuff to /mnt you are saving to RAM. If, for example, you save to /mnt/sdb1 AND you have
a pen drive mounted there, you will save to the pen drive.

Offline Kenavru

  • Newbie
  • *
  • Posts: 10
Re: TC 4.2 + Samba - RAM usage & CPU stall
« Reply #6 on: January 04, 2012, 07:37:30 PM »
ofc I'm saving only to mounted drive :)
But I have the same problem while I read data from disk, for example, watching shared Films on another PC on lan.
So it doesn't matter if I read or write ...

edit:
re-mounting drive makes RAM free ...
if I have 10MB before umount, after I have ~200MB.
While free ram <=4088kB - system freezes, cpu stall (I where watching ram using 'top' program while coping files)
« Last Edit: January 04, 2012, 08:17:57 PM by Kenavru »

Online Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11705
Re: TC 4.2 + Samba - RAM usage & CPU stall
« Reply #7 on: January 04, 2012, 08:48:16 PM »
Hi Kenavru
So you are sharing /mnt so that you an access all drives through one share point, correct?
If you set up your shares as /mnt/hda1, /mnt/sdc1, etc., do you still have memory problems?

Offline Kenavru

  • Newbie
  • *
  • Posts: 10
Re: TC 4.2 + Samba - RAM usage & CPU stall
« Reply #8 on: January 04, 2012, 09:43:34 PM »
Hi Kenavru
So you are sharing /mnt so that you an access all drives through one share point, correct?
correct :)
Quote
If you set up your shares as /mnt/hda1, /mnt/sdc1, etc., do you still have memory problems?
Yes, still the same problem - wherever I mount the drive / or set sharing dir. - there is no difference :(
I tried mounting with sync flag - no change ...
Linux eat's my RAM to the death :D

Online Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11705
Re: TC 4.2 + Samba - RAM usage & CPU stall
« Reply #9 on: January 04, 2012, 11:24:32 PM »
Hi Kenavru
What you are seeing is not normal behavior. I'm running a Samba server under TC2.1, Samba Ver. 3.4.5,
256Mb, Pentium MMX 233Mhz. This is what top displays on that machine as I download a 427Mb file
from it. Download time=100Secs.
Code: [Select]
Mem: 251748K used, 3764K free, 0K shrd, 1752K buff, 223104K cached
CPU: 12.9% usr 43.0% sys  0.0% nic  9.0% idle  0.0% io  5.5% irq 29.4% sirq
Load average: 0.49 0.12 0.04 2/70 10036
  PID  PPID USER     STAT   VSZ %MEM CPU %CPU COMMAND
 9630  1596 nobody   R     8796  3.4   0 88.4 /usr/local/sbin/smbd -D
   17     2 root     SW<      0  0.0   0  0.9 [kswapd0]
10016  1953 tc       R     2296  0.9   0  0.5 top
 1952  1550 root     S     2196  0.8   0  0.5 /usr/bin/dropbear -w -g -b /etc/dr
 6380  1596 root     S     9140  3.5   0  0.0 /usr/local/sbin/smbd -D
 1596     1 root     S     8724  3.4   0  0.0 /usr/local/sbin/smbd -D
 1605  1596 root     S     8724  3.4   0  0.0 /usr/local/sbin/smbd -D
 1588     1 root     S     4440  1.7   0  0.0 /usr/local/sbin/nmbd -D
 1574     1 root     S     4264  1.6   0  0.0 Xvesa -br -screen 1024x768x32 -sha
You might want to consider trying an older version of Tinycore. The 3.x series still use Samba 3.4.5.
It's possible the version of Samba (3.6.1) you are running is not as "memory friendly". Or it could be
the new kernel interacting badly with Samba.


Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: TC 4.2 + Samba - RAM usage & CPU stall
« Reply #10 on: January 05, 2012, 12:39:05 AM »
Are you using a user space filesystem such as ntfs-3g?

Offline Kenavru

  • Newbie
  • *
  • Posts: 10
Re: TC 4.2 + Samba - RAM usage & CPU stall
« Reply #11 on: January 05, 2012, 09:08:34 AM »
nope, shared HDD has Ext4, CF card with OS -ext2.

I'm testing TC3.8.4 + samba3 3.4.5
Looks like everything works fine .. I already downloaded 10GB and works fine ...

 

Online Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11705
Re: TC 4.2 + Samba - RAM usage & CPU stall
« Reply #12 on: January 05, 2012, 11:28:44 AM »
Hi Kenavru
Glad to hear it's working.
Quote
Linux eat's my RAM to the death
The link gerald_clark provided is spot on. Linux tries to maximize the use of available system memory,
doling it out and swapping it as required. If an application keeps requesting memory without ever
freeing any, eventually the system will slow down and become sluggish, possibly even freezing.
I've noticed that Opera10 exhibits this behavior. Over time, it gets to a point where it consumes
90% of my 512Mb RAM, slowing my system down to a crawl, and I have to stop and restart it. This
type of behavior tends to be the exception and not the rule, as most apps are not that selfish.

Offline Kenavru

  • Newbie
  • *
  • Posts: 10
Re: TC 4.2 + Samba - RAM usage & CPU stall
« Reply #13 on: January 05, 2012, 05:59:09 PM »
Thanks for help :)
Looks like everything works fine now on TC 3.84
« Last Edit: January 05, 2012, 08:30:45 PM by Kenavru »

Offline remus

  • Sr. Member
  • ****
  • Posts: 371
Re: TC 4.2 + Samba - RAM usage & CPU stall
« Reply #14 on: January 15, 2012, 02:32:52 AM »
I've done some testing on this issue.

TC 4.1 + Samba 3.4.5 - locks up tinycore on large file transfer

TC 4.1 + Samba 3.6.1 - locks up tinycore on large file transfer

TC 3.8.4 + Samba 3.4.5 - works fine
Live long and prosper.