Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Java (http://www.velocityreviews.com/forums/f30-java.html)
-   -   Tomcat Multi-Threading (http://www.velocityreviews.com/forums/t957068-tomcat-multi-threading.html)

zigzagdna@yahoo.com 01-30-2013 01:59 AM

Tomcat Multi-Threading
 
I am using Apache Tomcat 6.x on a Windows 2003 Server R2. I can see Apache Tomcat is a multithreaded applications, no of threads arrange from 50 to 300. Since it is a multithreaded application, I am assuming that if add more CPU’s to box, it should improve performance because different CPU’s canrun different threads? Is my assumption correct?

I know some applications are single threaded, so adding more CPU’s does not really help, but in case of Tomcat, it should improve the performance.

Arne Vajhøj 01-30-2013 02:21 AM

Re: Tomcat Multi-Threading
 
On 1/29/2013 8:59 PM, zigzagdna@yahoo.com wrote:
> I am using Apache Tomcat 6.x on a Windows 2003 Server R2. I can see
> Apache Tomcat is a multithreaded applications, no of threads arrange
> from 50 to 300. Since it is a multithreaded application, I am
> assuming that if add more CPU’s to box, it should improve performance
> because different CPU’s can run different threads? Is my assumption
> correct?


If the CPU is the bottleneck then yes.

Arne


Lew 01-30-2013 02:31 AM

Re: Tomcat Multi-Threading
 
zigz...@ wrote:
> I am using Apache Tomcat 6.x on a Windows 2003 Server R2. I can see Apache Tomcat is a multithreaded applications, no of threads arrange from 50 to 300. Since it is a multithreaded application, I am assuming that if add more CPU’s [sic] to box, it should improve performance because different CPU’s can run different threads? Is my assumption correct?


Only testing will tell.

Whenever it's an assumption it's probably false.

> I know some applications are single threaded, so adding more CPU’s [sic] does not really help, but in case of Tomcat, it should improve the performance.


It "should"?

That's a strong statement given you have no evidence.

In the world of Java, no applications are single threaded.

--
Lew

Arne Vajhøj 01-30-2013 02:39 AM

Re: Tomcat Multi-Threading
 
On 1/29/2013 9:31 PM, Lew wrote:
> In the world of Java, no applications are single threaded.


I think most people would consider a console app with no
threads to be single-threaded. Whether the JVM uses some
threads behind the scene for various purposes is a JVM
implementation detail.

Arne



zigzagdna@yahoo.com 01-30-2013 03:48 AM

Re: Tomcat Multi-Threading
 
On Tuesday, January 29, 2013 9:21:48 PM UTC-5, Arne Vajhøj wrote:


Arne:
Thanks a lot.

Lew 01-30-2013 06:54 AM

Re: Tomcat Multi-Threading
 
Arne Vajhøj wrote:
> Lew wrote:
>> In the world of Java, no applications are single threaded.

>
> I think most people would consider a console app with no
> threads to be single-threaded. Whether the JVM uses some
> threads behind the scene for various purposes is a JVM
> implementation detail.


A detail that is directly relevant to the OP's question about whether
multiple CPUs would enhance performance!

This is one scenario where you cannot merely wave your hands and pretend
the console app is single threaded, because if multiple CPUs do help performance
of multi-threaded Java programs, then they'll help that app, too.

In your rush to disagree you threw out the baby with the bath water.

--
Lew

Magnus Warker 01-30-2013 08:34 AM

Re: Tomcat Multi-Threading
 
On 01/30/2013 03:39 AM, Arne Vajhøj wrote:
> On 1/29/2013 9:31 PM, Lew wrote:
>> In the world of Java, no applications are single threaded.

>
> I think most people would consider a console app with no
> threads to be single-threaded.


There is even no relationship between a programming language and the
threading architecture of an application. The fact that Java supports
multi-threading does not lead to the fact that every Java application is
multi-threaded.

Magnus



Lew 01-30-2013 04:28 PM

Re: Tomcat Multi-Threading
 
Magnus Warker wrote:
> Arne Vajhøj wrote:
>> Lew wrote:
>>> In the world of Java, no applications are single threaded.

>> I think most people would consider a console app with no
>> threads to be single-threaded.

>
> There is even no relationship between a programming language and the
> threading architecture of an application. The fact that Java supports
> multi-threading does not lead to the fact that every Java application is
> multi-threaded.


No, the first fact does not lead to the second fact, but the second fact isnevertheless true.

The JVM is multi-threaded and has, what, a minimum of four? at any rate severa; threads running
even if the application only uses one of them.

Do a little research.

--
Lew

Magnus Warker 01-30-2013 05:04 PM

Re: Tomcat Multi-Threading
 
On 01/30/2013 05:28 PM, Lew wrote:
> Magnus Warker wrote:
>> Arne Vajhøj wrote:
>>> Lew wrote:
>>>> In the world of Java, no applications are single threaded.
>>> I think most people would consider a console app with no
>>> threads to be single-threaded.

>>
>> There is even no relationship between a programming language and the
>> threading architecture of an application. The fact that Java supports
>> multi-threading does not lead to the fact that every Java application is
>> multi-threaded.

>
> No, the first fact does not lead to the second fact, but the second fact is nevertheless true.
>
> The JVM is multi-threaded and has, what, a minimum of four? at any rate severa; threads running
> even if the application only uses one of them.


There is a mistake in your logical conclusion: Even if the VM is
multi-threaded, the applications running on top of them may still be
single-threaded. So your statement ("no applications are single
threaded") is simply wrong.

Magnus


jlp 01-30-2013 05:44 PM

Re: Tomcat Multi-Threading
 
Le 30/01/2013 18:04, Magnus Warker a écrit :
> On 01/30/2013 05:28 PM, Lew wrote:
>> Magnus Warker wrote:
>>> Arne Vajhøj wrote:
>>>> Lew wrote:
>>>>> In the world of Java, no applications are single threaded.
>>>> I think most people would consider a console app with no
>>>> threads to be single-threaded.
>>>
>>> There is even no relationship between a programming language and the
>>> threading architecture of an application. The fact that Java supports
>>> multi-threading does not lead to the fact that every Java application is
>>> multi-threaded.

>>
>> No, the first fact does not lead to the second fact, but the second
>> fact is nevertheless true.
>>
>> The JVM is multi-threaded and has, what, a minimum of four? at any
>> rate severa; threads running
>> even if the application only uses one of them.

>
> There is a mistake in your logical conclusion: Even if the VM is
> multi-threaded, the applications running on top of them may still be
> single-threaded. So your statement ("no applications are single
> threaded") is simply wrong.
>
> Magnus
>

Notice also that the OP talks about Tomcat and not directly a standalone
application.
Tomcat, is a servlet container can handle multiple http/https/AJP
connections with its ThreadPool ( if obviously this pool is not sized to
1). Naturally Web-apps are multi-Threaded.


--
Cordialement
Jean-Louis Pasturel


All times are GMT. The time now is 08:27 AM.

Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57