Re: Number of threads per process
From: Gavin Maltby (G_a_v_i_n.M_a_l_t_b_y_at_sun.com)
Date: 01/06/04
- Next message: Raghavendra: "Re: Finding memory leaks through ps command"
- Previous message: Peter Bunclark: "Re: JumpStart with unknown hostname???"
- In reply to: Jon Trygve Utne: "Number of threads per process"
- Next in thread: Casper H.S. ***: "Re: Number of threads per process"
- Reply: Casper H.S. ***: "Re: Number of threads per process"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 06 Jan 2004 13:32:36 +0000
Jon Trygve Utne wrote:
> We have a product from IBM (WebSEAL, part og Tivoli Access Manager)
> running on Solaris 8 2/02 that can only open 479 threads.
> This is a problem, since each incoming connection opens one thread in
> the listening process.
A truss of a failed thread creation attempt would narrow the cause ...
> What limitations are there to the max number of threads per process in
> Solaris? I know that the number of file descriptors is relevant, but
> setting rlim_fd_cur and rlim_fd_max higher doesn't help in this case.
... but's it's likely you're either running out of memory or
(more commonly) running out of virtual memory in a 32-bit
application.
I don't think a file descriptor is used per thread created (I'd
be very surprised). To create the stack for the new thread
(if not preconstructed) some anon memory is mapped, and
(at least in the old libthread) that involves opening
/dev/zero (it wasn't held open). So if you run out of
file descriptors you can not be able to create threads
(since the open of /dev/zero can fail; not sure
how things are done in the newer libthread).
The main limit on the number of threads you can create is
VM space, for a 32-bit application anyway. Only so many
stacks can fit in 32-bits, and each stack normally has
a further 8K guardpage (unmapped, but takes VM space).
When you hit this limit depends on the the stack size
being requested each time. Again a truss will let you
observe this.
Per thr_create and pthread_create manpages, you can also
fail EAGAIN if some other resource limit is reached,
eg number of lwps in a process (
Gavin
- Next message: Raghavendra: "Re: Finding memory leaks through ps command"
- Previous message: Peter Bunclark: "Re: JumpStart with unknown hostname???"
- In reply to: Jon Trygve Utne: "Number of threads per process"
- Next in thread: Casper H.S. ***: "Re: Number of threads per process"
- Reply: Casper H.S. ***: "Re: Number of threads per process"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]