Jabber vs Matrix

  last edited: Tue, 05 Feb 2019 11:12:50 +0100  
I've planned setting up a public XMPP/Jabber service (in addition to my preexisting public matrix homeserver matrix.netzgemeinde.eu), well, I changed my mind rapidly and elected to delete this mess called "ejabberd". There are two reason, the first one concerns the software, the second one XMPP/Jabber itself.

Ejabberd

I chose to install ejabberd, which claims to be fast and efficient (I do believe it), written in Erlang. The installation went smooth, however the configuration was far from easy:

Ejabberd's Configuration

The supplied configuration file contained about 800 lines of yaml (most of it comments, of course), still it's quite complex - they acknowledge it:
Do not let this complexity scare you. Most of you will be fine with default config file (or light changes)

Which immediately brings me to the documention:

Documentation

https://docs.ejabberd.im/admin/configuration/

When you have such a complex configuration you have to have good documentation otherwise the administrator will be lost. This happened to me, because the documentation didn't clarifiy which options to use for what specific version! I was running 17.04, and - just a guess - the documention was for the most current version, so lots of items were not working on my setup. The worst offender was the database: I was running it on a server containing a PostgresQL. So I took the advice and used the "new" sql schema ( https://docs.ejabberd.im/admin/configuration/#database-and-ldap-configuration). So after a lot of cursing and trying which option did apply to my ejabberd's version (again - there's no hint in the documenation) I finally got it running - but was unable to create a user, because the "new" sql schema was not supported in my version!

So I dropped the databases, recreated it with the "old" schema and finally after lots of trial and error I was finally able to make it work.

Jabber

After finally having worked out most of ejabberd's quirks I was playing with some Jabber clients when I finally found out that Jabber/XMPP lacks one of the most essential messenger's features: The ability to use more than one client at once!

(Well, yes, Whatsapp also makes this impossible, but at least they tell you this. Also Telegram's encrypted chats - they warn you about this, too)

I launched three clients - the one build in in Plasma (Telepathy), Kopete and one on Android. And it was like a roulette - some messages got routed to Android, some to Kopete, you got the idea. This makes Jabber next to useless: My usual setup is running a client on Android and one on my desktop, both seemlessly. So when I leave the desktop (with a superior keyboard)  I can continue the conversation using Android and vice versa. This is impossible using Jabber, I cannot access the old messages, and apparently there is a problem when using mobile: The frequent change of your IP address seems to cause problems in Jabber.

Extensibilty (XMPP)

I've learned that there is a workaround for my problem (multiple clients), its' an extension (hence the letter X), an XEP. You can extend the basic protocol by using extensions call XEP. There is some github repository for the necessary extension (XEP-0280), but why is such core feature for a messenger implemented as an extension? And even if, why it's not included in ejabberd's basic setup?

Anyway, this extensibility is in theory a good thing - in practise it causes lots of problems. For example, I've activated captcha for registrations. Unfortunately this resulted in not being able to register at all using a client - because the client in question didn't implement the needed XEP  (the web registration didn't work at all, only a 404. Why? No idea). So using Jabber involves two problems: First you have to find a server (open for registration) that implements all the XEPs you need and then you have to find the client which understand all the XEPs - not only on Desktop, also on mobile. This is far too much hassle in my option.

Matrix

I've never encountered any of these problems running synapse/Matrix. You have to configure some things, but this is well-documented, so was the migration from sqlite to PostgresQL - wenn smoothly. Furthermore, it did work out of the box - multiple clients per session, voice/video chat, channels, offline messenges, you name it.

Conclusion

Instead of opening the server for the public I just going to delete this piece of.. well, you know. The documentation isn't accurate, it's written in a language I do not know (Erlang) so I cannot support it if there are problems - and last but not least Jabber lacks the elementary features of a messenger - multiple clients per session. So I see no point in running an XMPP server, I've set up a profile on another server just in case if someone wants to contact me via Jabber. Matrix remains my primary choice.

There's also a German blog article about this: https://www.kuketz-blog.de/messenger-matrix-das-xmpp-fuer-hobby-admins/
Activating Warp Speed for Hubzilla's Database

  last edited: Sat, 26 Jan 2019 11:04:15 +0100  
How to significantly gain speed and perfomance for Hubzilla by just some minor adjustments.
Note: The DB section is about MySQL/MariaDB. However, PostgresQL will be similar effected. The solultion is database agnostic.
View article
File based session handling
Store your sessions in files residing  /tmp. Some time ago this was considered to be a bad/slow solution (after all, a database is faster, eh?) However, tmp now usually has got tmpfs as a filesystem, which means /tmp is a RAM disk, which is much, much faster than a database. (If your tmp is not having a tmpfs, try the other option). There are two caveats, though: When the machine where your PHP interpreter (either fpm or mod_php) runs on has to reboot (either due to planned maintenance or powerloss) the sessions will be gone, the users will have to log in again That's an acceptable price to pay. The second one concerns scaling issue: If you run a high-performance setup (i.e. load balancer, more than one webserver) this can't be used since all application servers have to access the shared sessions.
External session storage
You run a small key/value in-memory database on another host. The usual ones are memcache or Redis (I myself haven't got mixed experiences with Redis as as session store, but your mileage may vary). All application servers (Apache with PHP) can access the storage, so this is the way to go if you have more than one application server. If you use Redis, the session can also be saved in regular intervals on the disk, therefore you won't lose the sessions if your session storage goes down (reboot, update, whatver), however you will lose some speed advantage. I myself would recommend memcache, it's blazingly fast and stores the session ony in memory, but feel free to toy with Redis.

Setting it up in Hubzilla

Unfortunately Hubzilla doesn't support changing the session handler out of the box. I've written a small patch (which I will submit for review) to enable ist (it's attached to this article):
cd <your instance>/Zotlabs/Web
(copy Session.patch here)
patch < Session.patch

After that you can switch the session handler, by default it's still database, so the patch won't do any harm. If you want to change the handler change .htconfig.php in Hubzilla's base directory:
App::$config["system"]['session_custom'] = true;
App::$config["system"]['session_save_handler'] = "files";
App::$config["system"]['session_save_path'] = "/tmp"

(Or whatever you prefer - memcached, redis,..)

After that all your former sessions will be unavailabe, i.e. users have to login again (including nomad's users), but after that things run rather smoothly.

About the performance gain

In my case it's hard to say, because the ssd is so fast - still the graph seems to indicate that even on a fast ssd (4 cores, 16 GB Ram, 10 GB Innodb buffer pool) there is a perfomance gain. I'd love to see if someone tries this on a slow machine - how much perfomance did you gain? I'd really be interested in feedback.

Conclusion

By changing Hubzilla's session handling one can gain a significant perfomance boost - the only disadvantage is that the sessions may be a little bit volatile (i.e. not reboot safe), but that's a small price to pay.


Edit 2019-01-26

I've expanded the patch making it possible to change session.gc_probability and session.gc_divisor (defaulting to 1 and 100 for custom session handlers):

App::$config["system"]['session_gc_probability'] = 1;
App::$config["system"]['session_gc_divisor'] = 100;

(Session2.patch)
 
i like the idea. a little volatility in session management really is a small price to pay. how often do webservers go down, and most everyone will have their browsers 'remember' login/pwd for a frequently used site like hubzilla.

why don't you !-add this to @Hubzilla Development so that others can give their input? i don't think everyone who might have something to say follows the framagit issues...
Meine Top 10 Chefkochrezepte

  last edited: Fri, 14 Dec 2018 12:50:30 +0100  
Ich habe über 200 Chefkoch.de-Rezepte ausprobiert, die meisten davon waren gut und eine Vielzahl davon koche ich immer wieder mal. Ich habe hier meine Top 10 Rezepte, die ich auf chefkoch.de gefunden habe, aufgelistet, wobei ich bewusst auf Nummerierungen verzichtet habe - die Rezepte lassen sich nicht vergleichen: Was ist besser? Ein Nachtisch, ein Braten, eine Beilage? Hier sind sie, alphabetisch geordnet:
Chocolate-Lava-Muffins
Unglaublich gut, teilweise flüssig, und dazu auch sehr einfach herzustellen.
Der beste Pizzateig
Der Titel klingt anmaßend, aber stimmt tatsächlich: Pizza mit dem Teig (zu der Sauce kann ich nichts sagen, ich mache eine andere) aus dem Ofen kommt einer Pizza beim Italiener schon sehr, sehr nahe. Hätte man einen Ofen der so heiß würde wie in der Pizzeria, wäre es genau so gut.
Djuvec-Reis
Schöne, vegetarische Beilage, schmeckt mir deutlich besser als die oft eher wässrige und laffe Version in Balkanrestaurants. Ich packe noch Erbsen da rein.
Hüftsteak in einer feinen Cognac-Sahne-Soße
Einer der besten Hüftsteaks nebst Sauce, die ich kenne - man braucht schon ein gutes Steakhaus um das zu schlagen, oftmals gibt es das in schlechterer Qualität.
Indisches Butter Chicken aus dem Ofen
Für diejenigen, die gerne indisch essen (ich z.B.). Das schmeckt zu meinen Erstaunen tatsächlich wie beim Inder, und ist recht einfach zu kochen.
Mascarpone-Himbeerquark
Ein sehr, sehr guter Nachtisch bei gleichzeitig geringem Arbeitsaufwand (etwa 10 Minuten). Muss eine Nacht im Kühlschrank, aber das Resultat schlägt alles, vermutlich auch kalorientechnisch, das ist es aber wert :-)
Omas beste Frikadellen
Maggi hin oder her, Margarine im Rezept (ich nutze natürlich Butterschmalz zum Braten) - das sind bislang die besten Frikadellen, die ich kenne. Oft genug gemacht für unterwegs, hat bislang jedem (sofern er Frikadellen mag) geschmeckt :-)
Pfeffersauce
Ich mag Pfeffersauce (siehe Hüftsteakrezept), und die besonders :-) Wer die einmal gemacht hat wird nie wieder Fertigsaucen verwenden
Überbackene Spitzpaprika mit Käsefüllung
Einer meiner Lieblingsgerichte im Vegetarischen: Schmeckt auch ausgewiesenen Fleischessern sehr gut, und eignet sich daher auch gut für „gemischte“ (vegetarisch/omnivor) Gesellschaften, wenn man kein Lust hat mehrere Gerichte zu kochen.
Wildschweinbraten
Das bislang beste Wildrezept, was ich bisher gegessen habe, egal ob privat oder im Restaurant. Nicht ganz billig durch das Wildfleisch, ist es aber wert. Und auch nicht sonderlich viel Arbeitsaufwand.


Wenn man die Bewertungen der Rezepte ansieht, sehen das andere wohl auch so :-) Einfach mal ausprobieren, sollte für jeden was dabei sein.
 food
Elevation (Stephen King)

  


"Elevation" is the latest novella by Stephen King, taking place in King's favorite fictional town, Castle Rock
View article
 Review
The Divine Cities (Robert Jackson Bennett)

  last edited: Sat, 27 Oct 2018 15:49:48 +0200  


The Divine Cities is a fascinating and unique trilogy of mystery/thrillers set in a urban fantasy world, Definitely worth reading!
View article
 Review
 
Danke für die Empfehlung! Muss mir leider die deutschsprachige Übersetzung kaufen weil mein Englisch für Belletristik zu mager ist. Technische Texte gehen, Literarur ist zu anstrengend.
Aber vielleicht hab ich ja Glück mit der Übersetzung.
  
Ich lese Bücher schon seit langem ausschließlich im englischen Original - analoges gilt für Serien und Filme, deshalb kann ich keine Aussagen über die Übersetzungen machen :-) Dank Amazon, DVD/BluRays und PayTV sowie Cinestar Original in Berlin ist das mittlerweile auch keine Akt mehr. Das hat allerdings oft seltsame Konsequenzen: Wenn die Leute über die übersetzte Serie reden, frage ich mich wovon die Leute eigentlich reden - „Königsmund”? Häh? Ah, „King's Landing“ - welcher Schwachkopf hat denn das übersetztß :-D