Project

General

Profile

something wrong with online_status ?

cheng huang
Added over 5 years ago

hi all,

According to mysql-schema-4-schema.sql, online_status in table tig_users means:

    -- User online status, if > 0 then user is online, the value

    -- indicates the number of user connections.

    -- It is incremented on each user login and decremented on each

    -- user logout.

When my xmpp client crash, the value does not decrease, and always be positive.

Is there any way to handle these wrong online_status?

In our former projects, server can find tcp connections closed and do some cleaning works.

Is there any mechanism like that in Tigase server?


Replies (5)

Added by Wojciech Kapcia TigaseTeam over 5 years ago

Actually this is only DB level information and... it's not updated correctly in case of broken network connection (thus it may happen that without any connection of a user the number may be greater than 0). However, Tigase itself handles the dropped connections just fine and objects and information related to the missing connection are cleaned inside Tigase once the drop is detected.

Added by cheng huang over 5 years ago

Thanks for your quick reply!

It seems that DB level information management is a seperate part in Tigase server.

In my opinion, this online_status value is one of the user-related information, which can be used by some other components.

Because only Tigase server can modify it according to the real situations. I think Tigase server could do some clean work around it.

Is there other thing used for show the users' online status, expect the online_status?

Avatar?id=6023&size=32x32

Added by Artur Hefczyc TigaseTeam over 5 years ago

We move away from storing user status in DB for various reasons.

Right now, the user status can be stored in DB depending on DB configuration. More specifically what kind of SQL queries are used for user login and user logout.

By default we use stored procedures which perform user authentication and when successful update the user online status in DB. However, depending on configuration a different SQL query or procedure can be used which performs different actions. The same applies to user logout. A query (a stored procedure for example) is called which can perform certain actions, such as updating user online status. By default there is no user logout query as far as I know.

We are moving away from updating user status as I mentioned above because:

  1. It is difficult to maintain a correct user status between server restarts, on user startup it should somehow cleanup DB and if there are millions of records this takes too much time

  2. In a cluster mode it is practically impossible to maintain correct user status in DB if some cluster nodes are restarted

  3. Under a high load we want user login and logout to be as fast as possible, hence we are reducing DB IO as much as possible

That said, it is possible to share user status with separate systems but in all cases we have done a custom framework to provide user's status to the external system to make sure it does not impact performance and is accurate.

Added by cheng huang over 5 years ago

Oh, I see.

Could you please show more detail about the "a custom framework to provide user's status to the external system to make sure it does not impact performance and is accurate"?

Is it similar to the manager module of Openfire?

Can I get it from www.tigase.org?

Avatar?id=6023&size=32x32

Added by Artur Hefczyc TigaseTeam over 5 years ago

By a custom framework I mean custom made for a client according to the client specific requirements.There is no solution ready out of the box for this. We specialize in large installations. Each of our customer has a different system and a different way for integration is required.

I do not know Openfire, so I cannot refer to it.

    (1-5/5)