Asterisk taskprocessor

From 탱이의 잡동사니
Jump to: navigation, search

Overview

Asterisk taskprocessor 내용 정리.

Basic

Asterisk 에서는 여러 처리작업을 수행하기 위해 task processor 라는 내부 thread 를 이용하는데, 각각의 이름마다 하는 역할이 정해져 있다.

Task processors

pjsip/aor/<aor-name>

Task processor created by res_pjsip_registrar.so for incoming endpoint registrations. Asterisk v13.10.0 eliminated these task processors to continue using the pjsip/distributor task processor the REGISTER request came in on.

pjsip/default

Task processor created by res_pjsip.so. Miscellaneous PJSIP tasks that don't have any other association. Theses task processors are assigned tasks in a round robin sequence.

Before Asterisk v13.10.0 these task processors also handled the initial PJSIP message distribution if the message was not associated with any other task processor.

pjsip/distributor

Task processor created by res_pjsip.so. PJSIP distributor incoming messages to these task processors if the message is not associated with any other task processor. The task processor assignment is determined by hashing the SIP rquest's Call-ID and from tag. These task processors are new since Asterisk v13.10.0.

Asterisk-15.7.2 에서 문제가 발생했었다. 갑자기 대용량 트래픽을 수용하면서, 이전에는 없던 문제가 발생했었는데, Incoming traffic 에 대해서 정상적으로 Queued task 가 처리되지 않고 계속 늘어나는 현상이 발생했다. 어떤 부분에서 무엇인가가 Deadlock 을 만들어서 발생하는 문제같았다. 결국 Asterisk-15.7.2 버전에서는 해결하지 못하고 Asterisk-16.4.0 버전으로 업그레이드를 했다. 업그레이드 후 문제가 발생하지 않았다.

Processor                                      Processed   In Queue  Max Depth  Low water High water
pjsip/distributor-0000002d                          2822        899          4        450        500

pjsip/messaging

Task processor created by res_pjsip_messaging.so to send all out-of-dialog MESSAGE requests for PJSIP.

pjsip/outreg/<endpoint>

Task processor created by res_pjsip_outbound_registration.so to handle the endpoint's outbound registration message.

pjsip/session/<endpoint>

Task processor created by res_pjsip_session.so to handle incoming and outgoing sessions and their associated dialog messages. Asterisk v13.10.0 renamed the task processors for outgoing sessions to pjsip/outsess/<endpoint>. The task processors for incoming sessions were eliminated to continue using the pjsip/distributor task processor the initial INVITE came in on.

pjsip/outsess/<endpoint>

Task processor created by res_pjsip_session.so to handle messages associated with the endpoint's outgoing session(Outgoing channels). This includes any messages associated with the session's dialog.

pjsip/pubsub/<endpoint>

Task processor created by res_pjsip_pubsub.so to handle the endpoint's outbound PUBLISH and SUBSCRIBE dialog messages. Asterisk v13.10.0 stopped using these task processors for incoming PUBLISH and SUBSCRIBE dialogs to continue using the pjsip/distributor task processor the original request came in on.

pjsip/refer/<endpoint>

Task processor created by res_pjsip_refer.so to handle the endpoint's outbound REFER requests.

pjsip/websocket

Task processor created by res_pjsip_transport_websocket.so to process WebRTC HTTP requests for PJSIP.

sorcery/<type>

Used to sorcery observer callbacks. Sorcery task processors use a self managed thread pool.

subm:<topic>

Stasis topic subscription mailbox. The task processor has a dedicated thread to process the task queue.

subp:<topic>

Stasis topic subscription thread pool mailbox. The task processor uses an available thread from the stasis thread pool to process the task queue.

Reference