[erlang-questions] prim_file:translate_response/2 take very long time almost suspend

达达 bg5sbk@REDACTED
Sun Aug 7 10:05:33 CEST 2011


Hi.
 
In my game project, I use ETS mapping mysql and use two process sync the ETS table's changes to mysql.
 
One process generate SQL and write to a log file and then send SQL to another process to execute.
 
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.
 
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. :(
 
And when this happen, I always can get:
 
    {current_function,{prim_file,translate_response,2}}
 
by:
 
    process_info(SqlLogProc, current_function). 
 
I think something make the "translate_response" take very very long time so the log file write very very slow.
 
The log file open by:
 
    file:open(FileName, [append, raw, {delayed_write, 1024 * 1000 * 10, 6000}]).
 
and write by:
 
    file:write(File, SQL).
 
I use R14B3 on server.
 
Is it a bug of erlang's prim_file module? or what can I optimize?
 
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 :(
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20110807/003a9ea7/attachment.htm>


More information about the erlang-questions mailing list