From owner-freebsd-performance@FreeBSD.ORG Tue Dec 6 10:00:04 2005 Return-Path: X-Original-To: performance@freebsd.org Delivered-To: freebsd-performance@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4500816A41F; Tue, 6 Dec 2005 10:00:04 +0000 (GMT) (envelope-from mv@roq.com) Received: from vault.mel.jumbuck.com (ppp166-27.static.internode.on.net [150.101.166.27]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8140E43D60; Tue, 6 Dec 2005 10:00:03 +0000 (GMT) (envelope-from mv@roq.com) Received: from vault.mel.jumbuck.com (localhost [127.0.0.1]) by vault.mel.jumbuck.com (Postfix) with ESMTP id 6C0198A035; Tue, 6 Dec 2005 20:59:57 +1100 (EST) Received: from [192.168.46.52] (unknown [192.168.46.250]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by vault.mel.jumbuck.com (Postfix) with ESMTP id 4FF1D8A014; Tue, 6 Dec 2005 20:59:57 +1100 (EST) Message-ID: <43956122.5020106@roq.com> Date: Tue, 06 Dec 2005 21:00:02 +1100 From: Michael Vince User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.7.12) Gecko/20051202 X-Accept-Language: en-us, en MIME-Version: 1.0 To: freebsd-java@FreeBSD.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV using ClamSMTP Cc: performance@freebsd.org, freebsd-threads@FreeBSD.org Subject: More threads X-BeenThere: freebsd-performance@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Performance/tuning List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Dec 2005 10:00:04 -0000 Hi All, I been benchmarking a Java servlet I have created and I want to be able to handle a massive amount of simultaneous connections. So far using benchmarking tools I have been able to get around 2,565 threads on the Tomcat 5.5 Java process (with native 1.4.2 Java) according to ps -auxwH | grep -c 'java' But I just can't seem to get past that mark, I have a lot of memory currently the Tomcat is allocated 2gigs of memory. When I max it out with my benchmarks I get this in catalina Tomcat 5.5 but there is still plenty of free memory to the Tomcat process. SEVERE: Caught exception (java.lang.OutOfMemoryError: unable to create new native thread) executing org.apache.jk.common.SocketAcceptor@f36e59, terminatingthread I have been testing with my libmap.conf with these different types of implementations. [/usr/local/jdk1.4.2/] #libpthread.so libc_r.so #libpthread.so.2 libc_r.so.6 libpthread.so.2 libthr.so.2 libpthread.so libthr.so libc_r.so.6 libthr.so.2 libc_r.so libthr.so I have been getting the best performance with libthr and have been using the above libthr and with these settings below. I have set my max_threads in /etc/sysctl.conf to a massive amount. kern.threads.max_threads_per_proc=40000 kern.threads.max_groups_per_proc=40000 ps -auxwH | grep -c 'java' 2565 I am using Apache2.2 with the new built in AJP module which has been a great addition to Apache 2.2. I have been able to get the setup performing most stable (no 503 status errors) but with less performance / threads with the libmap.conf below. [/usr/local/jdk1.4.2/] libpthread.so libc_r.so libpthread.so.2 libc_r.so.6 I am on 6.0 Release i386, dual Intel P4, generic SMP kernel. With Tomcat on Windows XP I have been able to get it running better. Does any one know of some other sysctls that increase the amount of threads in libthr which I am assuming utilizes the above sysctls. Does any one know how many threads can be created in Java on FreeBSD? Cheers, Mike