Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Tomcat Multi-Threading

Reply
Thread Tools

Tomcat Multi-Threading

 
 
zigzagdna@yahoo.com
Guest
Posts: n/a
 
      01-30-2013
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 CPUs to box, it should improve performance because different CPUs canrun different threads? Is my assumption correct?

I know some applications are single threaded, so adding more CPUs does not really help, but in case of Tomcat, it should improve the performance.
 
Reply With Quote
 
 
 
 
Arne Vajhj
Guest
Posts: n/a
 
      01-30-2013
On 1/29/2013 8:59 PM, http://www.velocityreviews.com/forums/(E-Mail Removed) 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 CPUs to box, it should improve performance
> because different CPUs can run different threads? Is my assumption
> correct?


If the CPU is the bottleneck then yes.

Arne

 
Reply With Quote
 
 
 
 
Lew
Guest
Posts: n/a
 
      01-30-2013
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 CPUs [sic] to box, it should improve performance because different CPUs 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 CPUs [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
 
Reply With Quote
 
Arne Vajhj
Guest
Posts: n/a
 
      01-30-2013
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


 
Reply With Quote
 
zigzagdna@yahoo.com
Guest
Posts: n/a
 
      01-30-2013
On Tuesday, January 29, 2013 9:21:48 PM UTC-5, Arne Vajhj wrote:


Arne:
Thanks a lot.
 
Reply With Quote
 
Lew
Guest
Posts: n/a
 
      01-30-2013
Arne Vajhj 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
 
Reply With Quote
 
Magnus Warker
Guest
Posts: n/a
 
      01-30-2013
On 01/30/2013 03:39 AM, Arne Vajhj 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


 
Reply With Quote
 
Lew
Guest
Posts: n/a
 
      01-30-2013
Magnus Warker wrote:
> Arne Vajhj 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
 
Reply With Quote
 
Magnus Warker
Guest
Posts: n/a
 
      01-30-2013
On 01/30/2013 05:28 PM, Lew wrote:
> Magnus Warker wrote:
>> Arne Vajhj 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

 
Reply With Quote
 
jlp
Guest
Posts: n/a
 
      01-30-2013
Le 30/01/2013 18:04, Magnus Warker a crit :
> On 01/30/2013 05:28 PM, Lew wrote:
>> Magnus Warker wrote:
>>> Arne Vajhj 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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Which JVM to use for Tomcat 5.0.28 and Tomcat 5.5.4? Katerina McLean Java 1 12-10-2004 10:55 PM
Tomcat 4.1.31 - huge count of webapps, Tomcat hangs up Martin Eberle Java 2 12-03-2004 07:10 PM
Tomcat Web application manager - Virtual host Tomcat 4.30 + Apache2 + JK2 connector with multi IPs Joe Java 0 07-12-2004 03:06 PM
Apache Tomcat 4.1.24: problem with Tomcat Administration link Christos Gravvanis Java 0 07-07-2004 05:21 PM
[TOMCAT] Tomcat crashes %=zerointeractive.it% Java 1 01-22-2004 12:08 PM



Advertisments