loadtest - inets {'EXIT',{ebadf

Sanjaya Vitharana <>
Fri Dec 30 05:35:34 CET 2005


Hi ... !!!

When I try to perform a load test on my db, Inets gives below error. Actually I'm running inets httpd to handle my http request.

When I compare the error with mod_log.erl (line 112 on transfer_log part) 'EXIT' is not catch in the original code. Is it ok or a bug ?

I have try to put the 3000000 requests, but why this crashes in the 63689 http call & onwards? It's perfectly works upto 63689 request. Also the requests generated by same way in PHP loop (see below) . Too much load will be the reason?

please guide me.

Thanks in advance.


Sanjaya Vitharana

=ERROR REPORT==== 29-Dec-2005::18:42:13 ===
{'EXIT',{ebadf,[{io,format,
                    [<0.125.0>,
                     "~s ~s ~s [~s] \"~s\" ~w ~w~n",
                     ["192.168.0.124",
                      "-",
                      "-",
                      "29/Dec/2005:18:42:13 +0600",
                      "GET /vm_db/vm_prof_upd:save_record?mob=772063689&det=eJx1VE2PmzAQ%2FSsV4hhFmPCRkMu2vbSqsltpL71FEzBZd42JbEOCqvz3jsEmhM0qkQzjN2+e5w2GLFxn%2F1S2yTzINWtpLrS3ZVm47WM5CEGL192rt33GCFlhqBYaoUqy4xtCMZh5pF%2FxgVbAOHAqtbrbCjKvhIrxrgANdueLWVPcqHlBZY9PMu%2Fn87eXP0vzEpuci6incJR0lJRqRxNvjPAsNEdAqjPleV1RbwtIhaEo83R3orZQQUtouP74RuIxdY%2FhZVtfrBrgXNK8x2BKmqYkXEVxsj9LuEfljXqAykeUac4AwwqqZ8SemAVbCkVrJG9mki1gjVqh28+i6RB9qK6ShatrYWUjHsDyEUbCETfXZ7wTxuu5go2Lf6JBOPIR+ImKEUiiCfJex%2FU6zGhr5uvAe4tXj%2FuFkUOjuo+VDnB0lRADZ3iAoQ5zvTrptWZlV7LBbDSD+IFPgiDwx6zF4vbo4w4J%2FGARLH5Ile2YcKtPbrCxsT15C7KzU+47NxpF5W9Q6lzLwo5Zkq7xb2WpE6VFwYDPPg+TV3I4juNIsC%2FuR%2FAX2POzSjE3%2FISE4WoVRXGcJOlQAsdSisK5ksRRnK4361VIwih26lsmdQOcFWoqYj2IcK64OwClnCB%2Fh+NdtKdR7ChAN5LOaIYbiRU2HNhbAStCXzGMJtY9NZVanqGlguolf7cUTA0k05qYZa4px9BUN47qonQtabhkQlsGA32rlXbGzCHmy64Pf2muv3P0y7X0pRJsh6lf87xuBiRaqDSec9COkF+20Y09IrkTM+mlgIpafyfb1%2F94yawH&type=0&date_upd=1135860133&date_first=1135860133 HTTP/1.0",
                      200,
                      7]]},
                {mod_log,transfer_log,6},
                {mod_log,do,1},
                {httpd_response,traverse_modules,2},
                {httpd_response,generate_and_send_response,1},
                {httpd_request_handler,handle_response,1},
                {gen_server,handle_msg,6},
                {proc_lib,init_p,5}]}}

-----------------------------------------------PHP script(loadTest.php) I try to run----------------------------------------------------

#!/usr/local/php/bin/php

<?php
 $data = urlencode('eJx1VE2PmzAQ/SsV4hhFmPCRkMu2vbSqsltpL71FEzBZd42JbEOCqvz3jsEmhM0qkQzjN2 e5w2GLFxn/1S2yTzINWtpLrS3ZVm47WM5CEGL192rt33GCFlhqBYaoUqy4xtCMZh5pF/xgVbAOHAqtbrbCjKvhIrxrgANdueLWVPcqHlBZY9PMu/n87eXP0vzEpuci6incJR0lJRqRxNvjPAsNEdAqjPleV1RbwtIhaEo83R3orZQQUtouP74RuIxdY/hZVtfrBrgXNK8x2BKmqYkXEVxsj9LuEfljXqAykeUac4AwwqqZ8SemAVbCkVrJG9mki1gjVqh28 i6RB9qK6ShatrYWUjHsDyEUbCETfXZ7wTxuu5go2Lf6JBOPIR ImKEUiiCfJex/U6zGhr5uvAe4tXj/uFkUOjuo VDnB0lRADZ3iAoQ5zvTrptWZlV7LBbDSD IFPgiDwx6zF4vbo4w4J/GARLH5Ile2YcKtPbrCxsT15C7KzU 47NxpF5W9Q6lzLwo5Zkq7xb2WpE6VFwYDPPg TV3I4juNIsC/uR/AX2POzSjE3/ISE4WoVRXGcJOlQAsdSisK5ksRRnK4361VIwih26lsmdQOcFWoqYj2IcK64OwClnCB/h NdtKdR7ChAN5LOaIYbiRU2HNhbAStCXzGMJtY9NZVanqGlguolf7cUTA0k05qYZa4px9BUN47qonQtabhkQlsGA32rlXbGzCHmy64Pf2muv3P0y7X0pRJsh6lf87xuBiRaqDSec9COkF 20Y09IrkTM mlgIpafyfb1/94yawH');

 for ($mob = 772000000; $mob < 775000000; $mob++)
 {
  $url = 'http://192.168.0.124:8888/vm_db/vm_prof_upd:save_record?mob=' . $mob .
                                                                '&det=' . $data .
                                                                '&type=0' .
                                                                '&date_upd=' . time() .
                                                                '&date_first=' . time();

  $res = date('Y-M-d h:i:sa', time()) . ' | ' . $mob . ' ' . file_get_contents($url);

  echo $res . "\n";
  file_put_contents('/tmp/loadTest.log',  $res . "\n", FILE_APPEND);
  //usleep(100);
 }
 echo "\n";
?>

-------------------------------------------------------------------------------------------------------------------------------------------------------------
****** below the aditional info if somebody needs to test *****
-------------------------------------------------------------------------------------------------------------------------------------------------------------

-------------------------------------------------record used-------------------------------------------------------------------------------------

-record(vm_profile_backup, {mobile_no, prof_details, type, last_update_date, first_creation_date, fax_no}).

---------------------------------table created using -----------------------------------------------------------------------------------------------------

   Res = mnesia:create_table(profile_db,[
                      {disc_only_copies, NodeList},
                      {record_name, vm_profile_backup},
                      {attributes, record_info(fields, vm_profile_backup)}
                      ]),

-------------------------------from vm_prof_upd.erl--------------------------------------------------------------------------------------------------------
save_record(SessionID,Env,Input)->
  %%----------Server Side Out Puts-----------
  io:format("SessionID:~p~n",[SessionID]), %SessionID:<0.233.0>
    io:format("Env:~p~n",[Env]),
    io:format("Input: ~p~n",[Input]),
    InData = httpd:parse_query(Input),
    io:format("GOT THIS: ~p~n",[InData]),
    %%----------Return to client---------------
  Rec=#vm_profile_backup{},
  Fun1= fun(A, VMRec) ->
       case A of
        {"mob",MNo}-> VMRec#vm_profile_backup{mobile_no=MNo};
        {"det",PDet}->VMRec#vm_profile_backup{prof_details=PDet};
        {"type",Type}->VMRec#vm_profile_backup{type=Type};
        {"date_upd",Date_UpDate}->
          case catch erlang:list_to_integer(Date_UpDate) of
           {'EXIT', _}-> VMRec#vm_profile_backup{last_update_date=error};
           %%{badarg,_}->
           ValueDate_UpDate-> VMRec#vm_profile_backup{last_update_date=ValueDate_UpDate}
          end;
        {"date_first",Date_First}->
          case catch erlang:list_to_integer(Date_First) of
           {'EXIT', _}-> VMRec#vm_profile_backup{first_creation_date=error};
           %%{badarg,_}->
           ValueDate_First-> VMRec#vm_profile_backup{first_creation_date=ValueDate_First}
          end;
        {"fax",FNo}->VMRec#vm_profile_backup{fax_no=FNo};
        Other->VMRec
       end
      end,
  NewRec=lists:foldl(Fun1,Rec,InData),

    if
     NewRec#vm_profile_backup.last_update_date == error; NewRec#vm_profile_backup.first_creation_date == error  ->
       mod_esi:deliver(SessionID, "{error,invalid_number_[first_creation_date_OR_last_update_date]}");
     NewRec#vm_profile_backup.mobile_no /= undefined, NewRec#vm_profile_backup.mobile_no /= [], NewRec#vm_profile_backup.last_update_date /= undefined,NewRec#vm_profile_backup.last_update_date /= [], NewRec#vm_profile_backup.first_creation_date /= undefined, NewRec#vm_profile_backup.first_creation_date /= []  ->
    MobNo=NewRec#vm_profile_backup.mobile_no,
    Prof_Det=NewRec#vm_profile_backup.prof_details,
    if
     NewRec#vm_profile_backup.type /= undefined, NewRec#vm_profile_backup.type /= [] -> 
       Type1=NewRec#vm_profile_backup.type;
     true->Type1="0"
    end,
    Date_UpD=NewRec#vm_profile_backup.last_update_date,
    Date_Fst=NewRec#vm_profile_backup.first_creation_date,
    if
     NewRec#vm_profile_backup.fax_no /= undefined, NewRec#vm_profile_backup.fax_no /= [] -> 
       FaxNo=NewRec#vm_profile_backup.fax_no;
     true->FaxNo=" "
    end,
      mod_esi:deliver(SessionID, io_lib:format("~p",[gen_server:call(vm_prof_db_svr,{save_profile_record,{MobNo,Prof_Det,Type1,Date_UpD,Date_Fst,FaxNo}})]));
     true->
      mod_esi:deliver(SessionID, "{error,no_mobile_no_OR_first_creation_date_OR_last_update_date}")
    end.

-------------------------------------from vm_prof_db_svr.erl (gen_server)-------------------------------------------------------

handle_call({save_profile_record,{MobNo,Prof_Det,Type,Date_UpD,Date_Fst,FaxNo}}, _From, State) ->
 Reply=vm_prof_db:save_profile_record({MobNo,Prof_Det,Type,Date_UpD,Date_Fst,FaxNo}),
 {reply, Reply, State};

-----------------------------------------from vm_prof_db.erl-----------------------------------------------------------------------------------------

save_profile_record({MobNo,Prof_Det,Type,Date_UpD,Date_Fst,FaxNo})->
 Rec= #vm_profile_backup{mobile_no = MobNo, prof_details = Prof_Det, type=Type, last_update_date = Date_UpD, first_creation_date = Date_Fst, fax_no=FaxNo},
 save_record(profile_db,Rec).

save_record(Db, Record) ->
 Fun = fun() ->
   mnesia:write(Db, Record, write)
 end,
 transaction(Fun).

--------------------------------------------------------------------------------------------------------------------------------------------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20051230/da94542b/attachment.html>


More information about the erlang-questions mailing list