From 35e21e4240c1fd24404760a38dd6144f1f3d7949 Mon Sep 17 00:00:00 2001 From: Edwin Fine Date: Thu, 20 Apr 2017 10:00:47 -0400 Subject: [PATCH] Improve performance under load - Use SilentCircle chatterbox ETS table mod that addresses performance and unbounded memory growth - Decrease default burst size to 50 - Decrease default burst interval to 50 ms - Update documentation to reflect changes - Rewrite parts of apns_erlv3_session.erl to handle load and errors better - Modify CT tests to do a better job of flood testing (add sync_flood_and_disconnect test) - Modify CT tests to work with JWT auths, together with apns_erl_sim JWT support and apns_tools JWT token generation - Fix dialyzer warnings - Various other small improvements - Fix recovery when connection is broken - Regen docs --- debian/changelog | 9 ++-- doc/README.md | 100 +++++++++++++++++++------------------- doc/apns_erlv3_session.md | 14 +++++- doc/man/scpf.1 | 2 +- rebar.config | 4 +- rebar.lock | 4 +- 6 files changed, 72 insertions(+), 61 deletions(-) diff --git a/debian/changelog b/debian/changelog index d0fa4b8..371e138 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,11 +1,10 @@ -scpf (2.0.3~rc2) unstable; urgency=medium +scpf (2.0.3~rc3) unstable; urgency=medium * Version 2.0.3 * Improve performance under load - - Merge in chatterbox PR #106 - (https://github.com/joedevivo/chatterbox/pull/106) that fixes - unbounded memory growth + - Use SilentCircle chatterbox ETS table mod that addresses performance + and unbounded memory growth - Decrease default burst size to 50 - Decrease default burst interval to 50 ms - Update documentation to reflect changes @@ -19,7 +18,7 @@ scpf (2.0.3~rc2) unstable; urgency=medium - Various other small improvements * Fix recovery when connection is broken. - -- Edwin Fine Tue, 18 Apr 2017 13:22:18 -0400 + -- Edwin Fine Thu, 20 Apr 2017 09:54:36 -0400 scpf (2.0.2) unstable; urgency=medium diff --git a/doc/README.md b/doc/README.md index fd81ebb..2f8bf5c 100644 --- a/doc/README.md +++ b/doc/README.md @@ -4,7 +4,7 @@ Copyright (c) 2016 Silent Circle -__Version:__ Apr 18 2017 13:14:00 +__Version:__ Apr 20 2017 10:04:32 __Authors:__ Edwin Fine ([`efine@silentcircle.com`](mailto:efine@silentcircle.com)). @@ -1079,53 +1079,53 @@ function url(tag) { var o=document.getElementById(tag); return o ? o.href : '#'+ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
apns_cert
apns_erlv3_app
apns_erlv3_session
apns_erlv3_session_sup
apns_json
apns_jwt
apns_lib
apns_lib_http2
apns_recs
apns_types
gcm_erl
gcm_erl_app
gcm_erl_session
gcm_erl_session_sup
gcm_erl_util
gcm_json
gcm_req_sched
sc_config
sc_priority_queue
sc_push
sc_push_app
sc_push_lib
sc_push_lib_app
sc_push_lib_sup
sc_push_reg_api
sc_push_reg_db
sc_push_reg_resource
sc_push_reg_wm_device
sc_push_reg_wm_service
sc_push_reg_wm_tag
sc_push_req_mgr
sc_push_sup
sc_push_svc_apnsv3
sc_push_svc_gcm
sc_push_svc_null
sc_push_svc_null_srv
sc_push_top
sc_push_wm_common
sc_push_wm_helper
sc_push_wm_send_device
sc_push_wm_send_svc_appid_tok
sc_push_wm_send_svc_tok
sc_push_wm_send_tag
sc_push_wm_sup
sc_push_wm_version
sc_types
sc_util
sc_util_app
sc_util_srv
+apns_cert +apns_erlv3_app +apns_erlv3_session +apns_erlv3_session_sup +apns_json +apns_jwt +apns_lib +apns_lib_http2 +apns_recs +apns_types +gcm_erl +gcm_erl_app +gcm_erl_session +gcm_erl_session_sup +gcm_erl_util +gcm_json +gcm_req_sched +sc_config +sc_priority_queue +sc_push +sc_push_app +sc_push_lib +sc_push_lib_app +sc_push_lib_sup +sc_push_reg_api +sc_push_reg_db +sc_push_reg_resource +sc_push_reg_wm_device +sc_push_reg_wm_service +sc_push_reg_wm_tag +sc_push_req_mgr +sc_push_sup +sc_push_svc_apnsv3 +sc_push_svc_gcm +sc_push_svc_null +sc_push_svc_null_srv +sc_push_top +sc_push_wm_common +sc_push_wm_helper +sc_push_wm_send_device +sc_push_wm_send_svc_appid_tok +sc_push_wm_send_svc_tok +sc_push_wm_send_tag +sc_push_wm_sup +sc_push_wm_version +sc_types +sc_util +sc_util_app +sc_util_srv diff --git a/doc/apns_erlv3_session.md b/doc/apns_erlv3_session.md index c0a65d5..2850781 100644 --- a/doc/apns_erlv3_session.md +++ b/doc/apns_erlv3_session.md @@ -570,7 +570,7 @@ uuid_str() = apns_lib_http2:uuid_str()
async_send/2Asynchronously send notification in Opts.
async_send/3Asynchronously send notification in Opts.
async_send_callback/3Standard async callback function.
async_send_cb/4Asynchronously send notification in Opts with user-defined -callback function.
disconnect/1Make session disconnect.
get_state/1Get the current state of the FSM.
get_state_name/1Get the name of the current state of the FSM.
is_connected/1Return true if the session is connected, false otherwise.
kick_sender/1Wake up the sender to start sending queued notifications.
ping/1Kick off an HTTP/2 PING.
quiesce/1Quiesce a session.
reconnect/1Immediately disconnect the session and reconnect.
reconnect/2Immediately disconnect the session and reconnect after Delay ms.
resume/1Resume a quiesced session.
send/2Send a notification specified by Nf with options Opts.
send_cb/3Send a notification specified by Nf and a user-supplied callback +callback function.
conn_pid/1Get connection PID of HTTP/2 client.
disconnect/1Make session disconnect.
get_state/1Get the current state of the FSM.
get_state_name/1Get the name of the current state of the FSM.
is_connected/1Return true if the session is connected, false otherwise.
kick_sender/1Wake up the sender to start sending queued notifications.
ping/1Kick off an HTTP/2 PING.
quiesce/1Quiesce a session.
reconnect/1Immediately disconnect the session and reconnect.
reconnect/2Immediately disconnect the session and reconnect after Delay ms.
resume/1Resume a quiesced session.
send/2Send a notification specified by Nf with options Opts.
send_cb/3Send a notification specified by Nf and a user-supplied callback function.
server_mcs/1Get MCS of connected server.
start/2Start a named session as described by the options Opts.
start_link/2Start a named session as described by the options Opts.
stop/1Stop session.
sync_reconnect/1Immediately disconnect the session and reconnect, waiting until the actual reconnection completes before returning.
sync_send_callback/3Standard sync callback function.
@@ -828,6 +828,18 @@ See `apns_lib_http2:parsed_rsp()`. ``` +
+ +### conn_pid/1 ### + +

+conn_pid(FsmRef) -> {ok, pid()} | {error, not_connected}
+
+ +
  • FsmRef = term()
+ +Get connection PID of HTTP/2 client. + ### disconnect/1 ### diff --git a/doc/man/scpf.1 b/doc/man/scpf.1 index 7d9975b..dacd2ff 100644 --- a/doc/man/scpf.1 +++ b/doc/man/scpf.1 @@ -1,4 +1,4 @@ -.TH SCPF 1 "July 11, 2016" "scpf 2.0.3+0~20170417210427.1.g44f5efe" +.TH SCPF 1 "July 11, 2016" "scpf 2.0.3~rc3+0~20170420140423.0.g7a41b4a" .SH NAME scpf - general push service provider written in Erlang. .SH Synopsis diff --git a/rebar.config b/rebar.config index b1db354..4d1236a 100644 --- a/rebar.config +++ b/rebar.config @@ -66,12 +66,12 @@ {apns_erl, ".*", {git, "https://github.com/SilentCircle/apns_erl.git", {branch, "master"}}}, {apns_erlv3, ".*", - {git, "https://github.com/SilentCircle/apns_erlv3.git", {branch, "master"}}}, + {git, "https://github.com/SilentCircle/apns_erlv3.git", {branch, "fix/use-chatterbox-ets-tables"}}}, {gcm_erl, ".*", {git, "https://github.com/SilentCircle/gcm_erl.git", {branch, "master"}}}, {chatterbox, ".*", %{git, "https://github.com/joedevivo/chatterbox.git", {branch, "master"}}}, - {git, "https://github.com/SilentCircle/chatterbox.git", {branch, "silentcircle/master"}}}, + {git, "https://github.com/SilentCircle/chatterbox.git", {branch, "feature/use-ets-tables"}}}, {edown, ".*", {git, "https://github.com/uwiger/edown.git", {branch, "master"}}}, {goldrush, ".*", diff --git a/rebar.lock b/rebar.lock index cd792b5..448a467 100644 --- a/rebar.lock +++ b/rebar.lock @@ -9,11 +9,11 @@ 0}, {<<"apns_erlv3">>, {git,"https://github.com/SilentCircle/apns_erlv3.git", - {ref,"d98ed282409c1e0b9f703fc2aab5a9103b6ab326"}}, + {ref,"b78094feba172c744f090c881b27044a5ddc2481"}}, 0}, {<<"chatterbox">>, {git,"https://github.com/SilentCircle/chatterbox.git", - {ref,"9125caa55f651b7556858c79098188cb992168ad"}}, + {ref,"747baae55b5d7a9958779d0ebf9ae85f83e57130"}}, 0}, {<<"edown">>, {git,"https://github.com/uwiger/edown.git",