Skip to content

Releases: centrifugal/centrifugo

v1.6.0

17 Dec 11:29
Compare
Choose a tag to compare

This Centrifugo release is a massive 4-months refactoring of internals with the goal to separate code of different components such as engine, server, metrics, clients to own packages with well-defined API to communicate between them. The code layout changed dramatically. Look at libcentrifugo folder before and after! Unfortunately there are backwards incompatibilities with previous release - see notes below. The most significant one is changed metrics format in stats and node API command responses.

With new code layout it's much more simple to create custom engines or servers – each with own metrics and configuration options. We can not guarantee though that we will keep libcentrifugo packages API stable – our primary goal is still building Centrifugo standalone server. So if we find something that must be fixed or improved internally - we will fix/improve it even if this could result in packages API changes.

As Centrifugo written in Go the only performant way to write plugins is to import them in main.go file and build Centrifugo with them. So if you want to create custom build with custom server or custom engine you will need to change main.go file and build Centrifugo yourself. But at least it's easier than supporting full Centrifugo fork.

Release highlights:

  • New metrics. Several useful new metrics have beed added. For example HTTP API and client request HDR histograms. See updated documentation for complete list. Refactoring resulted in backwards incompatible issue when working with Centrifugo metrics (see below). Here is a docs chapter about metrics.
  • Optimizations for client side ping, centrifuge-js now automatically sends periodic ping commands to server. Centrifugo checks client's last activity time and closes stale connections. Builtin SockJS server won't send heartbeat frames to SockJS clients by default. You can restore the old behaviour though: setting ping: false on client side and sockjs_heartbeat_delay: 25 option in Centrifugo configuration. This all means that you better update centrifuge-js client to latest version (1.4.0). Read more about pings in docs.
  • Experimental websocket compression support for raw websockets - see #115. Read more details how to enable it in docs. Keep in mind that enabling websocket compression can result in slower Centrifugo performance - depending on your load this can be noticeable.
  • Serious improvements in Redis API queue consuming. There was a bottleneck as we used BLPOP command to get every message from Redis which resulted in extra RTT. Now it's fixed and we can get several API messages from queue at once and process them. The format of Redis API queue changed - see new format description in docs. Actually it's now the same as single HTTP API command - so we believe you should be comfortable with it. Old format is still supported but DEPRECATED and will be removed in next releases.
  • Redis sharding support. See more details in docs. This resolves some fears about Redis being bottleneck on some large Centrifugo setups. Though we have not heard such stories yet. Redis is single-threaded server, it's insanely fast but if your Redis approaches 100% CPU usage then this sharding feature is what can help your application to scale.
  • Many minor internal improvements.

Fixes:

  • This release fixes crash when jsonp transport was used by SockJS client - this was fixed recently in sockjs-go library.
  • Memory bursts fixed on node shutdown when we gracefully disconnect many connected clients.

Backwards incompatible changes:

  • stats and node command response body format changed – metrics now represented as map containing string keys and integer values. So you may need to update your monitoring scripts.
  • Default log level now is info - debug level is too chatty for production logs as there are tons of API requests per second, tons of client connect/disconnect events. If you still want to see logs about all connections and API requests - set log_level option to debug.
  • channel_prefix option renamed to redis_prefix.
  • web_password and web_secret option aliases not supported anymore. Use admin_password and admin_secret.
  • insecure_web option removed – web interface now available without any password if insecure_admin option enabled. Of course in this case you should remember about protecting your admin endpoints with firewall rules. Btw we recommend to do this even if you are using admin password.
  • Admin info response format changed a bit - but this most possibly will not affect anyone as it was mostly used by embedded web interface only.
  • Some internal undocumented options have been changed. Btw we documented several useful options which can be helpful in some cases.

Several internal highlights (mostly for Go developers):

  • Code base is more simple and readable now.
  • Protobuf v3 for message schema (using gogoprotobuf library). proto2 and proto3 are wire compatible.
  • Client transport now abstracted away - so it would be much easier in future to add new transport in addition/replacement to Websocket/SockJS.
  • API abstracted away from protocol - it would be easier in future to add new API requests source.
  • No performance penalty was introduced during this refactoring.
  • We process PUB/SUB messages in several goroutines, preserving message order.
  • We use statik (https://github.com/rakyll/statik) to embed web interface now.
  • go1.7.4 used for builds.

v1.5.1

09 Jul 09:44
Compare
Choose a tag to compare

v1.5.0

27 Jun 06:24
Compare
Choose a tag to compare

Some upgrade steps needed to migrate to this release, see below.

This release is a major refactoring of Centrifugo internal engine. Centrifugo now uses protobuf format while transferring data between nodes and serializing history/presence data in Redis. We expect that all those changes should not affect your working application code though as new serialization format used you may need to run FLUSHDB command if using Redis engine to remove presence/history data encoded as JSON (if you don't use presence and history then no need to do this). If you have any problems with new serialization format used by Centrifugo internally – we can consider making old JSON encoding optional in future releases. Depending on how you use Centrifugo with Redis Engine those internal changes can result in nearly the same performance (if real-time content mostly generated by users online, so messages coming to Centrifugo have to be delivered to at least one client) or up to 2x API request speed up (if your real-time mostly generated by application backend itself so some messages published in channel with no active subscribers and there is no need to do JSON encoding work).

  • Using SockJS 1.1 by default (actually as by default we use jsdelivr.net CDN version it will be latest minor release - at moment of writing 1.1.1) – this means that you need to also upgrade SockJS on client side to the same version (because some iframe-based SockJS transports require exact version match on client and server). Note that you can set desired SockJS version used by Centrifugo server via sockjs_url option (which is now by default //cdn.jsdelivr.net/sockjs/1.1/sockjs.min.js). So if you don't want to upgrade SockJS on client side or just want to fix version used or use your own hosted SockJS library (which is good if you think about old browser support and don't want to be affected by minor SockJS library releases) - use that option.
  • centrifugo version now shows Go language version used to build binary.
  • Performance and memory allocation improvements.

v1.4.5

21 Apr 07:27
Compare
Choose a tag to compare

No backwards incompatible changes here. This release uses go1.6.2

  • HTTP/2 support. This means that Centrifugo can utilize HTTP/2 protocol automatically - this is especially useful for HTTP-based SockJS transports (no limits for open connections per domain anymore). Note that HTTP/2 will work only when your setup utilizes https. Also HTTP/2 does not affect websockets because of missing protocol upgrade possibilities in HTTP/2 protocol - so websockets will work in the same way as before. Also if you have any proxy before Centrifugo then depending on your setup some reconfiguration may be required to make HTTP/2 work.

Just to remember how to test Centrifugo with SSL: follow instructions from Heroku article to generate self-signed certificate files. Then start Centrifugo like this:

./centrifugo --config=config.json --web --ssl --ssl_key=server.key --ssl_cert=server.crt

Go to https://localhost:8000/ and confirm that you trust certificate of this site (this is because of self-signed certificate, in case of valid certificate you don't need this step). Then you can test secure endpoint connections.

v1.4.4

07 Apr 08:10
Compare
Choose a tag to compare

One more fix for v1.4.2 release here

  • proper aliasing of admin_password and admin_secret configuration options. See #88

v1.4.3

05 Apr 16:52
Compare
Choose a tag to compare

Fix of security vulnerability introduced in v1.4.2, see below.

  • If you are using Centrifugo v1.4.2 (previous versions not affected) with admin socket enabled (with --admin or --web options) and your admin endpoint not protected by firewall somehow then you must update to this version. Otherwise it's possible to connect to admin websocket endpoint and run any command without authentication. It's recommended to update your secret key after upgrade. So sorry for this.

v1.4.2

27 Mar 13:17
Compare
Choose a tag to compare

No backwards incompatible changes here.

  • Redis Sentinel support for Redis high availability setup. Docs
  • Redis Engine now uses Redis pipeline for batching publish operations - this results in latency and throughput improvments when publish rate is high.
  • Refactored admin websocket. New option admin to enable admin websocket. New option insecure_admin to make this endpoint insecure (useful when admin websocket endpoint/port protected by firewall rules). web_password option renamed to admin_password, web_secret option renamed to admin_secret, insecure_web renamed to insecure_admin. But all old option names still supported to not break things in existing setups. Also note, that when you run Centrifugo with web interface enabled - you also make admin websocket available, because web interface uses it. A little more info in pull request.
  • Presence Redis Engine methods rewritten to lua to be atomic.
  • Some Redis connection params now can be set over environment variables. See #81
  • Fix busy loop when attempting to reconnect to Redis. Fixes large CPU usage while reconnecting.
  • Shorter message uids (22 bytes instead of 36). This was made in order to get some performance improvements.

v1.4.1

26 Feb 07:33
Compare
Choose a tag to compare
  • fix server crash on 32-bit architectures (due to this), see more details in #74.
  • fix compatibility problem with gocent introduced in v1.4.0

v1.4.0

19 Feb 19:23
Compare
Choose a tag to compare

No backwards incompatible changes here for most usage scenarios, but look carefully on notes below.

  • Timers in metrics marked as deprecated. time_api_mean, time_client_mean, time_api_max, time_client_max now return 0. This was made because timer's implementation used Timer from go-metrics library that does not suit very well for Centrifugo needs - so values were mostly useless in practice. So we decided to get rid of them for now to not confuse our users.
  • New node API method to get information from single node. That information will contain counters without aggregation over minute interval (what stats method does by default). So it can be useful if your metric aggregation system can deal with non-aggregated counters over time period itself. Also note that to use this method you should send API request to each Centrifugo node separately - as this method returns current raw statistics about one node. See issue for motivation description.
  • Centrifugo now handles SIGTERM in addition to SIGINT and makes shutdown when this signal received. During shutdown Centrifugo returns 503 status code on requests to handlers and closes client connections so clients will reconnect. If shutdown finished without errors in 10 seconds interval then Centrifugo exits with status code 0 (instead of 130 before, this fixes behaviour behind systemd after SIGTERM received).
  • Maximum limit in bytes for client request was added. It can be changed using client_request_max_size config option. By default 65536 bytes (64kb).
  • Packages for 64-bit Debian, Centos and Ubuntu hosted on packagecloud.io. If you are using Debian 7 or 8, Centos 6 or 7, Ubuntu 14.04 or Ubuntu 16.04 - you can find packages for those linux distribution following to packagecloud. Packages will be created every time we release new Centrifugo version.

v1.3.3

27 Jan 20:45
Compare
Choose a tag to compare

No backwards incompatible changes here

  • fix automatic presence expire in Redis engine - could lead to small memory leaks in Redis when using presence. Also could result in wrong presence information after non-graceful Centrifugo node shutdown.
  • configurable limit for amount of channels each client can subscribe to. Default 100. Can be changed using client_channel_limit configuration option.