Mnesia Overloading Problem (contd.)

luvish satija luvishsatija@REDACTED
Mon Jun 27 07:44:18 CEST 2005


 Hello all,
   I told about the Mnesia Overloading problem in my
previous mail. I would like to clarify the problem a
bit more. 

   My server process is creating four mnesia tables on
the same node on which it is running. For every new
client, server spawns a new process which then
independently communicates with the mnesia tables. 

   Now the problem is that when the number of clients
crosses a certain limit ( approx. 10000), the
following errors are thrown by the erlang shell:


 =ERROR REPORT==== 24-Jun-2005::10:48:31 ===
Error in process <0.3550.0> on node 'server@REDACTED'
with exit value:
{{badmatch,{aborted,{system_limit,"Cannot create an
ets table for the local transaction
store",{system_limit,[{ets,new,[mnesia_trans_store,[bag,public]]},{mnesia_tm,doit_loop,1},{mnesia_sp,init_proc,4},{proc_lib,...


=ERROR REPORT==== 24-Jun-2005::10:48:35 ===
** Too many db tables **



=ERROR REPORT==== 24-Jun-2005::10:48:50 ===
Mnesia(server@REDACTED): ** WARNING ** Mnesia is
overloaded: {mnesia_tm, message_queue_len,
[3156,3105]}


Now I have certain doubts:
1. When I am creating only 4 tables, then how come
"too many db tables" error is thrown?

2. To solve the problem at my level, I made some
changes in the program. Now instead of all the
processes simultaneously jumping on mnesia, there is
only one process responsible for the transaction with
mnesia. All the client processes contact that process.
To my surprise this solution worked, and I could
safely reach a limit of 10000. To check mnesia's
status, the following was the output of ets:i().
 

id              name              type  size   mem    
 owner

----------------------------------------------------------------------------
 8               cookies           set   0      276   
  auth
 10              code              set   288    13790 
  code_server
 11              code_names        set   35     3440  
  code_server
 15              dets              duplicate_bag 0    
 276      dets
 22              mnesia_subscr     duplicate_bag 1    
 286      mnesia_subscr
 23              mnesia_transient_decision set   0    
 276      mnesia_recover
 29              mnesia_transient_decision set   0    
 276      mnesia_recover
 30              mnesia_transient_decision set   20150
 305597   mnesia_recover
 ac_tab          ac_tab            set   9      1029  
  application_controller
 client_buddylist client_buddylist  set   0      276  
   mnesia_monitor
 client_offlinemessages client_offlinemessages set   0
     276      mnesia_monitor
 client_online   client_online     set   10000  209599
  mnesia_monitor
 client_profile  client_profile    set   10000  287387
  mnesia_monitor
 dets_owners     dets_owners       set   0      276   
  dets
 dets_registry   dets_registry     set   0      276   
  dets
 disk_log_names  disk_log_names    set   1      286   
  disk_log_server
 disk_log_pids   disk_log_pids     set   1      286   
  disk_log_server
 global_locks    global_locks      set   0      276   
  global_name_server
 global_names    global_names      set   1      290   
  global_name_server
 global_names_ext global_names_ext  set   0      276  
   global_name_server
 inet_cache      inet_cache        bag   0      276   
  inet_db
 inet_db         inet_db           set   20     556   
  inet_db
 inet_hosts      inet_hosts        set   8      700   
  inet_db
 mnesia_decision mnesia_decision   set   1      287   
  mnesia_recover
 mnesia_gvar     mnesia_gvar       set   199    4008  
  mnesia_monitor
 mnesia_held_locks mnesia_held_locks bag   0      276 
    mnesia_monitor
 mnesia_lock_counter mnesia_lock_counter set   0     
276      mnesia_monitor
 mnesia_lock_queue mnesia_lock_queue bag   0      276 
    mnesia_monitor
 mnesia_sticky_locks mnesia_sticky_locks set   0     
276      mnesia_monitor
 mnesia_tid_locks mnesia_tid_locks  bag   0      276  
   mnesia_monitor
 pg2_table       pg2_table         set   0      276   
  pg2
 schema          schema            set   5      834   
  mnesia_monitor
 sys_dist        sys_dist          set   1      316   
  net_kernel


3. So, the result which I have drawn is that Mnesia
was getting overloaded because of so many processes
contending for transaction. AM I THINKING IN RIGHT
DIRECTION or is there anything which is beyond this?


4. Why the entry mnesia_transient_decision having id
30 is having such a large size and taking large memory
(nearly double of my tables's size. Tables created by
my process are client_buddylist,
client_offlinemessages, client_online,
client_profile)?  

   I tried googling before posing my questions but it
didn't 
help me much. So, Please forgive me for if my doubts
are very basic
or any person out there is getting bored after reading
this large mail, but the answers to these doubts will
help me to go a long way in my project.

Thanks in anticipation,
/luvish


		
_______________________________________________________
Too much spam in your inbox? Yahoo! Mail gives you the best spam protection for FREE! http://in.mail.yahoo.com



More information about the erlang-questions mailing list