[tarantool-patches] Re: [PATCH 1/2] swim: pool IO tasks

Vladislav Shpilevoy v.shpilevoy at tarantool.org
Tue Jul 9 01:13:13 MSK 2019


>>>>
>>>>>
>>>>> Why not use mempool?
>>>>>
>>>>>
>>>>
>>>> Because 1) it is an overkill, 2) I don't want to depend on
>>>> slab allocator, 3) it just does not fit this case, according
>>>> to mempool description from mempool.h:
>>>>
>>>>     "Good for allocating tons of small objects of the same size.".
>>>
>>> It is also quite decent for allocating many fairly large objects.
>>> The key point is that the object is of the same size. You can set
>>> up mempool the right slab size, and in this case it will do
>>> exactly what you want.
>>>
>>
>> And again - 'many' usually won't be the case. We will have 0-2 SWIMs
>> in 99% of cases. One internal SWIM for box, and one external created
>> by a user. Barely we will have more than 10 cached tasks.
>>
>> But ok, as you wish. This place is not as critical for me as thread
>> locality of the pool. At least we reuse existing code. Thread locality
>> still looks pointless waste of memory for me.
> 
> OK, wait a second. I thought you're going to have a single task
> instance for each member. Which means a couple of dozen instances
> even in a two node cluster. Am I wrong? 
> 

Yes, you misunderstood something. This is the whole point of this
commit - make number of tasks not depending on a number of members.
On the master branch now the number of tasks per SWIM is linear of
cluster size - it is terrible. Both 1 and 2 tasks per member are
linear.

But network load per one instance does not depend on number of members,
so we can make number of tasks independent from cluster size. I am trying
to reuse a small set of tasks for all members of one instance. Just
imagine - a SWIM instance knows about 500 members, and manages to work
with them using just 2-10 messages at once.




More information about the Tarantool-patches mailing list