Jose,
Sounds good - look forward to your logs.
For connection time and your 4 seconds?
EclipseLink is entirely dependent on the database you choose to
use, your HD speed and how in-memory caching is setup - In my case
Derby 10.5.3 (a Java process on a 2.7 GHz Core i7)
In some cases if you are using a 1-10GB CAT6 network - HD access
may be slower.
The database performance will also be greatly affected by the
machine it runs on, the network bandwidth and initial TCP/IP setup time
and/or whether it runs on the same machine (where the HD speed will
greatly affect performance)
If this is your first connection to the database - depending on how
the connection pool is configured you may see an initial hit and then
much faster times when the pool connections are reused - in my case 5
seconds for the 1st and 0.3 seconds for the 2nd
Also depending on what JPQL you are running - EclipseLink may
decide to retrieve the objects directly from its' cache or any 2nd
level cache. As you have statically weaved the classes you should
benefit from this caching on subsequent query calls to the
entityManager. There are also ways to prep the connection and/or fill
the cache that one can get into.
The EclipseLink logs should give you an overview of where the
bottleneck is - here for example is my own SE JPA app that DDL
generates tables for 2 entities reads all entites and writes 5 new
objects to the [Derby] database.
Summary:
As you can see from the logs,
eclipselink spends 3 seconds predeploying (HD access is the
issue here)
the JDBC connection takes 5.4 seconds to return a non-JTA
connection to us (outside EclipseLink)
It takes 1.5 seconds to create the database (derby specific)
we then spend 1.1 seconds reading/writing entities (on the
DB - not in memory)
On a 2nd run total time takes only 3.3 seconds instead of
11 with 0.3 seconds for a DB connection
So even on a fast machine with a 10k raptor HD we are
limited by DB and HD access and spend about 5 seconds processing and 5
seconds waiting for the initial connection and then 3.3 seconds total
with 0.3 seconds for a pooled connection.
1st connection after the pc was idle overnight
----------------------------------------------
[EL Finest]: 2010-07-06
08:12:36.462--ServerSession(14491894)--Thread(Thread[main,5,main])--Begin
predeploying Persistence Unit dao.create.tables.derby.client; session
file:/F:/view_w35d/examples/org.eclipse.persistence.example.jpa.server.common.ddlgen/bin/_dao.create.tables.derby.client;
state Initial; factoryCount 0
...
pu predeploy (without DB connect - but a lot of HD access) = 3 seconds
...
[EL Config]: 2010-07-06
08:12:39.585--ServerSession(14491894)--Connection(29232906)--Thread(Thread[main,5,main])--connecting(DatabaseLogin(
platform=>DerbyPlatform
user name=> "APP"
datasource URL=""
"jdbc:derby://127.0.0.1:1527/weblogic;create=true"
))
....
Database initial connection = 5.4 seconds (this JDBC connection is
entirely out of the control of a default configured EclipseLink)
....
[EL Config]: 2010-07-06
08:12:45.107--ServerSession(14491894)--Connection(13121485)--Thread(Thread[main,5,main])--Connected:
jdbc:derby://127.0.0.1:1527/weblogic;create=true
User: APP
Database: Apache Derby Version: 10.5.3.0 - (802917)
Driver: Apache Derby Network Client JDBC Driver Version: 10.5.3.0
- (802917)
[EL Finest]: 2010-07-06
08:12:45.233--ServerSession(14491894)--Thread(Thread[main,5,main])--sequencing
connected, state is NoPreallocation_State
...
DDL generation (10-15 drop/create sequence and tables) = 1.5 seconds
...
[EL Finest]: 2010-07-06
08:12:46.856--ServerSession(14491894)--Thread(Thread[main,5,main])--End
deploying Persistence Unit dao.create.tables.derby.client; session
file:/F:/view_w35d/examples/org.eclipse.persistence.example.jpa.server.common.ddlgen/bin/_dao.create.tables.derby.client;
state Deployed; factoryCount 1
[EL Finer]: 2010-07-06
08:12:47.106--ServerSession(14491894)--Thread(Thread[main,5,main])--client
acquired
[EL Finest]: 2010-07-06
08:12:47.106--UnitOfWork(18071221)--Thread(Thread[main,5,main])--PERSIST
operation called on:
org.eclipse.persistence.example.jpa.server.business.Cell@2994589( id:
null state: null left: null right: null parent: HashSet@2529687
references: HashSet@2529687).
_persistCompleteGraphOfEntities() Inserted:
org.eclipse.persistence.example.jpa.server.business.Cell@2994589( id:
null state: null left: null right: null parent: HashSet@2529687
references: HashSet@2529687)
.....
reading/inserting entities and generating ID's = 1.1 seconds
.....
[EL Finest]: 2010-07-06
08:12:48.277--ServerSession(14491894)--Thread(Thread[main,5,main])--End
undeploying Persistence Unit dao.create.tables.derby.client; session
file:/F:/view_w35d/examples/org.eclipse.persistence.example.jpa.server.common.ddlgen/bin/_dao.create.tables.derby.client;
state Undeployed; factoryCount 0
2nd run takes only 3.3 seconds instead of 11 with only 0.3 seconds to
get a DB connection
--------------------------------
[EL Finest]: 2010-07-06
08:33:45.945--ServerSession(11025290)--Thread(Thread[main,5,main])--Begin
predeploying Persistence Unit dao.create.tables.derby.client; session
file:/F:/view_w35d/examples/org.eclipse.persistence.example.jpa.server.common.ddlgen/bin/_dao.create.tables.derby.client;
state Initial; factoryCount 0
...
[EL Config]: 2010-07-06
08:33:46.57--ServerSession(11025290)--Connection(11546362)--Thread(Thread[main,5,main])--connecting(DatabaseLogin(
platform=>DerbyPlatform
user name=> "APP"
datasource URL=""
"jdbc:derby://127.0.0.1:1527/weblogic;create=true"
))
[EL Config]: 2010-07-06
08:33:46.804--ServerSession(11025290)--Connection(33040770)--Thread(Thread[main,5,main])--Connected:
jdbc:derby://127.0.0.1:1527/weblogic;create=true
User: APP
Database: Apache Derby Version: 10.5.3.0 - (802917)
Driver: Apache Derby Network Client JDBC Driver Version: 10.5.3.0
- (802917)
[EL Finest]: 2010-07-06
08:33:46.819--ServerSession(11025290)--Thread(Thread[main,5,main])--sequencing
connected, state is NoPreallocation_State
[EL Finest]: 2010-07-06
08:33:49.255--ServerSession(11025290)--Thread(Thread[main,5,main])--End
undeploying Persistence Unit dao.create.tables.derby.client; session
file:/F:/view_w35d/examples/org.eclipse.persistence.example.jpa.server.common.ddlgen/bin/_dao.create.tables.derby.client;
state Undeployed; factoryCount 0
thank you
/michael
José Arcángel Salazar Delgado wrote:
Jose,
Hi, statically weaved entity classes should not affect runtime
performance as they are created at design time.
However, we would be interested in the details of your performance
slowdown and would need these to be able to narrow down any timing
issues and rule out the derby java process. Could you post one or more
of the following to your bug so we can track down the timing.
- log a bug at
https://bugs.eclipse.org/bugs/enter_bug.cgi?product=EclipseLink
- turn logging to finest and post the logs
<property name="eclipselink.logging.level" value="FINEST"/>
- turn on the performance profiler to get MS timing details
http://wiki.eclipse.org/Optimizing_the_EclipseLink_Application_(ELUG)#Measu
ring_EclipseLink_Performance_with_the_EclipseLink_Profiler
- optionally turn on the java se profiler to rank bottlenecks
- attach the general view containing the 4 graphs in JConsole for
both the Derby JVM and your app JVM processes
- check out the performance page
http://wiki.eclipse.org/EclipseLink/Performance
http://wiki.eclipse.org/EclipseLink/Development/Performance
- post as much as your SE client or a simplified unit test that
reproduces the issue as you are able.
thank you
ok, I will try to use the eclipselink profiler to see what is wrong.
btw, what is the spected time for making a connection with eclipselink?
In my app eclipselink has a delay of 4 secons to give me the first
EntityManager object. Is that ok?
/michael
bht@xxxxxxxxxxxxx wrote:
It might help in your case if you could post a variation of your
application as a bug, with your timing information. This has multiple
benefits, including easy access to the problem for people who can help
you.
See https://bugs.eclipse.org/bugs/show_bug.cgi?id=312146 for an
example. This one does not have -javaagent:eclipselink.jar I think.
Regards,
Bernard
Hello.
I'm developing a JSE 1.6 application with eclipselink 2.0.2 and derby
10.5.3.0 in embedded mode. The app is very small (only 2 forms and 3
tables) but the startup time is very high due to eclipselink (using
static weaving). is there any way to improve the startup time of
eclipselink?
Thanks for the help.
_______________________________________________
eclipselink-users mailing list
eclipselink-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-users
|