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

Xiaobin Xu xuxb1979@REDACTED
Fri Aug 12 07:02:07 CEST 2011


Hi,

    First of all, is that necessary to log every SQL expression even if it
may successfully commit to the database? I suppose you could benefit from
"log only error" strategy.

    Although I don't really know prim_file thing, but from my personal
experience, you may use "lagger" or "log4erl" or the log modules from
"ejabbered", that may resolve your problem.


2011/8/7 达达 <bg5sbk@REDACTED>

> 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 :(
>
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20110812/ea448aad/attachment.htm>


More information about the erlang-questions mailing list