I created a sample program that joins a multi user chat room in Openfire Server.
I changed the "Maximum Room Occupants" of multi user chat room to "unlimited".
On joining around 850 user in a multi user chat room, I am getting the following exception
org.jivesoftware.openfire.session.LocalSession - Internal server error
java.lang.NullPointerException
at org.jivesoftware.openfire.nio.NIOConnection.deliver(NIOConnection.java:356)
at org.jivesoftware.openfire.session.LocalClientSession.deliver(LocalClientSession.java:857)
at org.jivesoftware.openfire.session.LocalSession.process(LocalSession.java:289)
at org.jivesoftware.openfire.muc.spi.LocalMUCRole.send(LocalMUCRole.java:263)
at org.jivesoftware.openfire.muc.spi.LocalMUCRoom.broadcast(LocalMUCRoom.java:1155)....
CPU Usage is also increasing to 100% at this time.
Please advice me to solve this problem.
According to me you should go for high configured server.That have good RAM and Processor. So, it handled more users in multi-chat.
Just talk once in openfire community with moderators.Take advice from them.
They will give you best solution.
here you can go.
Thank You hope this will help you.
Related
I'm pretty new with ejabberd and I have two questions.
What is the best approach to check which user seen a message or to see where the user stopped reading?
Do you know any open source clients written in javascript except or similar to https://www.npmjs.com/package/#pazznetwork/ngx-chat?
Thanks and have a great day :)
For 1, I guess one implementation path would be that the client and server support https://xmpp.org/extensions/xep-0184.html and also https://xmpp.org/extensions/xep-0313.html and also that those two can work together, and that they work in MUC rooms. I don't expect that to work.
For 2, what about https://conversejs.org/ ?
I'm trying to build an Instant Messaging functionality in my app as part a bigger project.
Chats can have more than 2 participants (group chats)
If participant A delete a message, it still should be visible to participant B (that's why I used the Message Participants table)
Same applies to Conversation.
By same logic, if all participants delete the conversation/message, it should be erased from DB.
Questions :
I'm afraid that this schema is too cumbersome, meaning that the queries will be too slow once the app gets certain traffic mark (1k active users ? I'm guessing)
Message Participants will have multiple records for each message - one for each participants in the chat. Instant Messaging means it will involve those writes with very tight timings. Wouldn't that be a problem?
Should I add a layer of Redis DB, to manage a chat's active session's messaging? it will store the recent messages, and actively sync the PostgreSQL db with those messages (perhaps with Async transactions functionality that postgresql has?)
UPDATED schema :
I would also gladly hear ideas for having a "read" status functionality. I'm assuming it's much more complex with Group chats, so at least offering that for 1:1 chats would be nice.
I am a little confused by your diagram. Shouldn't the Conversation Participants be linked to the Conversations instead of the Message? The FKs look all right, just the lines appear wrong.
I wouldn't be worried about performance yet. The Premature Optimization Anti-Pattern warns us not to give up a clean design for performance reasons until we know whether we are going to have a performance problem. You anticipate 1000 users - that's not much for a modern information system. Even if they are all active at the same time and enter a message every 10 seconds, this will just mean 100 transactions per second, which is nothing to be afraid of. Of course, I don't know the platform on which you are going to run this. But it should be an easy task to set up those tables and write a simple test program that inserts those records as fast as possible.
Your second question makes me wonder how "instant" you expect your message passing to be. Shall all viewers of a message receive each keystroke of the text within a millisecond? Or do they just need to see each message appear right after it was posted? Anyway, the limiting factor for user responsiveness will probably be the network, not the database.
Maybe this is not mainly a database design issue. Let's assume you will have a tremendous rate of postings and viewings. But not all conversations will be busy all the time. If the need arises - but not earlier - it might be necessary to hold the currently busy conversations in memory and using the database just as a backup for future times when they aren't busy any more.
Concerning your additional comments:
100k users: This is a topic not for this forum, but concerning business development of a startup. Many founders of startup companies imagine huge masses of users being attracted to their site, while in reality most startups just fail or only reach very few. So beware of investments (in money, but also in design and implementation effort) that will only pay in the highly improbable case that your company will be the next Whatsapp.
In case you don't really anticipate such masses of users but just want to imagine this as a programming exercise, you still have a difficult task. You won't have the platform to simulate the traffic, so there is no way to make measurements on where you actually have a performance problem to solve. That's one of the reasons for the Premature Optimization warning: Unless you know positively where you have a bottleneck, you - and all of us - will be just guessing and probably make the wrong decisions.
Marking a message as read is easy: Introduce a boolean attribute read at Message Participants, and set it to true as soon as, well, the user has read the message. It's up to your business requirements in which cases and to whom you show this.
I new to botkit. Still exploring the framework.
How does the botkit scale? Can I set up multiple server and route request randomly? Will the context be preserved if each user requests end up in different server?
Saving the session into dbs is the only way to go ahead, Botkit does not support it by default.
There are other people trying to solve similar problem, this might help https://github.com/howdyai/botkit/issues/251
I've recently been playing with the new MUC-Sub module in ejabberd - the use case being I need to have WhatsApp-like permanent rooms in my mobile app. Before I go too further into using MUC/Sub, can an ejabberd expert opine on the below concepts please? Is probably a lack of full knowledge of ejabberd on my part, hence the basic questions. Or else do let me know please a good place to start understanding the below better... I did study these two links in detail already (https://blog.process-one.net/xmpp-mobile-groupchat-introducing-muc-subscription/ and https://docs.ejabberd.im/developer/proposed-extensions/muc-sub/). Thanks!
Essentially, if we need an MUC room to stop being destroyed when all users go offline, could we not simply disable that feature - so that the service continues to operate even when participants leave or the room is empty. The service could still be made to continue pointing to the original room participants who joined the room, and in case there is a message sent in the room, the message would get queue up on each participant's stream. If a participant is offline, the message would enter his / her offline messages list (instead of the archive / MAM that MUC-Sub is currently utilizing). Why did we need to rely on the Pub-Sub and MAM model if this problem could have been solved using simply retention of the participant's reference in the room (even after he / she goes offline) and then leveraging the mod_offline module (which should happen automatically).
Am sure there is a fundamental reason here that am overlooking but appreciate if someone can throw some light please!
As the blog post explains, this is not a matter about keeping chat room alive or not. The fact that users cannot receive pushes when offline or when they reconnect, if they do not join again, is because MUC is based on presence. A user that is not present in the room is not an occupant of the room and is not supposed to receive anything.
I recommend you read careful XEP-0045 MUC and MUC Sub blog post again. The issue MUC Sub solves should be more obvious.
If you do that, you will notice that XEP-0045 define the idea of persistent MUC:
Persistent Room
A room that is not destroyed if the last occupant exits; antonym: Temporary Room.
Default in ejabberd is to create the room as temporary when a user joins, but the setting of the room can be changed so that it becomes persistent. In that case, it is not destroyed when the last occupant leave. You need to change room configurations option (same form you used to enable MUC Sub on that room).
You would generally want to combine this option for the room with MUC Sub enabling, so that MUC room are kept around even if no user are present in it.
You're probably a lot to be subscribers to various mailing list, some more updated than others.
What are your best practices to follow all information going by these lists?
What are the best clients you've used to managed that?
I'm sure I'm not the only one trying to get the best signal out of this noisy way of communication :)
I like gmail because of the way it groups messages by conversation so I can just page down through a thread.
Use a rule in GMail to slap a label on and archive all of them. Then they are easily sortable, searchable, and threaded.
I just use Thunderbird. For some lists, in flat mode, for others (the Lua mailing list), in threaded mode. Following is natural for mailing list, the messages are pushed to your client.
At first, I just received the messages and routed them to the right folder with some rules.
Now, I read them as newsgroups using Gmane, which also allow to catch up history (including mails which were sent before my subscription started and those which were sent during a temporary unsubscription).
Sometime, when a thread has no interest for me, I just right click on the first message and select Mark all messages of this thread as read.
Using KDE Ia m using Kontact for my mail and RSS feeds. That gives me a nice command center.