Skip to content

Instantly share code, notes, and snippets.

Load testing recon, to determine the impact of recon_rec and recon_map on performance.
1. Records
Test: a simple function taking and returning a record. Called two times, with two different record types.
Test is repeates 100k times. Values in record changed upon every iteration.
First run is with no tracing, the second with standard tracing, then we enable recon_rec, import ten record definitions (including the two)
used in calls) and impose a limit for one of them.
Run 1: no tracing - 2.9s
@bartekgorny
bartekgorny / stoptheloop.diff
Created April 6, 2018 11:45
patch to stop infinite routing
diff --git a/src/ejabberd_router.erl b/src/ejabberd_router.erl
index 3805281a..b34a9829 100644
--- a/src/ejabberd_router.erl
+++ b/src/ejabberd_router.erl
@@ -114,7 +114,11 @@ route(From, To, Acc) ->
route(From, To, Acc, El) ->
?DEBUG("route~n\tfrom ~p~n\tto ~p~n\tpacket ~p~n",
[From, To, Acc]),
- route(From, To, Acc, El, routing_modules_list()).
+ {Count, Acc1} = mongoose_acc:increment(routed, Acc),
@bartekgorny
bartekgorny / gist:110f4f4a0cac638fc0f8
Created March 16, 2016 16:46
mongoose routing plantuml
%% @startuml
%% (*) --> "filter packet"
%% "filter packet" --> [no] "<b><color:red>DROP</color></b>"
%% "filter packet" --> [YES] "external component lookup" as ext
%% ext --> [YES] "filter local packet" as floc
%% ext --> [no] "look in mnesia for local domain" as mnesia
%% mnesia --> [YES] floc
%% mnesia --> [no] "<b><color:green>s2s</color></b>"
%% floc --> [no] "<b><color:red>DROP </color></b>"