Date: Thu, 18 Aug 2005 13:29:33 -0300 From: "Giovanni P. Tirloni" <gpt@tirloni.org> To: freebsd-threads@freebsd.org Subject: pthread_create: cannot allocate memory Message-ID: <4304B76D.9030205@tirloni.org>
next in thread | raw e-mail | index | archive | help
Hi, I coded a small echo server that creates a thread for every connection it accepts. It works fine and then I decided to test how many threads it could handle so I coded a stress.c client program that'd just create as many connections as I asked without exchanging any data. First I discovered the kern.threads.max_thread_per_proc limit that was limiting it to 1500 threads. So I raised it and the max_group_per_proc to 10k. I also increased the NMBCLUSTERS limit to 65535 just in case. What I've seen is that the server stops at 2400-2410 threads when I ask strees.c to create 8k connections. top shows I still have 150MB of free memory. Where should I look to raise this limit ? This is a CeleronM 1.3GHz and 512MB of RAM. Another behavior was that it creates 130 threads at once, waits, then another 130 more. It varies 1-10 threads sometimes but usually this inverval is constant. I think it might have something to do with the TCP code doing some normal limitation but I've look at it. Thanks, -- Giovanni P. Tirloni / gpt@tirloni.org
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4304B76D.9030205>