diff --git a/src/ejabberd_config.erl b/src/ejabberd_config.erl index fbfbb4982..791460dc2 100644 --- a/src/ejabberd_config.erl +++ b/src/ejabberd_config.erl @@ -894,7 +894,8 @@ has_option(Opt) -> get_option(Opt, fun(_) -> true end, false). init_module_db_table(Modules) -> - catch ets:new(module_db, [named_table, public, bag]), + catch ets:new(module_db, [named_table, public, bag, + {read_concurrency, true}]), %% Dirty hack for mod_pubsub ets:insert(module_db, {mod_pubsub, mnesia}), ets:insert(module_db, {mod_pubsub, sql}), diff --git a/src/ejabberd_hooks.erl b/src/ejabberd_hooks.erl index 602ac577f..22e54d66a 100644 --- a/src/ejabberd_hooks.erl +++ b/src/ejabberd_hooks.erl @@ -189,7 +189,7 @@ run_fold(Hook, Host, Val, Args) -> %% {stop, Reason} %%---------------------------------------------------------------------- init([]) -> - ets:new(hooks, [named_table]), + ets:new(hooks, [named_table, {read_concurrency, true}]), {ok, #state{}}. %%---------------------------------------------------------------------- diff --git a/src/ejabberd_local.erl b/src/ejabberd_local.erl index d2f1b20db..00ce22274 100644 --- a/src/ejabberd_local.erl +++ b/src/ejabberd_local.erl @@ -201,7 +201,8 @@ init([]) -> lists:foreach(fun host_up/1, ?MYHOSTS), ejabberd_hooks:add(host_up, ?MODULE, host_up, 10), ejabberd_hooks:add(host_down, ?MODULE, host_down, 100), - catch ets:new(?IQTABLE, [named_table, public, ordered_set]), + catch ets:new(?IQTABLE, [named_table, public, ordered_set, + {read_concurrency, true}]), update_table(), ejabberd_mnesia:create(?MODULE, iq_response, [{ram_copies, [node()]}, diff --git a/src/ejabberd_sm.erl b/src/ejabberd_sm.erl index 1600a2c92..2b6dd2e37 100644 --- a/src/ejabberd_sm.erl +++ b/src/ejabberd_sm.erl @@ -393,7 +393,7 @@ c2s_handle_info(State, _) -> init([]) -> process_flag(trap_exit, true), lists:foreach(fun(Mod) -> Mod:init() end, get_sm_backends()), - ets:new(sm_iqtable, [named_table, public]), + ets:new(sm_iqtable, [named_table, public, {read_concurrency, true}]), ejabberd_hooks:add(host_up, ?MODULE, host_up, 50), ejabberd_hooks:add(host_down, ?MODULE, host_down, 60), lists:foreach(fun host_up/1, ?MYHOSTS), diff --git a/src/gen_mod.erl b/src/gen_mod.erl index ef000635d..4b845a386 100644 --- a/src/gen_mod.erl +++ b/src/gen_mod.erl @@ -85,7 +85,8 @@ init([]) -> ejabberd_hooks:add(host_down, ?MODULE, stop_modules, 70), ets:new(ejabberd_modules, [named_table, public, - {keypos, #ejabberd_module.module_host}]), + {keypos, #ejabberd_module.module_host}, + {read_concurrency, true}]), {ok, {{one_for_one, 10, 1}, []}}. -spec start_child(module(), binary() | global, opts()) -> ok | {error, any()}.