[erlang-questions] Does some system call block many processes?

Sean Cribbs sean@REDACTED
Tue Aug 12 04:54:51 CEST 2014


What database are you referring to? If it's an external database, then
it likely uses TCP sockets for communication, meaning that it will use
the already non-blocking built-in inet driver.

An improperly designed NIF or linked-in driver *could* block the
scheduler. At Basho we have experienced this problem, and have the
scars to show for it. Search the mailing list archives for "scheduler
collapse" (especially the messages from Scott Fritchie) and you'll
find a wealth of discussion on the matter. More recent versions of
Erlang are less susceptible to this problem, thanks to interruptible
BIFs and a host of other arcane scheduler tweaks I don't understand.

Usually, other system problems cause Erlang nodes to be unresponsive.
Is your system out of memory and using swap space? Do you have faulty
disk drives? Is your network saturated?

On Mon, Aug 11, 2014 at 9:11 PM, Bin Wang <wbin00@REDACTED> wrote:
> Such as database operations. Is it possible that the driver uses some
> IO calls that blocked the processes?
>
> 2014-08-12 9:25 GMT+08:00 Sean Cribbs <sean@REDACTED>:
>> Generally, no. The most expensive system calls (usually IO) will use
>> kqueue, epoll, or select (the first two if you use the "+K true" flag
>> on the command line). Other calls may use async threads so that they
>> do not block the scheduler. What system calls are you trying to
>> perform?
>>
>> On Mon, Aug 11, 2014 at 8:12 PM, Bin Wang <wbin00@REDACTED> wrote:
>>> Hi,
>>>
>>> I know there are some system calls that will block the whole OS
>>> thread. While multi Erlang processes may running on one OS thread. So
>>> if one of the process call a block system call, will all the processes
>>> running on the same thread block?
>>>
>>> Thanks.
>>>
>>> ---
>>> Bin Wang
>>> _______________________________________________
>>> erlang-questions mailing list
>>> erlang-questions@REDACTED
>>> http://erlang.org/mailman/listinfo/erlang-questions
>>
>>
>>
>> --
>> Sean Cribbs <sean@REDACTED>
>> Software Engineer
>> Basho Technologies, Inc.
>> http://basho.com/



-- 
Sean Cribbs <sean@REDACTED>
Software Engineer
Basho Technologies, Inc.
http://basho.com/



More information about the erlang-questions mailing list