标签:
1.在进程数达到10w级以上的Node调用erlang:processes()来得到所有的进程Pid.然后算长度blabla...;
2. 当某个进程的信箱被堵塞了上万个消息队列时调用erlang:process_info(Pid,messages)来查看所有的消息。
recon_web | observer |
web页面查看,不需求wx GUI | 需要Erlang安装wx GUI application |
保证可以在生产环境中被安全调用 | 如果对于ets非常多或进程达到一定数量时会崩溃掉,不适合大多数在Node已出状况时使用 |
cowboy 1.0.1 | websocket 用于server通信 |
recon | 用于查看Node状态 |
jsx | 用于json转换 |
lager | 日志记录 |
socket.io.client | web端的websocket维护 |
highcharts | web端绘制图表 |
1> recon_web_status:get_recon_info(node_stats_list). [{process_summary,[{process_count,86}, {run_queue,0}, {error_logger_queue_len,0}, {memory_total,20032952}, {memory_procs,6067544}, {memory_atoms,330312}, {memory_bin,467040}, {memory_ets,465936}]}, {mem_summary,[{bytes_in,0}, {bytes_out,0}, {gc_count,2}, {gc_words_reclaimed,256}, {reductions,130454}, {scheduler_usage,[{1,0.9252873563218391}, {2,0.147239263803681}, {3,0.13218390804597702}, {4,0.14285714285714285}]}]}]
3.1. 根据 error_logger_queue_len process_count run_queue绘制以下表:
3.2. 根据上面的memory_total,memory_procs,memory_atoms,memory_bin,memory_ets绘制:
3. 3.根据scheduler_usage绘制:
3.4 根据bytes_in,bytes_out绘制:
2> recon_web_status:get_recon_info(proc_count). [{proc_count,[{memory,[{<<"application_controller">>,602096}, {<<"0.26.0">>,372368}, {<<"recon_server">>,372328}, {<<"code_server">>,284656}, {<<"kernel_sup">>,197384}, {<<"0.159.0">>,88632}, {<<"erl_prim_loader">>,88552}, {<<"error_logger">>,75904}, {<<"init">>,67896}, {<<"0.45.0">>,55064}]}, {bin_memory,[{<<"kernel_sup">>,396661}, {<<"erl_prim_loader">>,27958}, {<<"0.26.0">>,7408}, {<<"0.159.0">>,5527}, {<<"0.45.0">>,1264}, {<<"application_controller">>,947}, {<<"user">>,852}, {<<"recon_server">>,454}, {<<"lager_event">>,278}, {<<"cowboy_clock">>,203}]}, {reductions,[{<<"recon_server">>,43125661}, {<<"erl_prim_loader">>,1328265}, {<<"0.159.0">>,243664}, {<<"code_server">>,196114}, {<<"application_controller">>,56899}, {<<"timer_server">>,53145}, {<<"kernel_sup">>,48774}, {<<"cowboy_clock">>,30740}, {<<"file_server_2">>,24547}, {<<"init">>,17949}]}, {total_heap_size,[{<<"application_controller">>,75112}, {<<"recon_server">>,46421}, {<<"0.26.0">>,46421}, {<<"code_server">>,35462}, {<<"kernel_sup">>,24503}, {<<"0.159.0">>,10958}, {<<"erl_prim_loader">>,10957}, {<<"error_logger">>,9358}, {<<"init">>,8370}, {<<"0.45.0">>,6771}]}]}]
3.5根据上面的memory, bin_memory,reductions, total_heap_size绘制:
3> recon_web_status:get_recon_info(port). [{port_summary,[{<<"efile">>,5}, {<<"tcp_inet">>,2}, {<<"2/2">>,1}, {<<"tty_sl -c -e">>,1}]}]
3.6.根据 port_summary绘制:
4> recon_web_status:get_recon_info(inet_count). [{inet_count,[{sent_oct,[]}, {recv_oct,[{<<"Port0.4012">>,1205},{<<"Port0.3695">>,0}]}, {sent_cnt,[]}, {recv_cnt,[{<<"Port0.4012">>,72},{<<"Port0.3695">>,0}]}]}]
3. 7.根据sent_oct, recv_oct, sent_cnt, recv_cnt绘制:
5>recon_web_status:get_recon_info(alloc_memory). [{used,20804344}, {allocated,32247216}, {unused,11269856}, {allocated_types,[{binary_alloc,2786160}, {driver_alloc,164720}, {eheap_alloc,6763376}, {ets_alloc,1475440}, {fix_alloc,426864}, {ll_alloc,19923784}, {sl_alloc,164720}, {std_alloc,934768}, {temp_alloc,655960}]}, {allocated_instances,[{0,9094640}, {1,6305264}, {2,1246704}, {3,15664624}, {4,984560}]}]
3.8根据alloc_memory绘制:
6> recon_web_status:get_recon_info(cache_hit_rates). [{cache_hit_rates,[{<<"instance1">>,[602,1113]}, {<<"instance3">>,[148,213]}, {<<"instance0">>,"OV"}, {<<"instance2">>,[7,13]}, {<<"instance4">>,[0,0]}]}]
3.9 根据cache_hit_rates绘制:
cowboy 建立websocket:http://ninenines.eu/docs/en/cowboy/HEAD/guide/ws_handlers/
highcharts: http://www.highcharts.com/
---------------------------------------------------------------------------------------------------------------------
inside the beam scheduler
[Erlang_Question33]使用recon从网页查看Erlang运行状态
标签:
原文地址:http://www.cnblogs.com/zhongwencool/p/recon_web.html