[erlang-questions] [HEADS UP] Emysql driver

Loïc Hoguin essen@REDACTED
Fri Jul 5 17:43:21 CEST 2013


It depends on the accept frequency you need. Measure. The examples and 
guide use 100 which work good enough in most cases but there's no 
optimal value for everyone.

On 07/05/2013 05:42 PM, Barco You wrote:
> Then what should be a good number of acceptors and max_connections?
> depending on hardware?  Can have 1 acceptor and thousands of
> max_connections? Is it only max_connections that determines the concurrency?
>
> On 5 Jul 2013 23:26, "Loïc Hoguin" <essen@REDACTED
> <mailto:essen@REDACTED>> wrote:
>
>     On 07/05/2013 03:34 PM, Barco You wrote:
>
>         Thank you all.
>
>         Whats the maximum connections can it bear when add a pool? If I use
>         Cowboy to provide a REST API for data query and I start up the http
>         listener with 10000 acceptors and 10000 emysql connections, does
>         that
>         mean i can support 10000 concurrency?
>
>
>     Not answering your question.
>
>     Acceptors aren't the maximum number of connections, it's the
>     processes doing the actual accept. They're only configurable to
>     allow tweaking performance, and with 10000 you will accept slower,
>     that's too much. The setting you probably meant is max_connections.
>
>         On 5 Jul 2013 14:35, "Mike Oxford" <moxford@REDACTED
>         <mailto:moxford@REDACTED>
>         <mailto:moxford@REDACTED <mailto:moxford@REDACTED>>> wrote:
>
>              emysql_util also has some other methods ... as_record/1,
>              as_proplist/1, as_dict/1
>              Those will clean up the raw output into something far more
>              usable/accessible.
>
>              -mox
>
>              On Thu, Jul 4, 2013 at 2:12 AM, Barco You
>         <barcojie@REDACTED <mailto:barcojie@REDACTED>
>              <mailto:barcojie@REDACTED <mailto:barcojie@REDACTED>>> wrote:
>
>                  Where can I find the detailed description about the
>         fields for
>                  result_packet?
>
>                  The result_pakcet looks like {result_packet, Number, List1,
>                  List2, <<>>}, and seemingly only List2 is meaningful.
>         Why is
>                  there Number, List1 and <<>> ?
>
>
>                  On Thu, Jul 4, 2013 at 4:37 PM, Barco You
>         <barcojie@REDACTED <mailto:barcojie@REDACTED>
>                  <mailto:barcojie@REDACTED
>         <mailto:barcojie@REDACTED>>> wrote:
>
>                      What is this part as following for?
>
>
>         [{field,2,<<"def">>,<<"__fangchan">>,<<"user">>,<<"__user">>,
>
>                        <<"userid">>,<<"userid">>,8,<<__>>,63,20,16899,0},
>
>
>         {field,3,<<"def">>,<<"__fangchan">>,<<"user">>,<<"__user">>,
>
>                        <<"name">>,<<"name">>,254,<<>>__,33,36,20489,0},
>
>
>         {field,4,<<"def">>,<<"__fangchan">>,<<"user">>,<<"__user">>,
>
>                        <<"id_no">>,<<"id_no">>,254,<<__>>,33,54,20481,0},
>
>
>         {field,5,<<"def">>,<<"__fangchan">>,<<"user">>,<<"__user">>,
>
>         <<"sex">>,<<"sex">>,1,<<>>,63,__1,0,0},
>
>
>         {field,6,<<"def">>,<<"__fangchan">>,<<"user">>,<<"__user">>,
>
>         <<"age">>,<<"age">>,2,<<>>,63,__6,0,0},
>
>
>         {field,7,<<"def">>,<<"__fangchan">>,<<"user">>,<<"__user">>,
>
>         <<"tel">>,<<"tel">>,254,<<>>,__33,33,0,0},
>
>
>         {field,8,<<"def">>,<<"__fangchan">>,<<"user">>,<<"__user">>,
>
>                        <<"email">>,<<"email">>,253,<<__>>,33,132,0,0}],
>
>
>                      On Thu, Jul 4, 2013 at 4:35 PM, Barco You
>                      <barcojie@REDACTED <mailto:barcojie@REDACTED>
>         <mailto:barcojie@REDACTED <mailto:barcojie@REDACTED>>> wrote:
>
>                          Solved, the bind-address of mhysql should be
>         changed to
>                          0.0.0.0
>
>                          But the result packet of emysql:execute looks very
>                          verbose and fuzzy. How can I get only the clean
>         field
>                          value or a row, like {field, value} ?
>
>                          emysql:execute(db_pool, <<"select * from user
>         where tel
>                          = 13761975289">>).
>                          {result_packet,11,
>
>
>         [{field,2,<<"def">>,<<"__fangchan">>,<<"user">>,<<"__user">>,
>
>
>         <<"userid">>,<<"userid">>,8,<<__>>,63,20,16899,0},
>
>
>         {field,3,<<"def">>,<<"__fangchan">>,<<"user">>,<<"__user">>,
>
>                            <<"name">>,<<"name">>,254,<<>>__,33,36,20489,0},
>
>
>         {field,4,<<"def">>,<<"__fangchan">>,<<"user">>,<<"__user">>,
>
>
>         <<"id_no">>,<<"id_no">>,254,<<__>>,33,54,20481,0},
>
>
>         {field,5,<<"def">>,<<"__fangchan">>,<<"user">>,<<"__user">>,
>
>                            <<"sex">>,<<"sex">>,1,<<>>,63,__1,0,0},
>
>
>         {field,6,<<"def">>,<<"__fangchan">>,<<"user">>,<<"__user">>,
>
>                            <<"age">>,<<"age">>,2,<<>>,63,__6,0,0},
>
>
>         {field,7,<<"def">>,<<"__fangchan">>,<<"user">>,<<"__user">>,
>
>                            <<"tel">>,<<"tel">>,254,<<>>,__33,33,0,0},
>
>
>         {field,8,<<"def">>,<<"__fangchan">>,<<"user">>,<<"__user">>,
>
>                            <<"email">>,<<"email">>,253,<<__>>,33,132,0,0}],
>                                          [[1,
>                                            <<231,138,185,230,157,176>>,
>
>
>         <<"237689098736789870">>,1,32,__<<"13761975289">>,
>                                            <<"you.jie@REDACTED
>         <mailto:you.jie@REDACTED>
>                          <mailto:you.jie@REDACTED
>         <mailto:you.jie@REDACTED>>"__>>]],
>                                          <<>>}
>
>
>
>                          On Thu, Jul 4, 2013 at 4:21 PM, Max Lapshin
>                          <max.lapshin@REDACTED
>         <mailto:max.lapshin@REDACTED> <mailto:max.lapshin@REDACTED
>         <mailto:max.lapshin@REDACTED>>__>
>                          wrote:
>
>                              Barco, it means that you need to read
>         manual for
>                              mysql server and
>                              enable socket listener.
>
>
>
>
>
>                  _________________________________________________
>                  erlang-questions mailing list
>         erlang-questions@REDACTED <mailto:erlang-questions@REDACTED>
>         <mailto:erlang-questions@REDACTED
>         <mailto:erlang-questions@REDACTED>>
>         http://erlang.org/mailman/__listinfo/erlang-questions
>         <http://erlang.org/mailman/listinfo/erlang-questions>
>
>
>
>
>         _________________________________________________
>         erlang-questions mailing list
>         erlang-questions@REDACTED <mailto:erlang-questions@REDACTED>
>         http://erlang.org/mailman/__listinfo/erlang-questions
>         <http://erlang.org/mailman/listinfo/erlang-questions>
>
>
>
>     --
>     Loďc Hoguin
>     Erlang Cowboy
>     Nine Nines
>     http://ninenines.eu
>


-- 
Loïc Hoguin
Erlang Cowboy
Nine Nines
http://ninenines.eu



More information about the erlang-questions mailing list