VIDEOCHAT  ::   FAQ  ::   Поиск  ::   Вход

Для индексации полезных и бесполезных разговоров

Разговоры на кухне
notify_ded_bot
Сообщения: 1
Зарегистрирован: 19 ноя 2024, 14:03

Cообщение от   Telegram-канал   anonymous

Сообщение notify_ded_bot »


щас бриф скину
notify_ded_bot
Сообщения: 1
Зарегистрирован: 19 ноя 2024, 14:03

Cообщение от   Telegram-канал   anonymous

Сообщение notify_ded_bot »


Просто я точил ессно под свой модуль, который имеет РЕСП-дверь
notify_ded_bot
Сообщения: 1
Зарегистрирован: 19 ноя 2024, 14:03

Cообщение от   Telegram-канал   anonymous

Сообщение notify_ded_bot »


Yes, func_perfd keeps a fixed pool of connections, shared by every call in the Asterisk process. It has no background thread.
What it is. A dialplan-function module in contrib/asterisk/, shipped as an optional menuselect module through a generated Asterisk 22.10.1 patch. It provides PERFD_GET, PERFD_SET, PERFD_EXISTS and PERFD_DELETE, and sets PERFDSTATUS to OK, NOTFOUND or ERROR. Everything else lives in perfd.conf: protocol, servers, secrets, pool size and timeouts.
The pool.
It has a fixed number of slots, pool, default 4 and at most 64.
Each slot holds one libperfd handle on the binary protocol, the default. Alternatively it holds one RESP session, to perfcached's Redis door or a standalone Redis behind a VIP. The protocol applies to the whole pool.
On load, each slot connects in turn and then the pool goes live. If no server answers, slots connect on first use instead.
On reload, a new pool is built and warmed, then swapped in atomically. Calls in flight finish on the old pool.
One call.
The channel's own dialplan thread puts the channel into autoservice, so media keeps flowing.
It borrows a free slot under a mutex, preferring one that is already connected.
If every slot is busy, it waits on a condition variable for up to wait_timeout_ms, default 300 ms. Otherwise the call fails with ERROR.
It makes exactly one synchronous request on that slot, releases the slot, updates the counters and wakes one waiter.
A slot is used by one thread at a time because a libperfd handle is single-threaded. A handle per call thread would reconnect on every call.
Sockets per Asterisk process. About pool times the number of fleet members. By default each libperfd handle keeps a link to every member: one active plus standbys. So a pool of 4 against 245-247 holds up to 12 TCP connections. spares caps the standbys.
Failover. libperfd fails over to a standby and retries inside the same call. A handle left in a failed state is re-dialled, or dropped and reopened by the next borrower, rotating through the configured servers. Connects are serialized by one global lock, because libperfd keeps its connect error in a process-wide buffer.
Upkeep. Member-list refresh and pings of idle standbys run inside libperfd after a successful call, on the borrowing thread. TCP keepalive is 30 s.
RESP mode. One TCP connection per slot. The selected Redis database is cached per connection. A broken link or a -READONLY reply, a stale link after a VIP failover, gets one reconnect and retry.
Limits and visibility. Connect timeout 1000 ms, I/O 300 ms, max_value 64 KB. A value containing a NUL byte, or over 4095 bytes inside dialplan substitution, is an ERROR. perfd show status shows the protocol, the servers, every slot with its node and failovers, and the counters. contrib/asterisk/CONFIGURATION.md documents every setting.
notify_ded_bot
Сообщения: 1
Зарегистрирован: 19 ноя 2024, 14:03

Cообщение от   Telegram-канал   anonymous

Сообщение notify_ded_bot »


Пре-подогреваем пул всегда
notify_ded_bot
Сообщения: 1
Зарегистрирован: 19 ноя 2024, 14:03

Cообщение от   Telegram-канал   anonymous

Сообщение notify_ded_bot »


Чтоб был готов
notify_ded_bot
Сообщения: 1
Зарегистрирован: 19 ноя 2024, 14:03

Cообщение от   Telegram-канал   anonymous

Сообщение notify_ded_bot »


И не тратить время на ТЦП-коннекты
notify_ded_bot
Сообщения: 1
Зарегистрирован: 19 ноя 2024, 14:03

Cообщение от   Telegram-канал   anonymous

Сообщение notify_ded_bot »


Вот кстати, напомнили. Интересный вопрос, для меня по крайней мере.
Кто как относится к хранению конфигов астера в БД для сравнительно не большого астериск без FreePBX? Имеет смысл или "дешевле" всё же простые текстовые конфиги?
notify_ded_bot
Сообщения: 1
Зарегистрирован: 19 ноя 2024, 14:03

Cообщение от   Telegram-канал   anonymous

Сообщение notify_ded_bot »

Вот кстати, напомнили. Интересный вопрос, для меня по крайней мере.
Кто как относится к хранению конфигов астера в БД для сравнительно не большого астериск без FreePBX? Имеет смысл или "дешевле" всё же простые текстовые конфиги?

Сами астериски отказались от pbx_realtime для диалплана. nuff said
notify_ded_bot
Сообщения: 1
Зарегистрирован: 19 ноя 2024, 14:03

Cообщение от   Telegram-канал   anonymous

Сообщение notify_ded_bot »


Это если мы про диалплан, канеш.
notify_ded_bot
Сообщения: 1
Зарегистрирован: 19 ноя 2024, 14:03

Cообщение от   Telegram-канал   anonymous

Сообщение notify_ded_bot »


Переведёшь? ?
Ответить
© 2008 — 2026 Asterisk.ru
Digium, Asterisk and AsteriskNOW are registered trademarks of Digium, Inc.
Design and development by PostMet-Netzwerk GmbH