Tomcat/Struts/Pooling?/Memory Sizes - Mailing list pgsql-general
From | Kurt Overberg |
---|---|
Subject | Tomcat/Struts/Pooling?/Memory Sizes |
Date | |
Msg-id | 3E7649B7.4060405@hotdogrecords.com Whole thread Raw |
Responses |
Re: Tomcat/Struts/Pooling?/Memory Sizes
|
List | pgsql-general |
Gang, Got a question about run-time postgresql memory usage. I'm moving over to this RedHat box from a shared sun server, so I'm doing some tweaking out of the system. I'm running pgsql 7.3 on a RedHat system (fairly recent- not sure of the version) that has 1Gb of memory. Using apache with tomcat 4.1.2/Struts/JDBC2 drivers. I have shared memory on the system set to 268435456 (roughly 256Mb). Tomcat/Struts (jdbc2) is configured to have 100 max connections (maxCount), minimum of 10 (minCount). The relevant parts of my postgresql config are: tcpip_socket = true max_connections = 128 shared_buffers = 30400 sort_mem = 32168 vacuum_mem = 32168 ...here's the output of top after the system runs for about an hour. When the system first starts, each postgres process is about 10 Mb big. 21154 postgres 15 0 75436 73M 73164 S 0.0 7.3 0:11 postmaster 21155 postgres 15 0 73224 71M 71444 S 0.0 7.0 0:07 postmaster 21160 postgres 15 0 70364 68M 68068 S 0.0 6.8 0:12 postmaster 21152 postgres 15 0 64380 62M 62516 S 0.0 6.2 0:04 postmaster 21159 postgres 15 0 64244 62M 62352 S 0.0 6.2 0:05 postmaster 21151 postgres 16 0 61816 60M 60048 S 0.0 5.9 0:05 postmaster 21157 postgres 15 0 54088 52M 52148 S 0.0 5.2 0:05 postmaster 21158 postgres 15 0 44840 43M 42604 S 0.0 4.3 0:11 postmaster 21156 postgres 15 0 39456 38M 37668 S 0.0 3.8 0:05 postmaster 21153 postgres 15 0 38980 38M 36912 S 0.0 3.7 0:04 postmaster 30772 postgres 15 0 9012 8912 7936 S 0.0 0.8 0:00 postmaster 4554 postgres 15 0 8952 8844 7868 S 0.0 0.8 0:00 postmaster 25019 postgres 15 0 8932 8832 7864 S 0.0 0.8 0:00 postmaster 4994 postgres 15 0 8928 8820 7836 S 0.0 0.8 0:00 postmaster 24654 postgres 15 0 8776 8680 7792 S 0.0 0.8 0:00 postmaster 4561 postgres 15 0 8536 8420 7556 S 0.0 0.8 0:00 postmaster 23142 postgres 15 0 8348 8268 7228 S 0.0 0.8 0:00 postmaster 4993 postgres 15 0 8332 8240 7200 S 0.0 0.7 0:00postmaster 30774 postgres 15 0 8936 7908 7864 S 0.0 0.7 0:00postmaster 25910 postgres 15 0 7968 7888 6824 S 0.0 0.7 0:00postmaster 26368 postgres 15 0 7288 7200 6268 S 0.0 0.6 0:00postmaster My question is- are these memory statistics that top is reporting all coming out of the shared memory space? Does postgresql only allocate memory out of the shared memory space, or does it also allocate memory out of the general system memory too? I'm just concerned because postgresql seems to be allocating a lot of memory. Do these configuration parameters jibe with what anyone else is running? Do I have too many maxConnections? Too little/much shared memory allocated? That said, the system seems to be running fine, but gets a little sluggish when the memory sizes get big (> 120Mb). ALSO- when I reload tomcat (not restart, but reload- well, okay, when I restart too), the memory sizes drop back down to normal levels. Am I not clearing out my database connections? I've done everything I can find on the web about clearing up DB connections properly, although with Struts doing its DB pooling thing behind the scenes, I really have no idea what its doing. Thanks, gang! /kurt
pgsql-general by date: