users
[Top] [All Lists]

RE: [cinjug-users] Hibernate in JBoss vs Tomcat

To: "Forsythe, Brian" <Brian.Forsythe@xxxxxxxxxxxxxxxxxxxxxxxx>, <users@xxxxxxxxxx>
Subject: RE: [cinjug-users] Hibernate in JBoss vs Tomcat
From: "Wei Zhang" <wei.zhang@xxxxxxxxxxxxxxxxx>
Date: Sun, 23 Apr 2006 22:35:40 -0400
Delivered-to: mailing list users@cinjug.org
Mailing-list: contact users-help@cinjug.org; run by ezmlm
Thread-index: AcZlbvBfj01iS845TvacnqE6p915kQBsrYUwAAZ02eM=
Thread-topic: [cinjug-users] Hibernate in JBoss vs Tomcat
Thanks a lot for all replies. 

The comparison is made based on the same application server(1GB memory, 1400MHz 
INtel Pentium M processor) talking to the same database server, default 
Tomcat5.5.12 and Jboss4.0.1RC1 installation. This is a use case that invokes a 
backend process to retrieve a large tree structure (hundres of components) from 
database table (one-to-many). So each list() call is to get child components of 
"id". There is no chance to reduce the number of fetch here. Based on the 
result, the app will decide to prompt error or proceed to next step. The 
problem is it takes longer in Jboss than Tomcat. 

The application lib has all the compiled classes and library including 
hibernate3.0 RC1 libraries and its configuration files under web\web-inf 
directory. Tomcat is configured in server.xml file to point to the web 
directory. All the files under web directory is packed into an ear file 
(including hibernate library) and deployed to Jboss. I initially noticed the 
performance issue and line by line tracked down to the hibernate call. I 
seperated getSession(), createQuery(...) and list() and it now shows that the 
delay is from list(). The session factory is created at the application 
startup. The session is opened when user submit the request and never closed 
during the loop call. 

Thanks again for all. 

-----Original Message-----
From:   Forsythe, Brian [mailto:Brian.Forsythe@xxxxxxxxxxxxxxxxxxxxxxxx]
Sent:   Sun 4/23/2006 6:02 PM
To:     users@xxxxxxxxxx
Cc:     
Subject:        RE: [cinjug-users] Hibernate in JBoss vs Tomcat
On a similar note, have you verified that you don't have a hardware bottleneck 
(disk I/O, CPU, etc)?


________________________________

From: deshmol-lists@xxxxxxxxx [mailto:deshmol-lists@xxxxxxxxx]
Sent: Fri 4/21/2006 2:10 PM
To: Wei Zhang; users@xxxxxxxxxx
Subject: RE: [cinjug-users] Hibernate in JBoss vs Tomcat



What is the Xmx value for the JVM that you use with
JBoss? I would imagine JBoss would require more than
the default JVM Xmx value

So could you try getting numbers by:
1. increasing the Xmx value in JBoss startup
2. getting separate timings for getSession() and
list() to identify where the difference really lies

Regards,
~ amol

--- Wei Zhang <wei.zhang@xxxxxxxxxxxxxxxxx> wrote:

> I am using Hibernate3.0, Jboss 4.0.1 and Tomcat
> 5.5.12. It is ok with
> Tomcat. The problem is Jboss. What I studied is the
> same method call in
> a while loop.
>
>         try {
>             String sql = "from table where id = :id
> order by property1";
>             Query query =
> getSession().createQuery(sql).setString("id",
> id);
>             parts = query.list();
>         } catch (Exception e) {
>             e.printStackTrace();
>         }
>
> Below is the time for each call with the loop in
> milli-seconds for Jboss
> and Tomcat. You can see that somehow Jboss just
> takes longer. The total
> difference is at the end.
>
> Jboss Tomcat
> 21    10
> 20    0
> 260   0
> 10    0
> 10    10
> 10    0
> 20    10
> 50    10
> 10    10
> 10    0
> 10    10
> 20    10
> 10    10
> 20    10
> 21    0
> 20    0
> 20    10
> 20    10
> 30    10
> 20    0
> 10    10
> 20    0
> 20    10
> 20    10
> 20    10
> 20    10
> 20    0
> 20    10
> 20    10
> 10    0
> 10    10
> 30    10
> 10    10
> 20    0
> 20    10
> 20    10
> 10    10
> 10    0
> 20    10
> 10    10
> 21    10
> 20    10
> 50    10
> 30    10
> 20    10
> 20    10
> 20    10
> 20    10
> 20    10
> 40    10
> 20    0
> 20    10
> 20    10
> 30    10
> 20    10
> 20    20
> 20    10
> 20    10
> 20    0
> 20    10
> 20    10
> 20    10
> 30    10
> 30    10
> 20    10
> 20    0
> 30    10
> 20    10
> 20    10
> 20    10
> 20    10
> 20    10
> 20    0
> 30    10
> 40    10
> 20    10
> 30    0
> 30    0
> 20    10
> 421   90
> 161   40
> 60    20
> 80    20
> 60    10
> 50    10
> 61    20
> 50    10
> 70    20
> 50    20
> 460   101
> 490   100
> 301   70
> 100   30
> 100   430
> 100   31
> 110   30
> 100   30
> 101   30
> 90    30
> 90    20
> 100   30
> 90    20
> 90    30
> 100   20
> 101   30
> 100   20
> 90    30
> 90    20
> 90    20
> 100   30
> 90    30
> 101   30
> 90    30
> 100   20
> 100   30
> 100   30
> 100   30
> 111   31
> 90    20
> 110   20
> 140   40
> 100   30
> 111   30
> 100   30
> 100   20
> 100   831
> 100   30
> 7682  3304 (total)
>
> -----Original Message-----
> From: Broyles, Eric [mailto:ebroyles@xxxxxxx]
> Sent: Friday, April 21, 2006 11:42 AM
> To: users@xxxxxxxxxx
> Subject: RE: [cinjug-users] Hibernate in JBoss vs
> Tomcat
>
> Ironic that you didn't find any Jboss/Hibernate
> documentation since
> Jboss provides professional support for it.
>
> I use Hibernate in Tomcat and it's been great.  I
> haven't tried running
> the application in Jboss.
>
> What versions are you using?
>
> -----Original Message-----
> From: Wei Zhang [mailto:wei.zhang@xxxxxxxxxxxxxxxxx]
>
> Sent: Friday, April 21, 2006 11:16 AM
> To: users@xxxxxxxxxx
> Subject: [cinjug-users] Hibernate in JBoss vs Tomcat
>
> Hi,
>
> I hava an application with Hibernate classes and
> mapping file bundled
> along with. I have Tomcat as my dev and test
> environment. Recently we
> decide to switch to Jboss. However, when I setup
> everything in Jboss and
> deployed the same application to Jboss, it becomes
> very slow. Each
> database fetch takes 3 or 4 times longer for
> Hibernate. I searched Jboss
> and hibernate document and forum and did not find a
> solution.
>
> Any help will be appreciated.
> Thanks in advance for your time and comments, Zhang,
> Wei
> (513)701-7324
> Wei.zhang@xxxxxxxxxxxxxxxxx
>
>
>
> ---------
>
=== message truncated ===


---------
You may unsubscribe from this mailing list
by sending a blank email addressed to:
users-unsubscribe@xxxxxxxxxx

--
Find additional help by sending a blank email
addressed to:
users-help@xxxxxxxxxx




---------
You may unsubscribe from this mailing list
by sending a blank email addressed to:
users-unsubscribe@xxxxxxxxxx

--
Find additional help by sending a blank email
addressed to:
users-help@xxxxxxxxxx








<Prev in Thread] Current Thread [Next in Thread>