|
Cannot allocate memory
|
|||
---|---|---|---|
#18+
Добрый день. Друзья, подскажите по механикам выделения памяти Постргесом. PG 12.3. Параметры виртуалки 4CPU, 8GB RAM. Много подключений, выполняющих короткие запросы, или в статусе Idle. Постоянно валятся ошибки Cannot allocate memory, Out of memory. Что ему надо? Конфиг Postgres max_connections = 515 shared_buffers = 2048MB huge_pages = try work_mem = 32MB dynamic_shared_memory_type = posix $ free -m total used free shared buff/cache available Mem: 7821 1862 3649 241 2309 5638 Swap: 8191 0 8191 Лог LOG: could not fork autovacuum worker process: Cannot allocate memory HOST: DB: USER: LOG: could not fork new process for connection: Cannot allocate memory PID:7567 HOST:192.168.0.12 DB:postgres USER:postgres FATAL: out of memory LOG: could not fork autovacuum worker process: Cannot allocate memory TopMemoryContext: 305968 total in 11 blocks; 42424 free (15 chunks); 263544 used smgr relation table: 16384 total in 2 blocks; 4600 free (2 chunks); 11784 used pgstat TabStatusArray lookup hash table: 8192 total in 1 blocks; 1456 free (0 chunks); 6736 used TopTransactionContext: 8192 total in 1 blocks; 6656 free (10 chunks); 1536 used TransactionAbortContext: 32768 total in 1 blocks; 32512 free (0 chunks); 256 used Portal hash: 8192 total in 1 blocks; 560 free (0 chunks); 7632 used TopPortalContext: 8192 total in 1 blocks; 7936 free (0 chunks); 256 used Relcache by OID: 16384 total in 2 blocks; 7672 free (2 chunks); 8712 used CacheMemoryContext: 262144 total in 6 blocks; 280 free (3 chunks); 261864 used index info: 1024 total in 1 blocks; 48 free (0 chunks); 976 used: pg_foreign_table_relid_index index info: 1024 total in 1 blocks; 48 free (0 chunks); 976 used: pg_type_oid_index index info: 1024 total in 1 blocks; 48 free (0 chunks); 976 used: pg_aggregate_fnoid_index index info: 1024 total in 1 blocks; 48 free (0 chunks); 976 used: pg_constraint_oid_index index info: 2048 total in 2 blocks; 760 free (2 chunks); 1288 used: pg_rewrite_rel_rulename_index index info: 2048 total in 2 blocks; 760 free (2 chunks); 1288 used: pg_ts_parser_prsname_index index info: 2048 total in 2 blocks; 760 free (2 chunks); 1288 used: pg_ts_config_cfgname_index index info: 1024 total in 1 blocks; 48 free (0 chunks); 976 used: pg_ts_parser_oid_index index info: 2048 total in 2 blocks; 728 free (1 chunks); 1320 used: pg_publication_rel_prrelid_prpubid_index index info: 1024 total in 1 blocks; 48 free (0 chunks); 976 used: pg_operator_oid_index index info: 1024 total in 1 blocks; 48 free (0 chunks); 976 used: pg_namespace_nspname_index index info: 1024 total in 1 blocks; 48 free (0 chunks); 976 used: pg_ts_template_oid_index index info: 2048 total in 2 blocks; 704 free (3 chunks); 1344 used: pg_amop_opr_fam_index index info: 2048 total in 2 blocks; 672 free (3 chunks); 1376 used: pg_default_acl_role_nsp_obj_index index info: 2048 total in 2 blocks; 704 free (3 chunks); 1344 used: pg_collation_name_enc_nsp_index index info: 1024 total in 1 blocks; 48 free (0 chunks); 976 used: pg_publication_rel_oid_index index info: 1024 total in 1 blocks; 48 free (0 chunks); 976 used: pg_range_rngtypid_index index info: 2048 total in 2 blocks; 760 free (2 chunks); 1288 used: pg_ts_dict_dictname_index index info: 2048 total in 2 blocks; 760 free (2 chunks); 1288 used: pg_type_typname_nsp_index index info: 1024 total in 1 blocks; 48 free (0 chunks); 976 used: pg_opfamily_oid_index index info: 1024 total in 1 blocks; 48 free (0 chunks); 976 used: pg_statistic_ext_oid_index index info: 1024 total in 1 blocks; 16 free (0 chunks); 1008 used: pg_statistic_ext_data_stxoid_index index info: 1024 total in 1 blocks; 48 free (0 chunks); 976 used: pg_class_oid_index index info: 2048 total in 2 blocks; 704 free (3 chunks); 1344 used: pg_proc_proname_args_nsp_index index info: 1024 total in 1 blocks; 16 free (0 chunks); 1008 used: pg_partitioned_table_partrelid_index index info: 2048 total in 2 blocks; 760 free (2 chunks); 1288 used: pg_transform_type_lang_index index info: 2048 total in 2 blocks; 760 free (2 chunks); 1288 used: pg_attribute_relid_attnum_index index info: 1024 total in 1 blocks; 48 free (0 chunks); 976 used: pg_proc_oid_index index info: 1024 total in 1 blocks; 48 free (0 chunks); 976 used: pg_language_oid_index index info: 1024 total in 1 blocks; 48 free (0 chunks); 976 used: pg_namespace_oid_index index info: 3072 total in 2 blocks; 1216 free (3 chunks); 1856 used: pg_amproc_fam_proc_index index info: 1024 total in 1 blocks; 48 free (0 chunks); 976 used: pg_foreign_server_name_index index info: 2048 total in 2 blocks; 760 free (2 chunks); 1288 used: pg_attribute_relid_attnam_index index info: 1024 total in 1 blocks; 48 free (0 chunks); 976 used: pg_conversion_oid_index index info: 2048 total in 2 blocks; 728 free (1 chunks); 1320 used: pg_user_mapping_user_server_index index info: 2048 total in 2 blocks; 728 free (1 chunks); 1320 used: pg_subscription_rel_srrelid_srsubid_index index info: 1024 total in 1 blocks; 48 free (0 chunks); 976 used: pg_sequence_seqrelid_index index info: 2048 total in 2 blocks; 760 free (2 chunks); 1288 used: pg_conversion_name_nsp_index index info: 2048 total in 2 blocks; 952 free (1 chunks); 1096 used: pg_authid_oid_index index info: 2048 total in 2 blocks; 648 free (1 chunks); 1400 used: pg_auth_members_member_role_index index info: 1024 total in 1 blocks; 48 free (0 chunks); 976 used: pg_subscription_oid_index index info: 1024 total in 1 blocks; 48 free (0 chunks); 976 used: pg_tablespace_oid_index index info: 2048 total in 2 blocks; 704 free (3 chunks); 1344 used: pg_shseclabel_object_index index info: 1024 total in 1 blocks; 16 free (0 chunks); 1008 used: pg_replication_origin_roname_index index info: 2048 total in 2 blocks; 952 free (1 chunks); 1096 used: pg_database_datname_index index info: 2048 total in 2 blocks; 760 free (2 chunks); 1288 used: pg_subscription_subname_index index info: 1024 total in 1 blocks; 16 free (0 chunks); 1008 used: pg_replication_origin_roiident_index index info: 2048 total in 2 blocks; 728 free (1 chunks); 1320 used: pg_auth_members_role_member_index index info: 1024 total in 1 blocks; 48 free (0 chunks); 976 used: pg_database_oid_index index info: 2048 total in 2 blocks; 952 free (1 chunks); 1096 used: pg_authid_rolname_index WAL record construction: 49768 total in 2 blocks; 6368 free (0 chunks); 43400 used PrivateRefCount: 8192 total in 1 blocks; 2624 free (0 chunks); 5568 used MdSmgr: 8192 total in 1 blocks; 7936 free (0 chunks); 256 used LOCALLOCK hash: 8192 total in 1 blocks; 560 free (0 chunks); 7632 used Timezones: 104120 total in 2 blocks; 2624 free (0 chunks); 101496 used Postmaster: 16384 total in 2 blocks; 15240 free (12 chunks); 1144 used ident parser context: 1024 total in 1 blocks; 768 free (0 chunks); 256 used hba parser context: 17408 total in 5 blocks; 3720 free (5 chunks); 13688 used ErrorContext: 8192 total in 1 blocks; 7936 free (5 chunks); 256 used Grand total: 964688 bytes in 116 blocks; 171712 free (100 chunks); 792976 used PID:7573 HOST:192.168.0.12 DB:postgres USER:postgres FATAL: out of memory PID:7573 HOST:192.168.0.12 DB:postgres USER:postgres DETAIL: Failed on request of size 140 in memory context "CacheMemoryContext". ... |
|||
:
Нравится:
Не нравится:
|
|||
10.02.2022, 17:50 |
|
Cannot allocate memory
|
|||
---|---|---|---|
#18+
Код: plsql 1.
? ... |
|||
:
Нравится:
Не нравится:
|
|||
11.02.2022, 14:05 |
|
Cannot allocate memory
|
|||
---|---|---|---|
#18+
pg000, пусто ... |
|||
:
Нравится:
Не нравится:
|
|||
11.02.2022, 14:11 |
|
Cannot allocate memory
|
|||
---|---|---|---|
#18+
Код: sql 1.
... |
|||
:
Нравится:
Не нравится:
|
|||
11.02.2022, 15:06 |
|
Cannot allocate memory
|
|||
---|---|---|---|
#18+
Guzya, Код: plsql 1.
Код: plsql 1. 2.
... |
|||
:
Нравится:
Не нравится:
|
|||
11.02.2022, 15:25 |
|
Cannot allocate memory
|
|||
---|---|---|---|
#18+
dmitry7, возможно Вам стоит посмотреть в сторону пулов соединений (pgbouncer например). Что еще стоит на сервере подъедающее память? ... |
|||
:
Нравится:
Не нравится:
|
|||
11.02.2022, 15:37 |
|
Cannot allocate memory
|
|||
---|---|---|---|
#18+
Guzya, на сервере кроме СУБД больше ничего не установлено. ОС Ubuntu. В сторону пула для соединений движемся, но пока использовать его возможности нет. Я знаю, что PG плохо работает с большим количеством соединений. ... |
|||
:
Нравится:
Не нравится:
|
|||
11.02.2022, 15:42 |
|
Cannot allocate memory
|
|||
---|---|---|---|
#18+
Гугление показало, что надо посмотреть Код: sql 1. 2.
Код: sql 1. 2. 3.
... |
|||
:
Нравится:
Не нравится:
|
|||
11.02.2022, 15:49 |
|
Cannot allocate memory
|
|||
---|---|---|---|
#18+
dmitry7 Guzya, на сервере кроме СУБД больше ничего не установлено. ОС Ubuntu. В сторону пула для соединений движемся, но пока использовать его возможности нет. Я знаю, что PG плохо работает с большим количеством соединений. умножаем max_connections = 515 * work_mem = 32MB получаем 16480MB = 16GB памяти имеем 8GB (а реально 6GB так как shared_buffers) а чего вы хотите то тогда? или work_mem 4MB ставьте или лимит на коннекты 100 или прекратите использовать в качестве сервера виртуалки в 4ре раза слабее по памяти чем мой ноут рабочий. -- Maxim Boguk лучшая поддержка PostgreSQL: dataegret.ru ... |
|||
:
Нравится:
Не нравится:
|
|||
11.02.2022, 16:01 |
|
Cannot allocate memory
|
|||
---|---|---|---|
#18+
Maxim Boguk, Про СУБД на калькуляторе понятно. И тем не менее, почему он swap не использует? Вот пример с другого сервера. 267 cсесиий Idle. Код: sql 1. 2. 3. 4.
Код: sql 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. 23. 24. 25. 26. 27. 28. 29. 30. 31. 32. 33. 34. 35. 36. 37. 38. 39. 40. 41. 42.
... |
|||
:
Нравится:
Не нравится:
|
|||
16.02.2022, 09:49 |
|
Cannot allocate memory
|
|||
---|---|---|---|
#18+
Если я правильно понимаю, то выставлен лимит в ~11Гб (CommitLimit: 12327560 kB) Ознакомьтесь fork: Cannot allocate memory ... |
|||
:
Нравится:
Не нравится:
|
|||
16.02.2022, 10:11 |
|
|
start [/forum/topic.php?fid=53&msg=40133521&tid=1993658]: |
0ms |
get settings: |
10ms |
get forum list: |
12ms |
check forum access: |
3ms |
check topic access: |
3ms |
track hit: |
29ms |
get topic data: |
11ms |
get forum data: |
3ms |
get page messages: |
46ms |
get tp. blocked users: |
1ms |
others: | 271ms |
total: | 389ms |
0 / 0 |