Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #21845 > unrolled thread

Tomcat Multi-Threading

Started byzigzagdna@yahoo.com
First post2013-01-29 17:59 -0800
Last post2013-01-30 08:51 +0000
Articles 8 on this page of 28 — 7 participants

Back to article view | Back to comp.lang.java.programmer


Contents

  Tomcat Multi-Threading zigzagdna@yahoo.com - 2013-01-29 17:59 -0800
    Re: Tomcat Multi-Threading Arne Vajhøj <arne@vajhoej.dk> - 2013-01-29 21:21 -0500
      Re: Tomcat Multi-Threading zigzagdna@yahoo.com - 2013-01-29 19:48 -0800
    Re: Tomcat Multi-Threading Lew <lewbloch@gmail.com> - 2013-01-29 18:31 -0800
      Re: Tomcat Multi-Threading Arne Vajhøj <arne@vajhoej.dk> - 2013-01-29 21:39 -0500
        Re: Tomcat Multi-Threading Lew <lewbloch@gmail.com> - 2013-01-29 22:54 -0800
          Re: Tomcat Multi-Threading Arne Vajhøj <arne@vajhoej.dk> - 2013-01-30 22:09 -0500
        Re: Tomcat Multi-Threading Magnus Warker <magnus@mailinator.com> - 2013-01-30 09:34 +0100
          Re: Tomcat Multi-Threading Lew <lewbloch@gmail.com> - 2013-01-30 08:28 -0800
            Re: Tomcat Multi-Threading Magnus Warker <magnus@mailinator.com> - 2013-01-30 18:04 +0100
              Re: Tomcat Multi-Threading jlp <jlp@jlp.com> - 2013-01-30 18:44 +0100
              Re: Tomcat Multi-Threading Lew <lewbloch@gmail.com> - 2013-01-30 09:49 -0800
                Re: Tomcat Multi-Threading Arne Vajhøj <arne@vajhoej.dk> - 2013-01-30 22:17 -0500
                Re: Tomcat Multi-Threading Magnus Warker <magnus@mailinator.com> - 2013-02-01 18:33 +0100
                  Re: Tomcat Multi-Threading Lew <lewbloch@gmail.com> - 2013-02-01 11:23 -0800
                    Re: Tomcat Multi-Threading Arne Vajhøj <arne@vajhoej.dk> - 2013-02-01 17:36 -0500
                    Re: Tomcat Multi-Threading Magnus Warker <magnus@mailinator.com> - 2013-02-03 07:17 +0100
            Re: Tomcat Multi-Threading lipska the kat <"nospam at neversurrender dot co dot uk"> - 2013-01-30 17:49 +0000
              Re: Tomcat Multi-Threading zigzagdna@yahoo.com - 2013-01-30 11:29 -0800
                Re: Tomcat Multi-Threading Leif Roar Moldskred <leifm@dimnakorr.com> - 2013-01-30 14:30 -0600
                  Re: Tomcat Multi-Threading Arne Vajhøj <arne@vajhoej.dk> - 2013-01-30 22:00 -0500
                Re: Tomcat Multi-Threading Arne Vajhøj <arne@vajhoej.dk> - 2013-01-30 21:59 -0500
              Re: Tomcat Multi-Threading Lew <lewbloch@gmail.com> - 2013-01-30 14:48 -0800
                Re: Tomcat Multi-Threading Arne Vajhøj <arne@vajhoej.dk> - 2013-01-30 22:21 -0500
                  Re: Tomcat Multi-Threading lipska the kat <"nospam at neversurrender dot co dot uk"> - 2013-01-31 08:47 +0000
                    Re: Tomcat Multi-Threading Arne Vajhøj <arne@vajhoej.dk> - 2013-02-01 17:39 -0500
            Re: Tomcat Multi-Threading Arne Vajhøj <arne@vajhoej.dk> - 2013-01-30 22:12 -0500
    Re: Tomcat Multi-Threading lipska the kat <"nospam at neversurrender dot co dot uk"> - 2013-01-30 08:51 +0000

Page 2 of 2 — ← Prev page 1 [2]


#21903

FromArne Vajhøj <arne@vajhoej.dk>
Date2013-01-30 22:00 -0500
Message-ID<5109de65$0$295$14726298@news.sunsite.dk>
In reply to#21883
On 1/30/2013 3:30 PM, Leif Roar Moldskred wrote:
> zigzagdna@yahoo.com wrote:
>> Thanks a lot to all of your insight. I do not see any separate java
>> process for my "application". I only see tomcata6.exe which shows
>> many threads, so I assuming my "application" is multi-theraded and
>> more CPU's should help!!!
>
> That's not necessarily the case. Whether more CPU cores will improve
> an application's performance depends on how the application balances
> CPU load across threads -- not just the number of threads it uses. If
> an application uses 20 threads, but 19 of those spends almost all
> their time waiting on work being done in the 20th thread, throwing
> more cores at the application isn't going to make a measureable
> difference.

But that is not a very likely scenario for a web app.

Arne

[toc] | [prev] | [next] | [standalone]


#21902

FromArne Vajhøj <arne@vajhoej.dk>
Date2013-01-30 21:59 -0500
Message-ID<5109de27$0$295$14726298@news.sunsite.dk>
In reply to#21879
On 1/30/2013 2:29 PM, zigzagdna@yahoo.com wrote:
> Thanks a lot to all of your insight. I do not see any separate java
> process for my "application". I only see tomcata6.exe which shows
> many threads, so I assuming my "application" is multi-theraded and
> more CPU's should help!!!

It is correct that it is a single process with multiple threads.

Performance will be improved by adding more CPU's *if* the application
is CPU bound.

If you are currently using 10% of available CPU power, because all
threads are waiting for the database, then adding more CPU's will
not help.

If you are using 100% of available CPU power and the threads are
waiting to get the CPU, then adding more CPU's should help.

Arne

[toc] | [prev] | [next] | [standalone]


#21889

FromLew <lewbloch@gmail.com>
Date2013-01-30 14:48 -0800
Message-ID<3283e20d-e72b-41df-98dc-9b539e149db9@googlegroups.com>
In reply to#21878
lipska the kat wrote:
>Lew wrote:
>>>>> In the world of Java, no applications are single threaded.
> I think you may be confusing the VM and the threads it uses to do 
> housekeeping (garbage collection, assignment of execution threads to 
> multiple processors etc) with the application running in the VM, which, 
> unless you explicitly create a new Thread in your code will by default 
> be single threaded.

No, I'm not confusing them, I'm referring to them.

>> Do a little research.
> 
> Well quite

You obviously have done the research, since you mentioned the very threads to 
which I'm referring.

The OP's question, as I'm pointing out for the third time, has to do with whether 
multi-core platforms will enhance performance if there are multiple threads. Since 
every Java program involves multiple threads, it's reasonable to assume that any 
effect that exists due to multiple CPUs would be relevant.

-- 
Lew

[toc] | [prev] | [next] | [standalone]


#21908

FromArne Vajhøj <arne@vajhoej.dk>
Date2013-01-30 22:21 -0500
Message-ID<5109e346$0$295$14726298@news.sunsite.dk>
In reply to#21889
On 1/30/2013 5:48 PM, Lew wrote:
> lipska the kat wrote:
>> Lew wrote:
>>>>>> In the world of Java, no applications are single threaded.
>> I think you may be confusing the VM and the threads it uses to do
>> housekeeping (garbage collection, assignment of execution threads to
>> multiple processors etc) with the application running in the VM, which,
>> unless you explicitly create a new Thread in your code will by default
>> be single threaded.
>
> No, I'm not confusing them, I'm referring to them.
>
>>> Do a little research.
>>
>> Well quite
>
> You obviously have done the research, since you mentioned the very threads to
> which I'm referring.
>
> The OP's question, as I'm pointing out for the third time, has to do with whether
> multi-core platforms will enhance performance if there are multiple threads. Since
> every Java program involves multiple threads, it's reasonable to assume that any
> effect that exists due to multiple CPUs would be relevant.

The effect of multi core from just the house keeping threads would
not be that big.

But I don't think anyone argued against that multi core is good for
Java in general (besides the JVM house keeping threads a modern OS
usually runs dozens of other processes).

What we are skeptical about is you claim that all Java apps
are multi threaded. That seems to be based on a rather unsual
definition of multi threaded.

Arne

[toc] | [prev] | [next] | [standalone]


#21914

Fromlipska the kat <"nospam at neversurrender dot co dot uk">
Date2013-01-31 08:47 +0000
Message-ID<kaednTx7wYMospfMnZ2dnUVZ7v-dnZ2d@bt.com>
In reply to#21908
On 31/01/13 03:21, Arne Vajhøj wrote:
> On 1/30/2013 5:48 PM, Lew wrote:
>> lipska the kat wrote:
>>> Lew wrote:

[snip]

> What we are skeptical about is you claim that all Java apps
> are multi threaded. That seems to be based on a rather unsual
> definition of multi threaded.

I think this is the point. What exactly is a multi-threaded application.

The OP asked a question re Tomcat

When you write a web app you have no conventional Java entry point 
(public static void main(String[] args), you are actually extending the 
server. IIRC the Tomcat docs explicitly advise against instantiating new 
threads. I don't think that anyone would argue against the fact that 
*Tomcat* is a multi-threaded application. Does this make your web-app 
multi-threaded ... Well yes it does but only as a *side effect* of the 
way the container manages multiple requests for the same resource, if 
you extend a multi-threaded application then by implication your 
application is multi-threaded.

That's my view of things anyway.

Applications with a single public static void main(String args[]) entry 
point are different. If you don't explicitly create new Threads then I 
don't think you would call your application multi-threaded. The fact the 
the JVM uses multiple threads to do houskeeping tasks is an 
implementation detail. The clincher is that the JVM isn't a Java 
application (in the way that Tomcat is). There is a difference of course 
between green and native threads but that discussion is beyond the scope 
of this document :-)

Or maybe you disagree

lipska

-- 
Lipska the Kat©: Troll hunter, sandbox destroyer
and farscape dreamer of Aeryn Sun

[toc] | [prev] | [next] | [standalone]


#21981

FromArne Vajhøj <arne@vajhoej.dk>
Date2013-02-01 17:39 -0500
Message-ID<510c441b$0$293$14726298@news.sunsite.dk>
In reply to#21914
On 1/31/2013 3:47 AM, lipska the kat wrote:
> On 31/01/13 03:21, Arne Vajhøj wrote:
>> On 1/30/2013 5:48 PM, Lew wrote:
>>> lipska the kat wrote:
>>>> Lew wrote:
>
> [snip]
>
>> What we are skeptical about is you claim that all Java apps
>> are multi threaded. That seems to be based on a rather unsual
>> definition of multi threaded.
>
> I think this is the point. What exactly is a multi-threaded application.
>
> The OP asked a question re Tomcat
>
> When you write a web app you have no conventional Java entry point
> (public static void main(String[] args), you are actually extending the
> server. IIRC the Tomcat docs explicitly advise against instantiating new
> threads. I don't think that anyone would argue against the fact that
> *Tomcat* is a multi-threaded application. Does this make your web-app
> multi-threaded ... Well yes it does but only as a *side effect* of the
> way the container manages multiple requests for the same resource, if
> you extend a multi-threaded application then by implication your
> application is multi-threaded.
>
> That's my view of things anyway.
>
> Applications with a single public static void main(String args[]) entry
> point are different. If you don't explicitly create new Threads then I
> don't think you would call your application multi-threaded. The fact the
> the JVM uses multiple threads to do houskeeping tasks is an
> implementation detail. The clincher is that the JVM isn't a Java
> application (in the way that Tomcat is). There is a difference of course
> between green and native threads but that discussion is beyond the scope
> of this document :-)
>
> Or maybe you disagree

I don't think there is much disagreement about the Tomcat web app.

The discussion is whether all Java apps are multi threaded.

And I think we agree on that topic.

Arne

[toc] | [prev] | [next] | [standalone]


#21906

FromArne Vajhøj <arne@vajhoej.dk>
Date2013-01-30 22:12 -0500
Message-ID<5109e109$0$295$14726298@news.sunsite.dk>
In reply to#21871
On 1/30/2013 11:28 AM, 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.

The JVM does not have a specific number of threads. The specific JVM you
are using have a specific number of threads.

The fact that some JVM's start extra threads does not make all
Java apps multi threaded.

Arne

[toc] | [prev] | [next] | [standalone]


#21860

Fromlipska the kat <"nospam at neversurrender dot co dot uk">
Date2013-01-30 08:51 +0000
Message-ID<KqudnWPMFLeSQpXMnZ2dnUVZ8gSdnZ2d@bt.com>
In reply to#21845
On 30/01/13 01:59, 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?
>
> 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.

There's a good mailing list at
users@tomcat.apache.org

You can find out about it here
http://tomcat.apache.org/lists.html#tomcat-users

lipska

-- 
Lipska the Kat©: Troll hunter, sandbox destroyer
and farscape dreamer of Aeryn Sun

[toc] | [prev] | [standalone]


Page 2 of 2 — ← Prev page 1 [2]

Back to top | Article view | comp.lang.java.programmer


csiph-web