05-11-2011
2,
0
Join Date: May 2011
Last Activity: 24 January 2012, 3:18 AM EST
Posts: 2
Thanks Given: 0
Thanked 0 Times in 0 Posts
Samba trouble shoot / workaround ?
Hello,
I've setup a ubuntu 10.04 server running samba 3.4.7 as domain controler / file server at a customer site, that works great most of the time but I face a random problem. Of course I'm never on the site when the problem occurs, so I cannot investigate in real time.
What happens is that one smb process is taking ~100% cpu time and keep opened files locked. I did not figure out how this occurs, so I would need to setup some higher debugging level in the samba log. However I'm pretty sure the problem is caused by the windows machines running a cad software (Solidworks) that create lots of temporary files that should be deleted when the assembly files are properly closed, however it seems it does not always properly close those files (and moreover the CAD softwares tends to crash regularly accoding to the customer, but nothing to do with samba, same things happens with windows file servers).
So what does it cause on the samba server : the load averrage is 1.0 or above, with one particular smb process using ~100% cpu time, and the process owner is "root" instead of the samba user that opened the files...
So far the only solution is to kill the "hung" process and delete all the messy temp files.
Since I will not be on this site in the near future to investigate this more in details, I was thinking o a script that would monitor the avg load, if the avg load is 1 or above, would try to identify the smb process causing the heavy load (based on owner = "root" and cpu time > threshould value) and kill it (kill -15 and kill -9 if the kill -15 fails after a timeout of lets say 1 minute).
I know the best solution would be to fix the root cause of the problem, but as I said I will not have time to investigate in the near future, so a workaround is needed.
I found various scripts, to monitor the avg load, some to kill a process, but I'm not sure how to properly identify the "hung" smb process. (there could be several of them and the cpu usage is of course depending of other running processes).
By the way if anyone has already faced a similar issue with samba, any advise would be appreciated.
Last edited by Manu.b; 05-11-2011 at 12:35 PM..