[erlang-questions] Obsolete exported functions file:raw_{read, write}_file_info/2 - why?

Attila Rajmund Nohl attila.r.nohl@REDACTED
Wed Sep 14 19:37:36 CEST 2011


2011/9/14, Scott Lystig Fritchie <fritchie@REDACTED>:
> Joseph Norton <norton@REDACTED> wrote:
>
> jn> I'm curious if someone happens to know why the
> jn> file:raw_read_file_info/1 and file:raw_read_file_info/2 methods were
> jn> made obsolete?
>
> Joe, I stumbled across those functions while putting DTrace probes into
> the efile_drv driver.  I thought, hey, those would be quite useful.
>
> I recommend reading the file.erl source.  It's quite instructive to see
> how many file I/O functions are redirected to the 'file_server_2'
> process.  For file I/O-intensive applications (e.g. Hibari and Riak I
> know, CouchDB and RabbitMQ I'd guess), having all calls to(*)
> file:read_file_info/1 serialized by the file server process is a source
> of latency that we (DB authors) may desire to live without.

That's interesting. I was also chasing a performance problem a couple
of weeks ago (the server crawled to a halt for a minute or two, the
load of the Linux OS went over 50, then everything went back to
normal) and noticed that the file_server process used a lot of CPU. My
solution(?) was to randomize the jobs that would write to the disk, so
the 30 processes tried not to write to the disk at the same time.



More information about the erlang-questions mailing list