[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [eclipselink-users] Database performance problem
|
Is the test reusing the same EntityManager for the inserts? You should
create a new EntityManager per transaction, otherwise your persistence
context will continue to grow and degrade performance.
Otherwise, you need to figure out where the time is being spent. You could
use a profiling tool such as JProfiler, or use EclipseLink
PerformanceProfiler, or in the latest EclipseLink trunk builds, you could
use the PerformanceMonitor.
Sebastian Weber-4 wrote:
>
> Hi All,
>
> actually Ive 2 problems. But first the main issue -> Database performance:
>
> we are using Eclipselink(Javax.persistens 2.0.0, Eclipselink 2.0.2) and
> MySQL (local 5.0.5, cluster 7.1.5) for built-up a back-end. At the
> moment we using just one server bat later there are two(or more) server
> which connect to one MySQL Cluster. That was and still is our
> architecture.
> We are setting up a running Eclipselink environment whit a local MySQL
> Database and it works fine. Last week we started to run same performance
> test against the database.
> This test was very simple: Write Log-Entities over Eclipselink in the
> database.
> At the beginning the inserts/s was about 200 and 600 but then the
> inserts/s decreased to 0. We have tested on a local MySQL database and a
> MySQL Cluster but the results are almost the same.
> Ive attached a graph (inserts/s over time) of all the tests for getting
> a better overview. The tests was not at the same time! Ive tried to
> disable the cache in the persistense.xml and delete all Log-Entities
> from the cache after each insert. The result was more or less the same
> -> going down to 0 inserts/s. The biggest amount of entities in the
> database was about 500000. The database was clean for each test. I think
> that is not that big for a database. The system performance was "ok".
> The CPU load about 70%-85% and the memory increased up to 3 GB. That was
> the reason why I configures the NO CACHE.
>
> Has anyone a hint what I can configure to solve the problem or getting a
> better performance..?
>
> persistemce.xml:
> <?xml version="1.0" encoding="UTF-8"?>
> <persistence version="1.0"
> xmlns="http://java.sun.com/xml/ns/persistence"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
> http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">
> <persistence-unit name="database">
> <class>de.service.logEntity</class>
> ....
> <properties>
> <!-- Embedded MySQL Login -->
> <property name="eclipselink.target-database" value="MYSQL"/>
> <property name="javax.persistence.jdbc.driver"
> value="com.mysql.jdbc.Driver"/>
> <property name="eclipselink.jdbc.read-connections.min"
> value="10"/>
> <property name="eclipselink.jdbc.write-connections.min"
> value="10"/>
> <property name="eclipselink.jdbc.batch-writing" value="JDBC"/>
> <property name="javax.persistence.jdbc.password"
> value="root"/>
> <property name="javax.persistence.jdbc.user" value="root"/>
> <property name="javax.persistence.jdbc.url"
> value="jdbc:mysql://10.0.3.11:3306/database"/>
>
> <!-- Database Schema Creation -->
> <property name="eclipselink.ddl-generation" value="none"/>
> <property name="eclipselink.ddl-generation.output-mode"
> value="both"/>
>
> <shared-cache-mode>NONE</shared-cache-mode>
>
> <!-- Logging Settings -->
> <property name="eclipselink.logging.level" value="INFO" />
> <property name="eclipselink.logging.thread" value="false" />
> <property name="eclipselink.logging.session" value="true" />
> <property name="eclipselink.logging.exceptions" value="true"
> />
> <property name="eclipselink.logging.timestamp"
> value="true"/>
> </properties>
> </persistence-unit>
> </persistence>
>
>
>
> the second problem is just the question how I can configure Eclipselink
> for connect toward a MySQL Cluster.
> At the moment we are use the loadbalance extension in the mysql/jdbc url
> like this
> "jdbc:mysql:loadbalance://10.0.3.11:3306,10.0.3.12:3306/database". That
> works fine and extend the time between start and no inserts. To reach
> that the database will save on the cluster we have to modify the create
> script which is generates by the eclipselink. The engine has to set to
> ndbcluster for distribute the table in the cluster.
> But is there a option to configure such Cluster things in the
> persistence.xml or somewhere in the code?
>
>
> we and specially I looking forward to any hint that anyone can gives us.
> Thanks for each answer
>
> Sebastian
>
>
>
-----
http://wiki.eclipse.org/User:James.sutherland.oracle.com James Sutherland
http://www.eclipse.org/eclipselink/
EclipseLink , http://www.oracle.com/technology/products/ias/toplink/
TopLink
Wiki: http://wiki.eclipse.org/EclipseLink EclipseLink ,
http://wiki.oracle.com/page/TopLink TopLink
Forums: http://forums.oracle.com/forums/forum.jspa?forumID=48 TopLink ,
http://www.nabble.com/EclipseLink-f26430.html EclipseLink
Book: http://en.wikibooks.org/wiki/Java_Persistence Java Persistence
--
View this message in context: http://old.nabble.com/Database-performance-problem-tp29736392p29772988.html
Sent from the EclipseLink - Users mailing list archive at Nabble.com.