zulip/docs/subsystems
Anders Kaseorg ea6934c26d dependencies: Remove WebSockets system for sending messages.
Zulip has had a small use of WebSockets (specifically, for the code
path of sending messages, via the webapp only) since ~2013.  We
originally added this use of WebSockets in the hope that the latency
benefits of doing so would allow us to avoid implementing a markdown
local echo; they were not.  Further, HTTP/2 may have eliminated the
latency difference we hoped to exploit by using WebSockets in any
case.

While we’d originally imagined using WebSockets for other endpoints,
there was never a good justification for moving more components to the
WebSockets system.

This WebSockets code path had a lot of downsides/complexity,
including:

* The messy hack involving constructing an emulated request object to
  hook into doing Django requests.
* The `message_senders` queue processor system, which increases RAM
  needs and must be provisioned independently from the rest of the
  server).
* A duplicate check_send_receive_time Nagios test specific to
  WebSockets.
* The requirement for users to have their firewalls/NATs allow
  WebSocket connections, and a setting to disable them for networks
  where WebSockets don’t work.
* Dependencies on the SockJS family of libraries, which has at times
  been poorly maintained, and periodically throws random JavaScript
  exceptions in our production environments without a deep enough
  traceback to effectively investigate.
* A total of about 1600 lines of our code related to the feature.
* Increased load on the Tornado system, especially around a Zulip
  server restart, and especially for large installations like
  zulipchat.com, resulting in extra delay before messages can be sent
  again.

As detailed in
https://github.com/zulip/zulip/pull/12862#issuecomment-536152397, it
appears that removing WebSockets moderately increases the time it
takes for the `send_message` API query to return from the server, but
does not significantly change the time between when a message is sent
and when it is received by clients.  We don’t understand the reason
for that change (suggesting the possibility of a measurement error),
and even if it is a real change, we consider that potential small
latency regression to be acceptable.

If we later want WebSockets, we’ll likely want to just use Django
Channels.

Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
2020-01-14 22:34:00 -08:00
..
analytics.md analytics: Remove Anomaly model. 2019-02-01 18:48:18 -08:00
api-release-checklist.md docs: Reorganize developer docs to improve navigation. 2017-11-16 09:45:08 -08:00
billing.md billing: Do subscription management in-house instead of with Stripe Billing. 2018-12-22 13:39:30 -08:00
caching.md docs: Reduce the number of apparently broken links on github. 2019-10-07 12:08:27 -07:00
client.md docs: Reduce the number of apparently broken links on github. 2019-10-07 12:08:27 -07:00
conversion.md Revert "docs: Update .html links to .md." 2019-04-05 17:58:54 -07:00
custom-apps.md docs: pip upgrade recommonmark and CommonMark 2019-08-15 22:41:40 -07:00
dependencies.md docs: Merge front-end-build-process with html-css. 2019-10-23 13:08:36 -07:00
django-upgrades.md docs: Add a document with notes on the Django upgrade process. 2018-11-14 17:53:27 -08:00
email.md scripts: Move inline-email-css from tools to scripts. 2019-11-15 17:39:42 -08:00
emoji.md docs: Reduce the number of apparently broken links on github. 2019-10-07 12:08:27 -07:00
events-system.md docs: Reduce the number of apparently broken links on github. 2019-10-07 12:08:27 -07:00
full-text-search.md search: Remove now unnecessary tsearch_extra dependency. 2019-08-29 12:49:26 -07:00
hashchange-system.md docs: Reduce the number of apparently broken links on github. 2019-10-07 12:08:27 -07:00
hotspots.md docs: Mention bug in ALWAYS_SEND_ALL_HOTSPOTS feature. 2019-02-27 10:21:30 -08:00
html-css.md webpack: Enable code splitting and deduplication. 2019-10-28 15:53:15 -07:00
index.rst docs: Reorganize auth and migrations subsystems. 2019-11-07 09:42:36 -08:00
input-pills.md refactor: Extract filter_taken_users. 2020-01-08 12:55:42 -08:00
logging.md docs: Reduce the number of apparently broken links on github. 2019-10-07 12:08:27 -07:00
management-commands.md docs: Reorganize developer docs to improve navigation. 2017-11-16 09:45:08 -08:00
markdown.md docs: Do not indicate that Bugdown is an extension. 2019-01-22 15:28:08 -08:00
pointer.md docs: Reduce the number of apparently broken links on github. 2019-10-07 12:08:27 -07:00
presence.md cleanup: Delete trailing newlines. 2019-08-06 23:29:11 -07:00
queuing.md dependencies: Remove WebSockets system for sending messages. 2020-01-14 22:34:00 -08:00
realms.md docs: Reduce the number of apparently broken links on github. 2019-10-07 12:08:27 -07:00
release-checklist.md docs: Simplify a few details in our release checklist. 2019-12-13 17:24:49 -08:00
schema-migrations.md docs: Simplify discussion of rebasing schema migrations. 2019-11-08 13:49:24 -08:00
sending-messages.md dependencies: Remove WebSockets system for sending messages. 2020-01-14 22:34:00 -08:00
settings.md settings: Extract default settings to a module. 2019-11-13 12:38:45 -08:00
thumbnailing.md docs: Reduce the number of apparently broken links on github. 2019-10-07 12:08:27 -07:00
typing-indicators.md shared: Set up a way to share some frontend code with the mobile app. 2019-10-17 16:48:23 -07:00
unread_messages.md docs: Reorganize developer docs to improve navigation. 2017-11-16 09:45:08 -08:00
users.md cleanup: Delete trailing newlines. 2019-08-06 23:29:11 -07:00
widgets.md cleanup: Delete trailing newlines. 2019-08-06 23:29:11 -07:00