Падение ejabberd-2.1.6 под Windows

В компании происходит переход на одноранговую сеть, т.к. не хватает специалистов понимающих Unix системы. Передо мной стала задача миграции с FreeBSD сервер jabberd 1.4 на Windows 2003 сервер взял ejabberd 2.1.6. Пока решил использовать mnesia базу (на sql всегда будет время еще перейти). Сконфигурировал стандартно, без доп. модулей, все из коробочки инсталлятора. Импортул xml-ки контактов (примерно 800 аккаунтов), погонял с десятком подключенных, работает. Сделал подмену рабочего сервера. Сервер проработал минут 30 и упал.

erlang.log:

=CRASH REPORT==== 24-Feb-2011::14:57:25 ===
  crasher:
    pid: <0.30249.0>
    registered_name: []
    exception exit: {badarg,[{erlang,port_control,
                                     [stringprep_port,2,"ummi_val_reva"]},
                             {stringprep,control,2},
                             {jlib,nodeprep,1},
                             {jlib,make_jid,3},
                             {ejabberd_s2s_out,bounce_element,2},
                             {ejabberd_s2s_out,bounce_queue,2},
                             {ejabberd_s2s_out,terminate,3},
                             {p1_fsm,terminate,7}]}
      in function  p1_fsm:terminate/7
    initial call: gen:init_it(p1_fsm,<0.312.0>,<0.312.0>,ejabberd_s2s_out,
                              ["jabber.lugansk.obu","jabber.ummd.lugansk.obu",
                               {new,"1582459119"}],
                              [])
    ancestors: [ejabberd_s2s_out_sup,ejabberd_sup,<0.36.0>]
    messages: []
    links: []
    dictionary: [{'$internal_queue_len',0}]
    trap_exit: true
    status: running
    heap_size: 121393
    stack_size: 23
    reductions: 74840
  neighbours:

в ejabberd.log много ошибок некорректных jid-ов в ростере блондинок, но перед подением учащаются ссобщения такого рода:

=ERROR REPORT==== 2011-02-24 14:39:58 ===
** State machine <0.1499.1> terminating
** Last message in was {route,
                        {jid,"UMLL_BUH_Abakumova","jabber.mydomain.org",[],
                         "umll_buh_abakumova","jabber.mydomain.org",[]},
                        {jid,"UMLL_BUH_Abakumova","jabber.mydomain.org",
                         "Just Another Jabber Client","umll_buh_abakumova",
                         "jabber.mydomain.org","Just Another Jabber Client"},
                        {xmlelement,"iq",
                         [{"id","push888581720"},{"type","set"}],
                         [{xmlelement,"query",
                           [{"xmlns","jabber:iq:roster"},{"ver",not_found}],
                           [{xmlelement,"item",
                             [{"subscription","both"},
                              {"name",
                               [208,155,208,181,208,189,208,190,209,135,208,
                                186,208,176,32,208,156,208,176,209,130,209,
                                128,208,190,209,129,208,190,208,178,208,176]},
                              {"jid",
                               "umll_021_MatrosovaEV@jabber.mydomain.org"}],
                             [{xmlelement,"group",[],[{xmlcdata,"Unfiled"}]},
                              {xmlelement,"x",
                               [{"xmlns","jajc:x:adv"}],
                               [{xmlelement,"autoauth",[],
                                 [{xmlcdata,<<"true">>}]},
                                {xmlelement,"icon",[],
                                 [{xmlcdata,<<"yahoo.zip">>}]}]}]}]}]}}
** When State == session_established
**      Data  == {state,
                  {socket_state,ejabberd_zlib,
                   {zlibsock,gen_tcp,#Port<0.2909>,#Port<0.2911>},
                   <0.1498.1>},
                  ejabberd_socket,#Ref<0.0.0.74371>,false,"2250316959",
                  {sasl_state,"jabber","jabber.mydomain.org",[],
                   #Fun<ejabberd_c2s.1.52538782>,
                   #Fun<ejabberd_c2s.2.77839348>,
                   #Fun<ejabberd_c2s.3.97921512>,cyrsasl_digest,
                   {state,5,"507168114","UMLL_BUH_Abakumova",[],
                    #Fun<ejabberd_c2s.1.52538782>,
                    #Fun<ejabberd_c2s.3.97921512>,ejabberd_auth_internal,
                    "jabber.mydomain.org"}},
                  c2s,c2s_shaper,true,true,false,false,
                  [verify_none,
                   {certfile,
                    "D:\\Program Files\\ejabberd-2.1.6\\conf\\server.pem"}],
                  true,
                  {jid,"UMLL_BUH_Abakumova","jabber.mydomain.org",
                   "Just Another Jabber Client","umll_buh_abakumova",
                   "jabber.mydomain.org","Just Another Jabber Client"},
                  "UMLL_BUH_Abakumova","jabber.mydomain.org",
                  "Just Another Jabber Client",
                  {{1298,551197,381370},<0.1499.1>},
                  {pres_t,108},
                  {pres_f,103},
                  {pres_a,103},
                  {pres_i,0},
                  {xmlelement,"presence",[],
                   [{xmlelement,"priority",[],[{xmlcdata,<<"3">>}]},
                    {xmlelement,"show",[],[{xmlcdata,<<"away">>}]},
                    {xmlelement,"status",[],
                     [{xmlcdata,
                       <<208,146,209,139,209,136,208,181,208,187>>}]}]},
                  undefined,
                  {{2011,2,24},{12,39,58}},
                  false,
                  {userlist,none,[],false},
                  c2s_compressed,ejabberd_auth_internal,
                  {{10,98,32,115},2991},
                  [{caps_resources,
                    {17,
                     {{"umll_ok_arsenievamv","jabber.mydomain.org",
                       "Just Another Jabber Client"},
                      {caps,"http://jajc.jrudevels.org/caps",
                       "0.0.8.125 (01.02.2010)",[],[]},
                      {{"umll_asu_krikunovasa","jabber.mydomain.org",
                        "Just Another Jabber Client"},
                       {caps,"http://jajc.jrudevels.org/caps",
                        "0.0.8.125 (22.06.2009)",[],[]},
                       {{"umll_021_matrosovaev","jabber.mydomain.org",
                         "Just Another Jabber Client"},
                        {caps,"http://jajc.jrudevels.org/caps",
                         "0.0.8.125 (22.06.2009)",[],[]},
                        nil,nil},
                       {{"umll_buh_basiladze","jabber.mydomain.org",
                         "Just Another Jabber Client"},
                        {caps,"http://jajc.jrudevels.org/caps",
                         "0.0.8.125 (22.06.2009)",[],[]},
                        nil,nil}},
                      {{"ummi_audit_bulipop","jabber.mydomain.org","JAJC"},
                       {caps,"http://jajc.jrudevels.org/caps",
                        "0.0.8.125 (27.12.2009)",[],[]},
                       {{"ummi_asu_myachin","jabber.mydomain.org",
                         "Just Another Jabber Client"},
                        {caps,"http://jajc.jrudevels.org/caps",
                         "0.0.8.125 (14.03.2010 (test build))",[],[]},
                        nil,nil},
                       {{"ummi_kre_boykoav","jabber.mydomain.org",
                         "Just another jabber client"},
                        {caps,"http://jajc.jrudevels.org/caps",
                         "0.0.8.125 (23.03.2009)",[],[]},
                        {{"ummi_buh_gorbushina","jabber.mydomain.org",
                          "Just another jabber client"},
                         {caps,"http://jajc.jrudevels.org/caps",
                          "0.0.8.125 (27.12.2009)",[],[]},
                         {{"ummi_bpk_baranov","jabber.mydomain.org",
                           "Just Another Jabber Client"},
                          {caps,"http://jajc.jrudevels.org/caps",
                           "0.0.8.125 (01.02.2010)",[],[]},
                          nil,nil},
                         {{"ummi_jur_yarovenkonv","jabber.mydomain.org",
                           "Just Another Jabber Client"},
                          {caps,"http://jajc.jrudevels.org/caps",
                           "0.0.8.125 (01.02.2010)",[],[]},
                          nil,nil}},
                        {{"ummi_oko_denschik","jabber.mydomain.org",
                          "Just Another Jabber Client"},
                         {caps,"http://jajc.jrudevels.org/caps",
                          "0.0.8.125 (22.06.2009)",[],[]},
                         {{"ummi_kre_garmashvu","jabber.mydomain.org",
                           "Just Another Jabber Client"},
                          {caps,"http://jajc.jrudevels.org/caps",
                           "0.0.8.125 (01.02.2010)",[],[]},
                          nil,nil},
                         {{"ummi_oko_vedenkina","jabber.mydomain.org",
                           "Just Another Jabber Client"},
                          {caps,"http://jajc.jrudevels.org/caps",
                           "0.0.8.125 (01.02.2010)",[],[]},
                          nil,
                          {{"ummi_rc_vrublevsky","jabber.mydomain.org","jajc"},
                           {caps,"http://jajc.jrudevels.org/caps",
                            "0.0.8.125 (01.02.2010)",[],[]},
                           nil,
                           {{"ummi_uap_kolpakova","jabber.mydomain.org",
                             "Just Another Jabber Client"},
                            {caps,"http://jajc.jrudevels.org/caps",
                             "0.0.8.125 (01.02.2010)",[],[]},
                            nil,
                            {{"ummi_val_horuzhaya","jabber.mydomain.org",
                              "JAJC"},
                             {caps,"http://jajc.jrudevels.org/caps",
                              "0.0.8.125 (13.01.2009)",[],[]},
                             nil,
                             {{"ummi_val_zolotarevags","jabber.mydomain.org",
                               "Just another jabber client"},
                              {caps,"http://jajc.jrudevels.org/caps",
                               "0.0.8.125 (13.01.2009)",[],[]},
                              nil,nil}}}}}}}}}}}],
                  []}
** Reason for termination =
** {{badxml,
        {xmlelement,"iq",
            [{"from","UMLL_BUH_Abakumova@jabber.mydomain.org"},
             {"to",
              "UMLL_BUH_Abakumova@jabber.mydomain.org/Just Another Jabber Client"},
             {"id","push888581720"},
             {"type","set"}],
            [{xmlelement,"query",
                 [{"xmlns","jabber:iq:roster"},{"ver",not_found}],
                 [{xmlelement,"item",
                      [{"subscription","both"},
                       {"name",
                        [208,155,208,181,208,189,208,190,209,135,208,186,208,
                         176,32,208,156,208,176,209,130,209,128,208,190,209,
                         129,208,190,208,178,208,176]},
                       {"jid","umll_021_MatrosovaEV@jabber.mydomain.org"}],
                      [{xmlelement,"group",[],[{xmlcdata,"Unfiled"}]},
                       {xmlelement,"x",
                           [{"xmlns","jajc:x:adv"}],
                           [{xmlelement,"autoauth",[],[{xmlcdata,<<"true">>}]},
                            {xmlelement,"icon",[],
                                [{xmlcdata,<<"yahoo.zip">>}]}]}]}]}]},
        {function_clause,
            [{xml,crypt,[not_found]},
             {xml,attr_to_list,1},
             {xml,'-attrs_to_list/1-lc$^0/1-0-',1},
             {xml,'-attrs_to_list/1-lc$^0/1-0-',1},
             {xml,element_to_string_nocatch,1},
             {xml,'-element_to_string_nocatch/1-lc$^0/1-0-',1},
             {xml,element_to_string_nocatch,1},
             {xml,element_to_string,1}]}},
    [{xml,element_to_string,1},
     {xml,element_to_binary,1},
     {ejabberd_c2s,send_element,2},
     {ejabberd_c2s,handle_info,3},
     {p1_fsm,handle_msg,10},
     {proc_lib,init_p,5}]}

erl_crash_20110224-144527.dump:

=erl_crash_dump:0.1
Thu Feb 24 14:45:27 2011
Slogan: eheap_alloc: Cannot allocate 97953500 bytes of memory (of type "heap").
System version: Erlang (BEAM) emulator version 5.6.4 [smp:2] [async-threads:0]
Compiled: Tue Sep  2 19:03:58 2008
Atoms: 13779
=memory
total: 1283394816
processes: 785504896
processes_used: 785473344
system: 497889920
atom: 628889
atom_used: 618016
binary: 29124736
code: 6165922
ets: 444799312

До падения из процессов видим, что erl.exe поедает очень много памяти (~1.2Gb).

Решение

32-битная архитектура x86 процессора ограничивает производительность приложений, работающих с большими объёмами данных (x86-64 нет под рукой), а у Erlang на таких системах где-то есть придел ~2Gb, посему получали падение. Проблема решилась переходом на MySQL, за одно и ростеры пользователе почистили, где был хаос. Огорчает одно, что в природе нет mod_shared_roster_odbc

Maybe you found several

Maybe you found several different problems. For the ERROR REPORT I have created this ticket, because I think it's a bug in ejabberd: https://support.process-one.net/browse/EJAB-1420

Syndicate content