Operating System - HP-UX
1823726 Members
3597 Online
109664 Solutions
New Discussion юеВ

High consumption of CPU by samba

 

High consumption of CPU by samba

Hello to all.

I don't know if the present behavior of samba is correct. At the moment the daemon samba in my server is consuming a high percentage of CPU (an average of 45%). I have two server rp5470 in cluster whit serviceguard, HP-UX 11.11 and the samba version is 2.2.8a based HP CIFS Server A.01.10.

The exit of top is:

System:asuccs41 Tue Oct 25 15:30:11 2005
Load averages: 0.89, 0.68, 0.71
182 processes: 156 sleeping, 26 running
Cpu states:
CPU LOAD USER NICE SYS IDLE BLOCK SWAIT INTR SSYS
0 1.21 27.3% 32.9% 16.3% 23.5% 0.0% 0.0% 0.0% 0.0%
1 0.57 21.9% 44.7% 13.3% 20.1% 0.0% 0.0% 0.0% 0.0%
--- ---- ----- ----- ----- ----- ----- ----- ----- -----
avg 0.89 24.7% 38.8% 14.7% 21.9% 0.0% 0.0% 0.0% 0.0%

Memory: 2610844K (1915348K) real, 3383496K (2512508K) virtual, 3913724K free Page# 1/17

CPU TTY PID USERNAME PRI NI SIZE RES STATE TIME %WCPU %CPU COMMAND
1 ? 22210 root 228 20 6752K 2412K run 47:45 48.09 48.00 smbd
0 ? 27950 oracle 241 22 274M 19688K run 0:04 44.30 17.43 oracleip12
1 ? 25481 oracle 149 20 1602M 18472K sleep 15:29 8.51 8.50 oracleip10

I attach file with the information of smb.conf and testparm

It is the this normal behavior of this daemon? or I need to optimize some parameter?

Thanks and regards
9 REPLIES 9
Geoff Wild
Honored Contributor

Re: High consumption of CPU by samba

Try setting:

winbind enum users = No
winbind enum groups = No

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Steven E. Protter
Exalted Contributor

Re: High consumption of CPU by samba

Couple of thoughts:

If you have a lot of samba users then the CPU ussage you report is not necessarily a problem.

A better question to ask, is does the system exhibit any symptoms. Is the response of other applications, particularly oracle a problem? If not, stop find something more fun to do. :-)

I have an HP-UX Samba server right in my home office here and Samba is idling away at 1% of CPU time and mostly sleeps. But I use samba for sharing documents here a few movies and its not being taxed very hard. If you have more users, then it may not be a problem.

Here are some tools.

/opt/samba/bin/smbstatus

This has many useful options and can help you figure out if you reallly have a problem.

I'm using Samba 3 from HP, depot, and they did make some nice improvements to it including performance. You might want to consider this.

To get a good snapshot of your system, try this tool:
http://www.hpux.ws/system.perf.sh

It's a background resource monitor for HP-UX and you can set the data collection period any way you wish.

Let us know what you find.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com

Re: High consumption of CPU by samba

Hi,

Geoff, a have a question, you could indicate to me so that they are these variables and where I set this, in smb.conf?.

Steven, my server don't have any symptoms, single CPU tips appear, but my database and application work well, but during the tips certain delay in the processing of archives appears.

asuccs41:/tmp> smbstatus
No path in service printers - using /tmp

Samba version 2.2.8a based HP CIFS Server A.01.10
Service uid gid pid machine
----------------------------------------------
data cce scs 8754 aswccs32 (172.xx.xx.xx) Tue Oct 25 18:26:34 2005
data cce scs 8754 aswccs32 (172.xx.xx.xx) Tue Oct 25 18:23:56 2005
data cce scs 8754 aswccs32 (172.xx.xx.xx) Tue Oct 25 18:23:59 2005
data clcce1 scs 8754 aswccs32 (172.xx.xx.xx) Wed Oct 26 15:00:33 2005

No locked files

Today I detected, whith the truss command, that the daemon smbd reviews the status of the directories of continuous way. I atach file whit exit of truss.

Thanks
Steven E. Protter
Exalted Contributor

Re: High consumption of CPU by samba

The behavior seems random and somewhat pointless.

Scanning the smb.conf file I see no way to change this behavior.

I can only assume this is a bug that may be solved with a newer update of Samba.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Steven E. Protter
Exalted Contributor

Re: High consumption of CPU by samba

I would also note if I could control my mouse that Oracle does not officially support running the database on a Samba filesystem.

We do that on some Linux Systems at work, but if the data is sitting on a Samba share this could trigger the behavior.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Alzhy
Honored Contributor

Re: High consumption of CPU by samba

Geronimo,

If you encounter this "problem" once more - do a :

/opt/samba/bin/smbstatus

And check the number of users, open files, locked files, etc. This should give you an idea of how busy your samba subsystem is. Maybe you have clients that are doing pretty heavy I/O on your samba shares..

And as long as your samba clients are happy - then your CPU utilisation should be okay.

Hakuna Matata.
Geoff Wild
Honored Contributor

Re: High consumption of CPU by samba

Sorry - those settings go into the global section.

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Alzhy
Honored Contributor

Re: High consumption of CPU by samba

I missed you've already done an smbstatus. But your truss of the smbd process is interesting indeed.

Have you checked if there is something wrong with the filesystem where your SAMBA share (data?) resides? If you're using OnlineJFS (3.3 or 3.5) do you have the critical patches applied?

Also, does your share contain zillions of files? What does sar tell you about your caches - buffer and inodes?

Hakuna Matata.
eric roseme
Respected Contributor

Re: High consumption of CPU by samba

Hi Geronimo,

Regarding your statement that smbd checks the share "in a continuous way" - you have "change notify timeout" set at 240 (4 minutes). So smbd will enumerate your entire share every 4 minutes. If it has many files (possible with a DB), this will result in high CPU usage. With your DB application, you can possibly set this very high without problems.

Also, if you are doing DB access where your fileset access is being adminstered by the application, then you can turn off locking. This could potentially save a lot of disk hits on the locking tdb. (make sure Oracle is okay with this)

Finally, you could help yourself a lot by upgrading to A.02.@ (Samba 3.0). tdb efficiency has been increased a lot here. Also, if the migration to Samba 3.0 is too much to do now, at the very least you should be on A.01.11.04 (Samba 2.2.12).

Eric Roseme