change notify timeout Performance issue

David Collier-Brown davecb at canada.sun.com
Wed Feb 9 14:48:32 GMT 2000


You wrote:
| Home server CPU usage went from 50% with 15% wait IO to 80% with 
| 15% wait IO, Application server CPU went from 10% with 5% wait IO 
| to 60% with 5% wait IO.
| 
| The configuration did not change much between versions of Samba and 
| by using truss (system call tracer) it was clear that directory 
| stating was taking place every 60 seconds.
[rest snipped]

	Hmmn: the code is non-trivial, and it uses one of
	the slowest parts of the fast file system (and
	it's variants), plus has to enquire of all the files
	in the directory in order to get their file-changed times.

	I can't speak to the requirements, as I don't grok NT,
	but I'm suspicious about the degree to which NT is asking
	for notification...

	In particular I wonder if notify is meaningfull on a read-only
	share: looking at the code in nttrans.c  	
	process_pending_change_notify_queue() and friends, it looks
	as if it could skip all the work on a read-only share.  This
	would address a chunk of the application-server load,
	commensurate with the number of users mounting it read-only
	versus read-write.

	I do think we should be able to set change notify timeout to
	a distinguished value to make Samba skip the change notify.
	It's also used in process.c setup_select_timeout() to set 
	the timeout for the select, which will need an edit as well:
	perhaps something like

static int setup_select_timeout(void)
{
  int change_notify_timeout = lp_change_notify_timeout();
  ...
  select_timeout = MIN(
    select_timeout? select_timeout * 1000: INT_MAX, 
    change_notify_timeout);
  ...

	which would make 0 mean "infinite timeout"

--dave
--
David Collier-Brown,  | Always do right. This will gratify some people
185 Ellerslie Ave.,   | and astonish the rest.        -- Mark Twain
Willowdale, Ontario   | //www.oreilly.com/catalog/samba/author.html
Work: (905) 415-2849 Home: (416) 223-8968 Email: davecb at canada.sun.com


More information about the samba mailing list