<P>Hi.</P>
<P>In my game project, I use ETS mapping mysql and use two process sync the ETS table's changes to mysql.</P>
<P>One process generate SQL and write to a log file and then send SQL to another process to execute.</P>
<P>In recent days, I got a problem. After some unknow thing happen (look like always happen on busy node). The SQL log process run into very very slow and no recovery.</P>
<P>When this happen, I must disconnect all players and suspend the SQL log process and copy the messages to SQL execute process, after all action sync, restart the node. :(</P>
<P>And when this happen, I always can get:</P>
<P> {current_function,{prim_file,translate_response,2}}</P>
<P>by:</P>
<P> process_info(SqlLogProc, current_function). </P>
<P>I think something make the "translate_response" take very very long time so the log file write very very slow.</P>
<P>The log file open by:</P>
<P> file:open(FileName, [append, raw, {delayed_write, 1024 * 1000 * 10, 6000}]).</P>
<P>and write by:</P>
<P> file:write(File, SQL).</P>
<P>I use R14B3 on server.</P>
<P>Is it a bug of erlang's prim_file module? or what can I optimize?</P>
<P>I have 350+ game server node and add 15 ~ 20 node every day, this problem happens on 1 ~ 2 node every day, and make me crazy I need sleep :(</P>