You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Hector Del Mestre <he...@gmail.com> on 2013/06/06 22:45:41 UTC
Tomcat and PostgreeSQL
Hello:
I'm on a project and asked me to install Apache Tomcat as server pages and
PostgreSQL as database engine. So far so good and right install everything
correctly.
The application was done with AppFuse architecture originally utlizando
MySQL, but issues like licensing and client wants to use PostgreSQL.
And that is where I'm stuck, because Tomcat (or rather the Java VM) began
comsumir large amount of memory (I get 1.5 GB of RAM) when using the
application and there comes a time when it is hung and not answers, and
this is the only application deployed on the server.
Well, now the fatal question:
Tomcat need any special configuration to use PostgreSQL?
With MySQL the application works normally.
Team Summary (Virtualized with VMWare):
S.O.: OpenSUSE 12.3
PostgreSQL 9.2
Apache Tomcat: 7.0.39
RAM: 4 GB
Processor: 1 with two (2) cores.
Any guide / link will help.
Note:
Sorry for the English, I am using a translator.
Atte.
--
Héctor Del Mestre
Re: Tomcat and PostgreeSQL
Posted by Hector Del Mestre <he...@gmail.com>.
Thank you very much:
I will check what you suggested.
The Java version is 1.7
regards
2013/6/6 Caldarale, Charles R <Ch...@unisys.com>
> > From: Hector Del Mestre [mailto:hectordelmestre@gmail.com]
> > Subject: Tomcat and PostgreeSQL
>
> > The application was done with AppFuse architecture originally utlizando
> > MySQL, but issues like licensing and client wants to use PostgreSQL.
> > And that is where I'm stuck, because Tomcat (or rather the Java VM) began
> > comsumir large amount of memory (I get 1.5 GB of RAM) when using the
> > application and there comes a time when it is hung and not answers, and
> > this is the only application deployed on the server.
>
> You'll need to examine the heap and try to determine what the objects are
> that are consuming so much space. The jhat tool that comes with a
> Sun/Oracle JDK is useful for this:
> http://docs.oracle.com/javase/6/docs/technotes/tools/share/jhat.html
>
> There are also numerous profilers that will help with heap analysis;
> YourKit is a favorite, but it's not free. Google will help you find the
> free ones besides jhat.
>
> > Tomcat need any special configuration to use PostgreSQL?
>
> It shouldn't.
>
> > Team Summary (Virtualized with VMWare):
> > S.O.: OpenSUSE 12.3
> > PostgreSQL 9.2
> > Apache Tomcat: 7.0.39
> > RAM: 4 GB
> > Processor: 1 with two (2) cores.
>
> Thanks for all that, but what you didn't tell us was the JVM version.
>
> - Chuck
>
>
> THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
> MATERIAL and is thus for use only by the intended recipient. If you
> received this in error, please contact the sender and delete the e-mail and
> its attachments from all computers.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>
--
Héctor Del Mestre
Re: [OT] Tomcat and PostgreeSQL
Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
Chuck,
[Marking OT as this is not Tomcat-related]
On 6/6/13 5:13 PM, Caldarale, Charles R wrote:
>> From: Hector Del Mestre [mailto:hectordelmestre@gmail.com]
>> Subject: Tomcat and PostgreeSQL
>
>> The application was done with AppFuse architecture originally
>> utlizando MySQL, but issues like licensing and client wants to
>> use PostgreSQL. And that is where I'm stuck, because Tomcat (or
>> rather the Java VM) began comsumir large amount of memory (I get
>> 1.5 GB of RAM) when using the application and there comes a time
>> when it is hung and not answers, and this is the only application
>> deployed on the server.
>
> You'll need to examine the heap and try to determine what the
> objects are that are consuming so much space. The jhat tool that
> comes with a Sun/Oracle JDK is useful for this:
> http://docs.oracle.com/javase/6/docs/technotes/tools/share/jhat.html
>
> There are also numerous profilers that will help with heap
> analysis; YourKit is a favorite, but it's not free. Google will
> help you find the free ones besides jhat.
>
>> Tomcat need any special configuration to use PostgreSQL?
>
> It shouldn't.
Other than changing the JDBC URL, everything else should be the same
in terms of configuration /for Tomcat/.
Note that your application may have to change if there are any
MySQL-specific queries that have been written (e.g. INSERT DELAYED,
INSERT ... SELECT, or other MySQL-only queries). If AppFuse says it
works with MySQL *or* PostgreSQL, then you may have to set a
configuration switch in AppFuse telling it you are now using PostgreSQL.
- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
iQIcBAEBCAAGBQJRsediAAoJEBzwKT+lPKRY4zwQALmoQ4kMKax3kkrg6mT7WT3o
b/Ty3InVNF03u6ENUNuj6aLZAj7eEurzyE55bhNd6GMDSoqNEPwEosqHhvV6hFgx
SVSjWfHh4Ut9woY/V2WDQj00w2HsZ/oLdlTSMakHwqzMkH6m2pbdEXKTNRuuBf9w
MoFLo381IqJiOFRisf1LX1R5CzmmWYRpehmF/Gd+OEN7z95CRN+Cei2Grp22oz3r
vn2cV6OCpy2UyiUxPa8dJATx6RHZHRGBns3PI2aP6ZxwU4hUqZISsoyiw6V+mDT3
fwsorHfG1kJMUjoH4FKKQqb5hVby+wwTFvu+3KhBNOuyp6hLv71zE3wnYxBnCyFh
hewpqFXOWPWgGp3nUDiXN9oLney5HgrUz0jP0nJTJFicGeCEpywjj0Vmd9PfCGCw
z1yGzzmjpYeRn5mT48IpSmy2CzOfyb9kLvjfO2gF0rlAWbnAaoufqGiE7wPjJCCG
WE+qgtnz3zj6/NmQWxmMWTajV9//QngyHj8rJqZof1hoABHQimoy27K7ro7h2C9x
qmxPwul1ZJy64izy5BHbHEh/CGoxkg1Rnsru6Dq1WzxFtJcERJRpICVvQ8zcR5up
v7VUE1nCXEoNkFaw7TjZdbxlDdSuk4l7LFhWD9eJ2WrC5+BfC0EcRiiuhLtQ9qz0
TVElEfLZcbhCw0IdzaTD
=B6TV
-----END PGP SIGNATURE-----
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
RE: Tomcat and PostgreeSQL
Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Hector Del Mestre [mailto:hectordelmestre@gmail.com]
> Subject: Tomcat and PostgreeSQL
> The application was done with AppFuse architecture originally utlizando
> MySQL, but issues like licensing and client wants to use PostgreSQL.
> And that is where I'm stuck, because Tomcat (or rather the Java VM) began
> comsumir large amount of memory (I get 1.5 GB of RAM) when using the
> application and there comes a time when it is hung and not answers, and
> this is the only application deployed on the server.
You'll need to examine the heap and try to determine what the objects are that are consuming so much space. The jhat tool that comes with a Sun/Oracle JDK is useful for this:
http://docs.oracle.com/javase/6/docs/technotes/tools/share/jhat.html
There are also numerous profilers that will help with heap analysis; YourKit is a favorite, but it's not free. Google will help you find the free ones besides jhat.
> Tomcat need any special configuration to use PostgreSQL?
It shouldn't.
> Team Summary (Virtualized with VMWare):
> S.O.: OpenSUSE 12.3
> PostgreSQL 9.2
> Apache Tomcat: 7.0.39
> RAM: 4 GB
> Processor: 1 with two (2) cores.
Thanks for all that, but what you didn't tell us was the JVM version.
- Chuck
THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: Tomcat and PostgreeSQL
Posted by Hector Del Mestre <he...@gmail.com>.
ok,
2013/6/6 Tanglin, Oliver <OL...@saic.com>
> Also you might try tweaking your -Xms (minimum heap size) and -Xmx
> (maximum heap size) arguments for your JVM. If your PostgreSQL driver does
> not actually have a memory leak, this may do the trick.
>
> You can Google for specifications and examples. Set these in Catalina.sh
> CATALINA_OPS.
>
> Oliver
>
>
>
> -----Original Message-----
> From: users-return-242170-OLIVER.TANGLIN=saic.com@tomcat.apache.org on
> behalf of Ilya Kazakevich
> Sent: Thu 6/6/2013 5:50 PM
> To: 'Tomcat Users List'
> Subject: RE: Tomcat and PostgreeSQL
>
> I've never heard about it but looks like JDBC PostgreSQL driver has memory
> leak. What version of driver do you use? Try to google "postgre SQL JDBC
> memory leak"
> Actually any memory leak should be investigated using profiler tool. Google
> for "java profile memory leaks"
>
>
> Ilya.
> >-----Original Message-----
> >From: Hector Del Mestre [mailto:hectordelmestre@gmail.com]
> >Sent: Friday, June 07, 2013 12:46 AM
> >To: users@tomcat.apache.org
> >Subject: Tomcat and PostgreeSQL
> >
> >Hello:
> >I'm on a project and asked me to install Apache Tomcat as server pages and
> >PostgreSQL as database engine. So far so good and right install everything
> >correctly.
> >The application was done with AppFuse architecture originally utlizando
> >MySQL, but issues like licensing and client wants to use PostgreSQL.
> >And that is where I'm stuck, because Tomcat (or rather the Java VM) began
> >comsumir large amount of memory (I get 1.5 GB of RAM) when using the
> >application and there comes a time when it is hung and not answers, and
> this
> >is the only application deployed on the server.
> >Well, now the fatal question:
> >Tomcat need any special configuration to use PostgreSQL?
> >With MySQL the application works normally.
> >
> >Team Summary (Virtualized with VMWare):
> >S.O.: OpenSUSE 12.3
> >PostgreSQL 9.2
> >Apache Tomcat: 7.0.39
> >RAM: 4 GB
> >Processor: 1 with two (2) cores.
> >
> >Any guide / link will help.
> >
> >Note:
> >Sorry for the English, I am using a translator.
> >
> >Atte.
> >
> >--
> >Héctor Del Mestre
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
--
Héctor Del Mestre
RE: Tomcat and PostgreeSQL
Posted by "Tanglin, Oliver" <OL...@saic.com>.
Also you might try tweaking your -Xms (minimum heap size) and -Xmx (maximum heap size) arguments for your JVM. If your PostgreSQL driver does not actually have a memory leak, this may do the trick.
You can Google for specifications and examples. Set these in Catalina.sh CATALINA_OPS.
Oliver
-----Original Message-----
From: users-return-242170-OLIVER.TANGLIN=saic.com@tomcat.apache.org on behalf of Ilya Kazakevich
Sent: Thu 6/6/2013 5:50 PM
To: 'Tomcat Users List'
Subject: RE: Tomcat and PostgreeSQL
I've never heard about it but looks like JDBC PostgreSQL driver has memory
leak. What version of driver do you use? Try to google "postgre SQL JDBC
memory leak"
Actually any memory leak should be investigated using profiler tool. Google
for "java profile memory leaks"
Ilya.
>-----Original Message-----
>From: Hector Del Mestre [mailto:hectordelmestre@gmail.com]
>Sent: Friday, June 07, 2013 12:46 AM
>To: users@tomcat.apache.org
>Subject: Tomcat and PostgreeSQL
>
>Hello:
>I'm on a project and asked me to install Apache Tomcat as server pages and
>PostgreSQL as database engine. So far so good and right install everything
>correctly.
>The application was done with AppFuse architecture originally utlizando
>MySQL, but issues like licensing and client wants to use PostgreSQL.
>And that is where I'm stuck, because Tomcat (or rather the Java VM) began
>comsumir large amount of memory (I get 1.5 GB of RAM) when using the
>application and there comes a time when it is hung and not answers, and
this
>is the only application deployed on the server.
>Well, now the fatal question:
>Tomcat need any special configuration to use PostgreSQL?
>With MySQL the application works normally.
>
>Team Summary (Virtualized with VMWare):
>S.O.: OpenSUSE 12.3
>PostgreSQL 9.2
>Apache Tomcat: 7.0.39
>RAM: 4 GB
>Processor: 1 with two (2) cores.
>
>Any guide / link will help.
>
>Note:
>Sorry for the English, I am using a translator.
>
>Atte.
>
>--
>Héctor Del Mestre
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
RE: Tomcat and PostgreeSQL
Posted by Ilya Kazakevich <Il...@JetBrains.com>.
I've never heard about it but looks like JDBC PostgreSQL driver has memory
leak. What version of driver do you use? Try to google "postgre SQL JDBC
memory leak"
Actually any memory leak should be investigated using profiler tool. Google
for "java profile memory leaks"
Ilya.
>-----Original Message-----
>From: Hector Del Mestre [mailto:hectordelmestre@gmail.com]
>Sent: Friday, June 07, 2013 12:46 AM
>To: users@tomcat.apache.org
>Subject: Tomcat and PostgreeSQL
>
>Hello:
>I'm on a project and asked me to install Apache Tomcat as server pages and
>PostgreSQL as database engine. So far so good and right install everything
>correctly.
>The application was done with AppFuse architecture originally utlizando
>MySQL, but issues like licensing and client wants to use PostgreSQL.
>And that is where I'm stuck, because Tomcat (or rather the Java VM) began
>comsumir large amount of memory (I get 1.5 GB of RAM) when using the
>application and there comes a time when it is hung and not answers, and
this
>is the only application deployed on the server.
>Well, now the fatal question:
>Tomcat need any special configuration to use PostgreSQL?
>With MySQL the application works normally.
>
>Team Summary (Virtualized with VMWare):
>S.O.: OpenSUSE 12.3
>PostgreSQL 9.2
>Apache Tomcat: 7.0.39
>RAM: 4 GB
>Processor: 1 with two (2) cores.
>
>Any guide / link will help.
>
>Note:
>Sorry for the English, I am using a translator.
>
>Atte.
>
>--
>Héctor Del Mestre
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: Tomcat and PostgreeSQL
Posted by Dhaval Jaiswal <dh...@via.com>.
Adding to it..
as usual In server.xml, resource need to mentioned the type,
driverClassName, url and connectivity parameter of PostgreSql db.
as usual In a context.xml, ResourceLink name, global, type
<ResourceLink name="jdbc/DB_NAME" global="jdbc/DB_NAME"
type="javax.sql.DataSource"/>
and allow the IP of tomcat at db end in pg_hba.conf file to connect the db.
On Fri, Jun 7, 2013 at 10:52 AM, Lutischán Ferenc <lu...@gmail.com>wrote:
> Hi,
>
> on 2013.06.06. 22:45, Hector Del Mestre wrote:
>
> Well, now the fatal question:
>> Tomcat need any special configuration to use PostgreSQL?
>>
> I have some ideas:
> - The jdbc driver must be in the {Tomcat home}/lib.
> - If you use the tomcat pool manager append the testOnBorrow="true" to the
> Resource tag.
>
> Regards,
> Ferenc
>
> ------------------------------**------------------------------**---------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.**apache.org<us...@tomcat.apache.org>
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>
Re: Tomcat and PostgreeSQL
Posted by Lutischán Ferenc <lu...@gmail.com>.
Hi,
on 2013.06.06. 22:45, Hector Del Mestre wrote:
> Well, now the fatal question:
> Tomcat need any special configuration to use PostgreSQL?
I have some ideas:
- The jdbc driver must be in the {Tomcat home}/lib.
- If you use the tomcat pool manager append the testOnBorrow="true" to
the Resource tag.
Regards,
Ferenc
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org