dev@glassfish.java.net

Re: server startup time

From: Lloyd L Chambers <Lloyd.Chambers_at_Sun.COM>
Date: Mon, 14 Aug 2006 15:18:52 -0700

Forgot to mention--this is on a 2.16 GHz MacBook Pro (dual core).

On a 3 GHz Quad-core MacPro, we could in theory see startup times as
fast 1.2 / (2 * 3/2.16) = 0.43 seconds. Taking the larger caches
into account, < 0.4 seconds is possible in theory. But again,
factoring in disk overhead. perhaps 1.4 seconds is more realistic.
But not if it’s single-threaded!

It might mean that we need a class loader to spawn a thread and do
larger, more efficient reads of jar files in large chunks, and
preload class bytes in the background.

Lloyd Chambers

On Aug 14, 2006, at 2:56 PM, Lloyd Chambers wrote:

> Forgot to mention--this is on a 2.16 GHz MacBook Pro (dual core).
>
> On a 3 GHz Quad-core MacPro, we could in theory see startup times
> as fast 1.2 / (2 * 3/2.16) = 0.43 seconds. Taking the larger
> caches into account, < 0.4 seconds is possible in theory. But
> again, factoring in disk overhead. perhaps 1.4 seconds is more
> realistic. But not if it’s single-threaded!
>
> It might mean that we need a class loader to spawn a thread and do
> larger, more efficient reads of jar files in large chunks, and
> preload class bytes in the background.
>
> Lloyd Chambers
>
> On Aug 14, 2006, at 2:51 PM, Lloyd L Chambers wrote:
>
>> Regarding server startup time--this is on a MacBook pro running
>> MacOS X 10.4.7--
>>
>> The server starts in about 5.6 seconds (real time, see below) on
>> my machine, but uses only 1 of 2 cores. So in theory, if it used
>> both cores, it might be able to start up twice as fast—a bit over
>> two seconds. It only uses 2.3 seconds of CPU time, so if both
>> cores could be fully utilized, in theory it would take about 1.2
>> seconds of real time—if disk access and other factors were not a
>> bottleneck. Assuming 1 second of overhead for disk access time,
>> that yields 2.2 seconds.
>>
>> MB:/gf/build/glassfish/bootstrap lloyd$ time startD
>> Starting Domain domain1, please wait.
>> Log redirected to /gf/run/domains/domain1/logs/server.log.
>> Domain domain1 is ready to receive client requests. Additional
>> services are being started in background.
>> Domain [domain1] is running [Sun Java System Application Server
>> Platform Edition 9.1 (build )] with its configuration and logs at:
>> [/gf/run/domains].
>> Admin Console is available at [http://localhost:4849].
>> Use the same port [4849] for "asadmin" commands.
>> User web applications are available at these URLs:
>> [http://localhost:8080 https://localhost:8181 ].
>> Following web-contexts are available:
>> [/web1 /asadmin ].
>> Standard JMX Clients (like JConsole) can connect to JMXServiceURL:
>> [service:jmx:rmi:///jndi/rmi://MB.local:8686/jmxrmi] for domain
>> management purposes.
>> Domain listens on at least following ports for connections:
>> [8080 8181 4849 3700 3820 3920 8686 ].
>>
>> real 0m5.621s
>> user 0m2.054s
>> sys 0m0.237s
>>
>>
>> Lloyd Chambers
>>
>> On Aug 14, 2006, at 10:22 AM, Scott Oaks wrote:
>>
>>>
>>>> What I don't "get" is why the other modules don't perform their
>>>> initialization in a separate thread, with suitable threading
>>>> locks or
>>>> barriers when there are dependencies. The server *should* be
>>>> able to
>>>> start up in about 2 seconds on my MacBook Pro.
>>>
>>> One thing that impacts this is the Java classloading hierarchy; all
>>> class loaders used by the appserver delegate to the system
>>> classloader,
>>> so that becomes a big single-threaded bottleneck. We are
>>> investigating
>>> ways to improve this in 9.1.
>>>
>>> What led you to conclude that the server should be able to start
>>> in 2
>>> seconds?
>>>
>>> -Scott
>>>
>>>
>>
>