Skip to end of metadata
Go to start of metadata

(lightbulb) We give here basic recommendations what to set on a server running openBIS concerning memory usage. There might be better memory settings for your specific use case.

We distinguish between four classes of servers, based on available RAM.

Java settings for openBIS Application Server:

Server RAM

-Xmx

-Xms

XX:MaxPermSize

4G

2G

512M

256M

8G

4G

512M

256M

16G

4G

512M

512M

32G

8G

1G

512M

Java settings for openBIS Data Store Server:

Server RAM

-Xmx

-Xms

XX:MaxPermSize

4G

512M

128M

64M

8G

512M

128M

128M

16G

1G

256M

128M

32G

2G

256M

128M

Xmx: maximum java heap size
Xms: initial java heap size

-XX:MaxPermSize=64m Size of the Permanent Generation. (5.0 and newer: 64 bit VMs are scaled 30% larger; 1.4 amd64: 96m; 1.3.1 -client: 32m.)

Postgres settings:

Please have a look here for possible memory settings

Descriptions of each parameter:

shared_buffers (integer)
Sets the amount of memory the database server uses for shared memory buffers. The default is typically 32 megabytes (32MB), but might be less if your kernel settings will not support it (as determined during initdb). This setting must be at least 128 kilobytes. (Non-default values of BLCKSZ change the minimum.) However, settings significantly higher than the minimum are usually needed for good performance. Several tens of megabytes are recommended for production installations. This parameter can only be set at server start.

effective_cache_size (integer)
Sets the planner's assumption about the effective size of the disk cache that is available to a single query. This is factored into estimates of the cost of using an index; a higher value makes it more likely index scans will be used, a lower value makes it more likely sequential scans will be used. When setting this parameter you should consider both PostgreSQL's shared buffers and the portion of the kernel's disk cache that will be used for PostgreSQL data files. Also, take into account the expected number of concurrent queries on different tables, since they will have to share the available space. This parameter has no effect on the size of shared memory allocated by PostgreSQL, nor does it reserve kernel disk cache; it is used only for estimation purposes. The default is 128 megabytes (128MB).

work_mem (integer)
Specifies the amount of memory to be used by internal sort operations and hash tables before switching to temporary disk files. The value defaults to one megabyte (1MB). Note that for a complex query, several sort or hash operations might be running in parallel; each one will be allowed to use as much memory as this value specifies before it starts to put data into temporary files. Also, several running sessions could be doing such operations concurrently. So the total memory used could be many times the value of work_mem; it is necessary to keep this fact in mind when choosing the value. Sort operations are used for ORDER BY, DISTINCT, and merge joins. Hash tables are used in hash joins, hash-based aggregation, and hash-based processing of IN subqueries.

maintenance_work_mem (integer)
Specifies the maximum amount of memory to be used in maintenance operations, such as VACUUM, CREATE INDEX, and ALTER TABLE ADD FOREIGN KEY. It defaults to 16 megabytes (16MB). Since only one of these operations can be executed at a time by a database session, and an installation normally doesn't have many of them running concurrently, it's safe to set this value significantly larger than work_mem. Larger settings might improve performance for vacuuming and for restoring database dumps.

Note that when autovacuum runs, up to autovacuum_max_workers times this memory may be allocated, so be careful not to set the default value too high.

Example output of memory settings:

postgres=#  show shared_buffers; show effective_cache_size; show work_mem; show maintenance_work_mem;
 shared_buffers
----------------
 512MB
(1 row)

 effective_cache_size
----------------------
 1GB
(1 row)

 work_mem
----------
 1MB
(1 row)

 maintenance_work_mem
----------------------
 16MB
(1 row)
Labels
  • None