On 16/04/14 11:24, Juha Heinanen wrote:
Daniel-Constantin Mierla writes:
Default value is 0 (no INSERT DELAYED).
daniel,
just to clarity, is there some relationship between INSERT DELAYED and
async insert?
No.
good. so perhaps the comment on default value could be
(no INSERT
DELAYED nor async insert is used).
You can enhance the docs as you consider more
clear -- the possible
values are listed in the same section.
The mechanism behind async insert is as follow:
- the INSERT query is printed by the process that does the db operation
- the mysql module instead of sending the query to mysql server, clones
it in shared memory and sends it to the group of async workers
- one of the workers reads the task and sends the query to the database
server
does there need to be a free async worker to serve the request or are
the requests buffered so that the sender of the request is always
immediately free to go on with other business?
The sender is immediately free. The request is queued in the internal
socket (used to pass only the pointer to shared memory query) and will
be handled by first async worker. In other words, the sender does like
an 'udp send', but via a reliable socket.
To have the above working, the db_url is also
cloned and sent to async
workers in order to identify the right connection to use. The first idle
async worker is receiving the task (it is kernel based, the same
mechanism used for many processes reading on the same UDP socket). You
have to specify the number of async workers via global parameter
async_workers:
-
http://www.kamailio.org/wiki/cookbooks/devel/core#async_workers that would have
been my next question. if someone only reads
acc/README, it does not mention a need set async_workers > 0 in order to
benefit from db_insert_mode=2.
You can add a note about this as well, if you put
more content in the
docs for this parameter.
Cheers,
Daniel
--
Daniel-Constantin Mierla -
http://www.asipto.com
http://twitter.com/#!/miconda -
http://www.linkedin.com/in/miconda