Home » Modeling » EMF » [CDO] number of threads, what is normal (to be expected)
[CDO] number of threads, what is normal (to be expected) [message #888940] |
Mon, 18 June 2012 20:14 |
Christophe Bouhier Messages: 937 Registered: July 2009 |
Senior Member |
|
|
Hello,
I am trying to see if I can reduce the number of threads/deamons on my Server.
- I have reduced the number of threads for quartz (now only 2).
- I don't know how many I can expect from CDO. (Let's say with no active sessions).
- I have some equinox stuff running on the server, like the http, jetty, jasper).
- I have JMX running.
Any idea where all these threads could come from?
thx. Christophe
netxserver_db_mysql_production.product [Eclipse Application]
org.eclipse.equinox.launcher.Main at localhost:54852
Daemon System Thread [Signal Dispatcher] (Running)
Daemon System Thread [Finalizer] (Running)
Daemon System Thread [Reference Handler] (Running)
Thread [main] (Running)
Daemon Thread [Poller SunPKCS11-Darwin] (Running)
Daemon System Thread [RMI TCP Accept-0] (Running)
Daemon System Thread [RMI TCP Accept-8812] (Running)
Daemon System Thread [RMI TCP Accept-0] (Running)
Daemon Thread [Thread-2] (Running)
Thread [ConsoleSocketGetter] (Running)
Thread [Framework Active Thread] (Running)
Daemon Thread [Framework Event Dispatcher] (Running)
Daemon Thread [Start Level Event Dispatcher] (Running)
Thread [Worker-JM] (Running)
Daemon Thread [com.google.inject.internal.Finalizer] (Running)
Thread [613212394@qtp-1727296255-0] (Running)
Thread [2080344259@qtp-1727296255-1 - Acceptor0 SelectChannelConnector@0.0.0.0:8080] (Running)
Daemon Thread [Timer-0] (Running)
Daemon Thread [app thread - org.eclipse.emf.cdo.server.app.0] (Running)
Daemon Thread [Connection-Keep-Alive-DBStore@1] (Running)
Thread [Thread-10] (Running)
Daemon Thread [monitor-timer] (Running)
Daemon Thread [BufferPoolMonitor] (Running)
Daemon Thread [Thread-13] (Running)
Daemon Thread [Thread-14] (Running)
Daemon Thread [Thread-15] (Running)
Daemon Thread [Thread-16] (Running)
Thread [pool-1-thread-1] (Running)
Thread [pool-1-thread-2] (Running)
Thread [pool-1-thread-3] (Running)
Thread [pool-1-thread-4] (Running)
Thread [pool-1-thread-5] (Running)
Thread [pool-1-thread-6] (Running)
Thread [pool-1-thread-7] (Running)
Thread [pool-1-thread-8] (Running)
Thread [pool-1-thread-9] (Running)
Thread [pool-1-thread-10] (Running)
Thread [Thread-17] (Running)
Thread [ReceiveSerializer-Channel[2, CLIENT, cdo]] (Running)
Thread [ReceiveSerializer-Channel[2, SERVER, cdo]] (Running)
Thread [QuartzScheduler_Worker-1] (Running)
Thread [QuartzScheduler_Worker-2] (Running)
Daemon Thread [Timer-1] (Running)
Thread [QuartzScheduler_QuartzSchedulerThread] (Running)
Daemon Thread [TCPSelector] (Running)
Daemon Thread [Thread-20] (Running)
Daemon Thread [Thread-21] (Running)
Daemon Thread [Thread-22] (Running)
Daemon Thread [Thread-23] (Running)
Daemon Thread [Thread-24] (Running)
Daemon Thread [Thread-25] (Running)
Daemon Thread [Thread-27] (Running)
Daemon Thread [Thread-28] (Running)
Daemon Thread [Thread-29] (Running)
Daemon Thread [Thread-30] (Running)
Daemon Thread [Thread-31] (Running)
Daemon Thread [Thread-36] (Running)
Daemon Thread [Thread-41] (Running)
Daemon Thread [Thread-40] (Running)
Daemon Thread [Thread-46] (Running)
Thread [ReceiveSerializer-Channel[Control, SERVER]] (Running)
Thread [ReceiveSerializer-Channel[1, SERVER, cdo]] (Running)
Daemon Thread [Thread-52] (Running)
Daemon Thread [Thread-57] (Running)
Daemon Thread [Thread-60] (Running)
/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin/java (Jun 18, 2012 9:41:52 PM)
|
|
|
Re: [CDO] number of threads, what is normal (to be expected) [message #889243 is a reply to message #888940] |
Tue, 19 June 2012 03:58 |
|
Hi Christophe,
CDO itself doesn't use a variable number of threads. But a CDONet4jSession is associated with a Net4j IChannel both on
the client and on the server. Each IChannel needs one ReceiveSerializer thread. A logical IChannel is always associated
with a physical IConnector. Net4j's TCPConnectors usually share a single TCPSelector which owns a single thread. Net4j
in general adds one thread that monitors the buffer pool and one for a shared Timer. For each actual communication case
(ISignal) there's one thread taken from a thread pool for the duration of the signal execution. Maybe I've fogotten a
couple of threads but it should be a small, constant number. It's best to set breakpoints in the constructors of Thread
to find out who creates them. Soemtimes AspectJ can help to add very specific tracing without suspending the VM each time.
The only threads that I don't like so much are the ReceiveSerializer threads per IChannel. I vaguely remember that they
were not originally intended (see the multiple subclasses of IWorkSerializer), but all other attempts to get along with
threads from a pool led to severe synchronization problems. There might be potential to reduce the overall number of
threads.
Cheers
/Eike
----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
Am 18.06.2012 22:14, schrieb Christophe Bouhier:
> Hello,
> I am trying to see if I can reduce the number of threads/deamons on my Server. - I have reduced the number of threads
> for quartz (now only 2). - I don't know how many I can expect from CDO. (Let's say with no active sessions). - I have
> some equinox stuff running on the server, like the http, jetty, jasper). - I have JMX running.
> Any idea where all these threads could come from? thx. Christophe
>
> netxserver_db_mysql_production.product [Eclipse Application]
> org.eclipse.equinox.launcher.Main at localhost:54852
> Daemon System Thread [Signal Dispatcher] (Running)
> Daemon System Thread [Finalizer] (Running)
> Daemon System Thread [Reference Handler] (Running)
> Thread [main] (Running)
> Daemon Thread [Poller SunPKCS11-Darwin] (Running)
> Daemon System Thread [RMI TCP Accept-0] (Running)
> Daemon System Thread [RMI TCP Accept-8812] (Running)
> Daemon System Thread [RMI TCP Accept-0] (Running)
> Daemon Thread [Thread-2] (Running)
> Thread [ConsoleSocketGetter] (Running)
> Thread [Framework Active Thread] (Running)
> Daemon Thread [Framework Event Dispatcher] (Running)
> Daemon Thread [Start Level Event Dispatcher] (Running)
> Thread [Worker-JM] (Running)
> Daemon Thread [com.google.inject.internal.Finalizer] (Running)
> Thread [613212394@qtp-1727296255-0] (Running)
> Thread [2080344259@qtp-1727296255-1 - Acceptor0 mailto:SelectChannelConnector@0.0.0.0:8080] (Running)
> Daemon Thread [Timer-0] (Running)
> Daemon Thread [app thread - org.eclipse.emf.cdo.server.app.0] (Running)
> Daemon Thread [Connection-Keep-Alive-DBStore@1] (Running)
> Thread [Thread-10] (Running)
> Daemon Thread [monitor-timer] (Running)
> Daemon Thread [BufferPoolMonitor] (Running)
> Daemon Thread [Thread-13] (Running)
> Daemon Thread [Thread-14] (Running)
> Daemon Thread [Thread-15] (Running)
> Daemon Thread [Thread-16] (Running)
> Thread [pool-1-thread-1] (Running)
> Thread [pool-1-thread-2] (Running)
> Thread [pool-1-thread-3] (Running)
> Thread [pool-1-thread-4] (Running)
> Thread [pool-1-thread-5] (Running)
> Thread [pool-1-thread-6] (Running)
> Thread [pool-1-thread-7] (Running)
> Thread [pool-1-thread-8] (Running)
> Thread [pool-1-thread-9] (Running)
> Thread [pool-1-thread-10] (Running)
> Thread [Thread-17] (Running)
> Thread [ReceiveSerializer-Channel[2, CLIENT, cdo]] (Running)
> Thread [ReceiveSerializer-Channel[2, SERVER, cdo]] (Running)
> Thread [QuartzScheduler_Worker-1] (Running)
> Thread [QuartzScheduler_Worker-2] (Running)
> Daemon Thread [Timer-1] (Running)
> Thread [QuartzScheduler_QuartzSchedulerThread] (Running)
> Daemon Thread [TCPSelector] (Running)
> Daemon Thread [Thread-20] (Running)
> Daemon Thread [Thread-21] (Running)
> Daemon Thread [Thread-22] (Running)
> Daemon Thread [Thread-23] (Running)
> Daemon Thread [Thread-24] (Running)
> Daemon Thread [Thread-25] (Running)
> Daemon Thread [Thread-27] (Running)
> Daemon Thread [Thread-28] (Running)
> Daemon Thread [Thread-29] (Running)
> Daemon Thread [Thread-30] (Running)
> Daemon Thread [Thread-31] (Running)
> Daemon Thread [Thread-36] (Running)
> Daemon Thread [Thread-41] (Running)
> Daemon Thread [Thread-40] (Running)
> Daemon Thread [Thread-46] (Running)
> Thread [ReceiveSerializer-Channel[Control, SERVER]] (Running)
> Thread [ReceiveSerializer-Channel[1, SERVER, cdo]] (Running)
> Daemon Thread [Thread-52] (Running)
> Daemon Thread [Thread-57] (Running)
> Daemon Thread [Thread-60] (Running)
> /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin/java (Jun 18, 2012 9:41:52 PM)
>
>
>
Cheers
/Eike
----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
|
|
| |
Re: [CDO] number of threads, what is normal (to be expected) [message #889777 is a reply to message #889684] |
Tue, 19 June 2012 15:01 |
|
Am 19.06.2012 15:28, schrieb Christophe Bouhier:
> Hi Eike,
> Thanks for the explanation. I have put a breakpoint on Thread as you suggested. I noticed, some of the threads are not
> named in WorkerThread.
> The method: protected String getThreadName()
> {
> return null;
> }
>
> Is not overridden, in this case by CDORevisionCacheNonAuditing
>
> There is also this in ExecutorServiceFactory, which leads to a thread with no name.
> final ThreadGroup threadGroup = new ThreadGroup(threadGroupName);
> ThreadFactory threadFactory = new ThreadFactory()
> {
> public Thread newThread(Runnable r)
> {
> Thread thread = new Thread(threadGroup, r);
> thread.setDaemon(true);
> return thread;
> }
> };
>
>
> BTW, I am on CDO 4.0.1.
> Would it make sense to name these threads? For a larger server side app, It could be useful.
I think it wouldn't harm ;-)
Can you please submit a bugzilla and attach a patch with your proposal? Please note that 4.0 is out of maintenance now!
Cheers
/Eike
----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
Cheers
/Eike
----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
|
|
| |
Goto Forum:
Current Time: Sat Oct 19 19:16:49 GMT 2024
Powered by FUDForum. Page generated in 0.03425 seconds
|