Thursday, May 29, 2008

Re: [HACKERS] [PERFORM] Memory question on win32 systems



Sabbiolina wrote:
On Thu, May 29, 2008 at 2:11 AM, Douglas McNaught <doug@mcnaught.org> wrote:
On Wed, May 28, 2008 at 7:05 PM, Sabbiolina <sabbiolina@gmail.com> wrote:
> Hello, in my particular case I need to configure Postgres to handle only a
> few concurrent connections, but I need it to be blazingly fast, so I need it
> to cache everything possible. I've changed the config file and multiplied
> all memory-related values by 10, still Postgres uses only less than 50 Mb of
> my RAM.

How are you measuring this?

Task Manager



> I have 4 Gigs of RAM, how do I force Postgres to use a higher part of such
> memory in order to cache more indexes, queries and so on?

Post the settings values you're using and people will be better able
to help you.

-Doug



config:
port = 5432                # (change requires restart)
max_connections = 50                    # (change requires restart)

shared_buffers = 320MB            # min 128kB or max_connections*16kB
temp_buffers = 80MB            # min 800kB
max_prepared_transactions = 10        # can be 0 or more
work_mem = 10MB                # min 64kB
maintenance_work_mem = 160MB        # min 1MB
Max_stack_depth = 20MB            # min 100kB
max_fsm_pages = 2048000            # min max_fsm_relations*16, 6 bytes each
max_fsm_relations = 10000        # min 100, ~70 bytes each
shared_preload_libraries = '$libdir/plugins/plugin
_debugger.dll'        # (change requires restart)
wal_buffers = 640kB            # min 32kB

log_destination = 'stderr'        # Valid values are combinations of
logging_collector = on        # Enable capturing of stderr and csvlog
log_line_prefix = '%t '            # special values:

datestyle = 'iso, dmy'
lc_messages = 'Italian_Italy.1252'            # locale for system error message
lc_monetary = 'Italian_Italy.1252'            # locale for monetary formatting
lc_numeric = 'Italian_Italy.1252'            # locale for number formatting
lc_time = 'Italian_Italy.1252'                # locale for time formatting
default_text_search_config = 'pg_catalog.italian'
Need to Use Performance monitor and Process Explorer to track down the caching on windows machines and performance.

Postgresql does not work like MS SQL where when it start ups grabs a large chuck memory that it uses to keep  last  X number of queries along with the indexes and tables in memory then its pushed out only when new queries that completely different need the memory.

To my understanding Postgresql only caches queries and results in memory for that specific connection.  So when that connection is closed those cached results are cleared out.    So cached indexs and queries are for that connection only.   I hope my understanding is correct.

No comments: