Project

General

Profile

Tigase rest server does not return any response after some time

fahad tasleem
Added almost 2 years ago

I am using tigase-server-7.0.2-b3821 server. I am having an issue with the tigase rest server. It stops working after some time and the every request hangs which is causing problem in my application. There is nothing written in logs.
Could you please let me know if there is way to enable logs for rest server? I have tried by giving folder names in init.properties file but it did not work.

Please let me know if it is a known issue and if upgrading it to latest version would solve it. Could you please direct me to a documentation on how to update?


Replies (5)

Added by Wojciech Kapcia almost 2 years ago

Debuggging is not based on folder names but on packages, vide --debug guide. You can use following (note the http at the end):

--debug=server,xmpp.impl,http

Which HTTP server do you use? Build in or Jetty? You can configure it as described on Configuration wiki

Added by fahad tasleem 7 months ago

We are using built-in http server. I encountered this problem again.

Added by fahad tasleem 7 months ago

I have enabled the log to FINEST level.


2017-04-18 11:23:24.804 [Thread-89]        java_util_logging_Logger$finest.call()  FINEST: checking routings = [tigase.rest.adhoc.AdHocHandler@6c455804] for prefix = /rest/adhoc and uri = /sess-man@localhost
2017-04-18 11:23:24.805 [Thread-89]        java_util_logging_Logger$finest.call()  FINEST: checking localUri = /sess-man@localhost, prefix = /rest/adhoc, regex = /(?:([^@/]+)@){0,1}([^@/]+)
*2017-04-18 11:23:24.805* [Thread-89]        java_util_logging_Logger$finest.call()  FINEST: found handler
*2017-04-18 11:25:40.245* [Thread-89]        java_util_logging_Logger$finest.call()  FINEST: received content = {"command":{"node":"http://jabber.org/protocol/admin#send-iq","fields":[{"var":"from-jid","label":"jid-single","value":"red@localhost"},{"var":"to-jid","label":"jid-single","value":"pink@localhost"},{"var":"iq-type","label":"list-single","value":"set"},{"var":"inner-stanza","label":"text-multi","value":"<gram xmlns=\"http://abc.com/protocol/ABCEXT\" type=\"text\" ><text>Some text</text></gram>"}],"jid":null}}of type = application/json
2017-04-18 11:25:40.247 [Thread-89]        java_util_logging_Logger$finest.call()  FINEST: parsed received content = [command:[node:http://jabber.org/protocol/admin#send-iq, jid:null, fields:[[var:from-jid, value:red@localhost, label:jid-single], [var:to-jid, value:pink@localhost, label:jid-single], [var:iq-type, value:set, label:list-single], [var:inner-stanza, value:<gram xmlns="http://abc.com/protocol/ABCEXT" type="text"><text>Some text.</text></gram>, label:text-multi]]]]

When the server is started, the response to a REST call is very fast (<1000ms). After sometime, it starts taking more time and eventually hangs up.

Please note the time difference b/w found handler and the next line which is more than 2 minutes.

2017-04-18 11:23:24.805
2017-04-18 11:25:40.245

Can you please let me know what is the issue here.

Below is my configuration


--comp-name-3=http
--comp-class-3=tigase.http.HttpMessageReceiver
http/rest/api-keys[s]=open_access

Tigase version 7.0.2
Tigase HTTP API version 1.1.0

Added by Andrzej Wójcik 7 months ago

Between following lines:

2017-04-18 11:23:24.805* [Thread-89]        java_util_logging_Logger$finest.call()  FINEST: found handler
2017-04-18 11:25:40.245* [Thread-89]        java_util_logging_Logger$finest.call()  FINEST: received content = {"command":{"node":"http://jabber.org/protocol/admin#send-iq","fields":[{"var":"from-jid","label":"jid-single","value":"red@localhost"},{"var":"to-jid","label":"jid-single","value":"pink@localhost"},{"var":"iq-type","label":"list-single","value":"set"},{"var":"inner-stanza","label":"text-multi","value":"<gram xmlns=\"http://abc.com/protocol/ABCEXT\" type=\"text\" ><text>Some text</text></gram>"}],"jid":null}}of type = application/json

server does:
  • authorization of a requests
    In case of /adhoc requests user needs to be authorized as an admin to be able to execute command. To do so we are authorizing user by verification of provided username and password. During this operation server retrieves user password from database, so it may happen that over time access to database is slowing down.
  • reads data from input stream
    It is possible that over time it is harder and harded to connect to server (ie. due to increasing traffic) and as a result read of data from a network stream is slowed leading to delays.

I would suggest to check if any of situations described above are happening and if not, then I would check size of allocated memory for Tigase XMPP Server as garbage collection may also lead to hang ups.

How many requests is executed per second?
Maybe JVM embedded HTTP server is to slow and not as performant as you would expect?

In this case I would recommend to try Jetty as a HTTP server as described on our wiki page.

Added by fahad tasleem 7 months ago

This data is from my local machine and I agree the db connection might be slow in that case.

But on production we have a dedicated amazon ec2 node for tigase server. There it happened after a very long time (may be 2 3 months).

I would try to user jetty and collect more information. Will get back to you.

Thanks for your support.

    (1-5/5)