Thread: PostgreSQL->JDBC->Tomcat->Apache resource uses
Hi- It would be great if somebody can give me a "recipe" answer for this, but I'm equally interested in informed conjecture and stories from similar experiences. We're getting ready to spec our hardware for the imminent release of an application which uses JDBC to funnel data from our database to the web via Tomcat. We expect to set up a database server running PostgreSQL, an app server running Tomcat, and a web server running Apache. In our development environment we've observed that whenever we open a connection to the database from the app server, a process owned by postgres gets started on the database server. It appears that the process is the same whether our remote client is a Tomcat servlet or psql running from the command line. Given this background, I have a specific question & a couple of general questions: How much memory should we be expecting to use for each of these processes that get started on the server? What factors determine the load that each one puts on system resources & what information should I gather to estimate the impact on resources? More generally, can someone point to an explanation of the division of tasks between postmaster, per-client backend processes running on the database server, and client processes running on the application side? And finally, if anyone else is running PostgreSQL->JDBC->Tomcat->Apache, I'm curious about your hardware configuration & experiences with it. Any mistakes that you can help me avoid? I've looked at Tony Grant's article on his version of this setup, & I'm trying to digest Bruce Momjians's big "PostgreSQL Internals" article, but so far, I haven't found these particular questions addressed. Thanks everyone! -Nick -------------------------------------------------------------------------- Nick Fankhauser nickf@ontko.com Phone 1.765.935.4283 Fax 1.765.962.9788 Ray Ontko & Co. Software Consulting Services http://www.ontko.com/
On Tue, 2001-11-13 at 20:55, Nick Fankhauser wrote: snip... > In our development environment we've observed that whenever we open a > connection to the database from the app server, a process owned by postgres > gets started on the database server. It appears that the process is the same > whether our remote client is a Tomcat servlet or psql running from the > command line. ... > And finally, if anyone else is running PostgreSQL->JDBC->Tomcat->Apache, I'm > curious about your hardware configuration & experiences with it. Any > mistakes that you can help me avoid? I have a very small intranet application which runs on a bi-celeron 500 serveur with 256 Mb of RAM. There is a legacy database running in VMware on the same machine. The disks are RAID 1 on an Ultra 160 SCSI card. This is adequate for the time being. The application will be partially put on the web. At that time I will add a serveur for Apache/Tomcat and leave the database on the existing hardware. I have another live database which will be going live bigtime this mont I'll let you know if it survives the load... > I've looked at Tony Grant's article on his version of this setup, & I'm > trying to digest Bruce Momjians's big "PostgreSQL Internals" article, but so > far, I haven't found these particular questions addressed. I have many more ideas to improve the page. Any contributions greatly appreciated. A long delayed update shall be started RSN (TM) Cheers Tony Grant -- RedHat Linux on Sony Vaio C1XD/S http://www.animaproductions.com/linux2.html Macromedia UltraDev with PostgreSQL http://www.animaproductions.com/ultra.html
Hi,
I have a set up where we use just that which you describe. We have the addition of having some heavy duty server software populatining the database continually. User access the results via apache->tomcat->jdbc->postgres.
In our backend software we keep two persistant connections to the DB for all read/write activity (one for each), which result in separate OS processes for each. From the web interface, there are several, but as each connection is for often single queries, not many connections (or processes) ever build up. The better way to do it from tomcat is to set up a connection pool, that way you can keep connection amounts down, so that you dont overload the db server.
Our set up is postgres and on java server reader/writer app on a Sun Netra X1, with 40Gb space, and 512mb memory. Tomcat and apache are on another Sun Netra X1 machine. We have had no problems yet, and the database is getting bigger all the time.
In our test environment though we did encounter problems if we ran all the componants on a single machine with 128 Mb of physical memory. We kept getting IO delays as each processes was reading/writing to swap (I think) which made the system unusable after a while, as the IO wait was pushing 80% most of the time. As soon as we stopped any particular process, and less swap space was required the problem was diminished.
Hope that helps
Nikk Anderson
-----Original Message-----
From: Nick Fankhauser [mailto:nickf@ontko.com]
Sent: 13 November 2001 19:56
To: Psql-Jdbc; pgsql-admin
Subject: PostgreSQL->JDBC->Tomcat->Apache resource uses
And finally, if anyone else is running PostgreSQL->JDBC->Tomcat->Apache, I'm
curious about your hardware configuration & experiences with it. Any
mistakes that you can help me avoid?
Thanks everyone!
-Nick
--------------------------------------------------------------------------
Nick Fankhauser nickf@ontko.com Phone 1.765.935.4283 Fax 1.765.962.9788
Ray Ontko & Co. Software Consulting Services http://www.ontko.com/
At 02:55 PM 11/13/01 -0500, Nick Fankhauser wrote: >And finally, if anyone else is running PostgreSQL->JDBC->Tomcat->Apache, >I'm curious about your hardware configuration & experiences with it. Any >mistakes that you can help me avoid? We're doing exactly the same thing, except substitute Macromedia's JRun for Tomcat. The Apache web server is running on its own box, for security's sake. I believe any machine exposed to the great unwashed Internet ought to be considered potentially compromised and hostile. It's in it's own firewalled DMZ. The web server is an Intel Pentium ATX motherboard in a 1U chassis running FreeBSD 4.3. The Apache was built to include mod_ssl to support secure connections. The JRun and PostgreSQL are running on a 4 CPU Sun E3500 under Solaris 2.6. We had issues with Tomcat when we evaluated it, hence the JRun. Tomcat may be fixed by now, and we may revisit that issue when the JRun license is up for renewal. I also see no reason other than management skittishness that we couldn't run the backend on something like a 4 CPU 800MHz Xeon Dell server and FreeBSD. We've had fewer problems with the FreeBSD than with Solaris. -crl -- Chad R. Larson (CRL22) chad@eldocomp.com Eldorado Computing, Inc. 602-604-3100 5353 North 16th Street, Suite 400 Phoenix, Arizona 85016-3228