[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: threads and concurrency

Omer Faruk SEN wrote:
Hi ,

I have and ldap server (openldap-2.4.23 ) in slapd.conf I set

concurrency  8192
threads 256

but when I do top -b  -H -d 2  -p 25560  I always see 8 threads ( show
9 slapd instances)  not more even if I instruct to create 256 threads.
  Is there anything that I miss?

Additionally what is the releation of threads and concurrency. Is
there any calculation method that I must obey?

concurrency generally does nothing on most platforms. I believe it might have had an effect on old Solaris systems with their lwp library. You didn't mention what OS you're using so it's impossible to tell you if this directive has any relevance for you. Most likely not.

The threads setting tells the maximum number of threads slapd will spawn. It creates them on demand, not all at once. If you want to see 256 threads then you have to submit enough requests to make the server busy enough to actually use them.

Keep in mind that each thread uses a thread stack of 4MB on 32 bit systems, 8MB on 64 bit systems. So you're looking at 1-2GB of RAM dedicated to the threads with a setting like this. Make sure you don't configure more threads than you have RAM for...
  -- Howard Chu
  CTO, Symas Corp.           http://www.symas.com
  Director, Highland Sun     http://highlandsun.com/hyc/
  Chief Architect, OpenLDAP  http://www.openldap.org/project/