Приложение I. Настройка Postgres Pro для решений 1С
Вы можете установить и использовать Postgres Pro с решениями 1С в клиент/серверной модели. Для оптимальной производительности и стабильности измените следующие параметры в конфигурационном файле postgresql.conf сервера Postgres Pro:
Увеличьте максимально возможное число одновременных подключений к серверу баз данных до 1000. Решения 1С могут открывать большое количество соединений, даже если все они не нужны, так что рекомендуется разрешить на сервере не менее 500 подключений.
max_connections = 1000
Чтобы временные таблицы работали корректно, измените следующие параметры:
Увеличьте размер буфера для временных таблиц:
temp_buffers = 32MB
Увеличьте число допустимых в одной транзакции блокировок таблиц или индексов до 256:
max_locks_per_transaction = 256
Обычно решения 1C используют множество временных таблиц. Такие таблицы в большом количестве используются каждым обслуживающим процессом. Закрывая соединение, Postgres Pro пытается удалить все временные таблицы в одной транзакции, при этом транзакция может запрашивать множество блокировок. Если число блокировок превысит значение
max_locks_per_transaction, транзакция прервётся и оставит за собой множество потерянных временных таблиц.
Включите экранирование символом обратной косой черты для всех строк и выключите предупреждение об использовании этого символа:
standard_conforming_strings = off escape_string_warning = off
Задайте параметр
effective_cache_sizeравным минимум половине объёма ОЗУ, доступного в системе. Эффективность оптимизатора запросов Postgres Pro зависит от выделенного ему объёма ОЗУ.Оптимизируйте планирование запросов с помощью расширений
online_analyzeиplantuner:Добавьте
online_analyzeиplantunerв переменнуюshared_preload_libraries.shared_preload_libraries = 'online_analyze, plantuner'
Включите автоматический анализ временных таблиц при их модификации:
online_analyze.table_type = 'temporary'
Настройте оптимизатор Postgres Pro для улучшенного планирования запросов с недавно созданными пустыми таблицами:
plantuner.fix_empty_table = 'on'
Отключите подробные сообщения расширения
online_analyze:online_analyze.verbose = 'off'
Appendix I. Configuring Postgres Pro for 1C Solutions
You can install and use Postgres Pro with 1C solutions in a client/server model. For optimal performance and stability, modify the following settings in the postgresql.conf configuration file of Postgres Pro server:
Increase the maximum number of allowed concurrent connections to the database server, up to 1000 connections. 1C solutions can open a large number of connections, even if not all of them are used, so it is recommended to allow not less than 500 connections.
max_connections = 1000
To ensure that temporary tables are handled correctly, modify the following parameters:
Increase the buffer size for temporary tables:
temp_buffers = 32MB
Increase the number of allowed locks of tables or indexes per transaction to 256:
max_locks_per_transaction = 256
Typically, 1C solutions use a lot of temporary tables. Every backend process usually contains multiple temporary tables. When closing a connection, Postgres Pro tries to drop all temporary tables in a single transaction, so this transaction may use a lot of locks. If the number of locks exceeds the
max_locks_per_transactionvalue, the transaction will fail, leaving multiple orphaned temporary tables.
Enable backslash escapes in all strings, and switch off the warning about using the backslash escape symbol:
standard_conforming_strings = off escape_string_warning = off
Set the
effective_cache_sizeparameter to at least half of RAM available on the system. Postgres Pro query optimizer performance depends on the amount of allocated RAM.Optimize query planning using
online_analyzeandplantunerextensions, as follows:Add
online_analyzeandplantunerto theshared_preload_librariesvariable.shared_preload_libraries = 'online_analyze, plantuner'
Enable automatic analysis of temporary tables when they are modified:
online_analyze.table_type = 'temporary'
Tune Postgres Pro optimizer to improve planning for recently created empty tables:
plantuner.fix_empty_table = 'on'
Suppress detailed messages from the
online_analyzeextension:online_analyze.verbose = 'off'