zulip/docs/production
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
..
authentication-methods.md docs: Fix incorrect path to get-django-setting script. 2020-01-03 16:52:31 -08:00
deployment.md install: Use crudini for storing value of POSTGRES_MISSING_DICTIONARIES. 2019-12-13 12:05:39 -08:00
email-gateway.md docs: Fix typo in production/email-gateway.md. 2019-07-13 11:31:01 -07:00
email.md docs: Fix missing apostrophe in EMAIL_HOST_USER value. 2020-01-03 16:52:31 -08:00
expensive-migrations.md models: Add new UserMessage flag active_mobile_push_notification. 2018-08-01 16:51:56 -07:00
export-and-import.md docs: Fix some typos. 2019-12-12 17:19:10 -08:00
index.rst docs: Split maintain-secure-upgrade into dedicated docs. 2019-11-22 10:21:20 -08:00
install-existing-server.md docs: Reduce the number of apparently broken links on github. 2019-10-07 12:08:27 -07:00
install.md docs: Split maintain-secure-upgrade into dedicated docs. 2019-11-22 10:21:20 -08:00
maintain-secure-upgrade.md docs: Split maintain-secure-upgrade into dedicated docs. 2019-11-22 10:21:20 -08:00
management-commands.md docs: Minor edits to export and management command docs. 2019-12-12 16:06:40 -08:00
mobile-push-notifications.md docs: Merge "Upgrading" with modifying-zulip. 2019-11-05 17:43:00 -08:00
multiple-organizations.md docs: Fix broken social authentication links. 2019-12-10 17:34:27 -08:00
password-strength.md Revert "docs: Update .html links to .md." 2019-04-05 17:58:54 -07:00
postgres.md docs: Add production documentation on deployment options. 2018-05-22 11:31:48 -07:00
requirements.md docs: Clean up requirements page. 2019-12-12 16:31:02 -08:00
security-model.md docs: Reduce the number of apparently broken links on github. 2019-10-07 12:08:27 -07:00
settings.md docs: Split maintain-secure-upgrade into dedicated docs. 2019-11-22 10:21:20 -08:00
ssl-certificates.md docs: Add troubleshooting entry for TLS <1.2 servers. 2019-08-27 16:25:37 -07:00
troubleshooting.md dependencies: Remove WebSockets system for sending messages. 2020-01-14 22:34:00 -08:00
upgrade-or-modify.md docs: Fix some typos. 2019-12-12 17:19:10 -08:00
upload-backends.md docs: Reduce the number of apparently broken links on github. 2019-10-07 12:08:27 -07:00