5 Replies Latest reply on Mar 15, 2019 11:03 AM by jgoldhammer

    Reponse from osapi.jive.core.get() Extremely Slow

    eric.anastas

      I have developed a custom tile which displays featured blog posts in a carousel. I have not made any changes to the tile recently, and it has been working fine for months. However, as of last Friday it has been taking a very long time, as in 10-15 seconds, for the tile to display any content.

      I did some debugging and found that my call to osapi.jive.core.get() is taking a very long time to return. For example here's a screen shot that shows response times from 5-12 seconds!

       

      I'm using the API to retrieve the latest blogs posts from a number of key places on our Jive site. I'm able to make the following REST request request directly to the site with out a problem.

       

      https://inside.som.com/api/core/v3/contents?sort=dateCreatedDesc&fields=banner,subject,tags,permalink,contentImages,published,-resources&filter=type%28post%29&filter=place%28https%3A//inside.som.com/api/core/v3/places/5400,https%3A//inside.som.com/api/core/v3/places/1009,https%3A//inside.som.com/api/core/v3/places/1011,https%3A//inside.som.com/api/core/v3/places/1019,https%3A//inside.som.com/api/core/v3/places/1062,https%3A//inside.som.com/api/core/v3/places/1108,https%3A//inside.som.com/api/core/v3/places/130137,https%3A//inside.som.com/api/core/v3/places/142445,https%3A//inside.som.com/api/core/v3/places/1037,https%3A//inside.som.com/api/core/v3/places/4717,https%3A//inside.som.com/api/core/v3/places/1027%29&abridged=false&includeBlogs=true&count=25

       

      As you can see the response returns in 302 ms in Postman.

       

       

      However, making the same request via osapi.jive.core.get() takes multiple seconds to return.

       

      var requestTime = new Date();

       

      osapi.jive.core

          .get({

              href: url,

              v: "v3"

          })

          .execute(function(res) {

              var responsetime = new Date();

              var respElapsed = responsetime - requestTime;

              console.log(

                  "Request: " + requestTime.toLocaleTimeString() +

                  ", Response: " + responsetime.toLocaleTimeString() +

                  ", Elapsed: " + respElapsed +

                  ", URL:" + url

              );

              callback(res);

          });

      This logs responses times from 2.3 all the way up to 21.0 seconds

       

      Request: 12:38:43 PM, Response: 12:38:47 PM, Elapsed: 3614, URL:/contents?sort=dateCreatedDesc&startIndex=0&fields=banner,subject,tags,permalink,conten...

      Request: 12:38:47 PM, Response: 12:38:52 PM, Elapsed: 4953, URL:/contents?sort=dateCreatedDesc&fields=banner,subject,tags,permalink,contentImages,publi...

      Request: 12:38:52 PM, Response: 12:38:55 PM, Elapsed: 3101, URL:/contents?sort=dateCreatedDesc&fields=banner,subject,tags,permalink,contentImages,publi...

      Request: 12:38:55 PM, Response: 12:38:58 PM, Elapsed: 3355, URL:/contents?sort=dateCreatedDesc&fields=banner,subject,tags,permalink,contentImages,publi...

      Request: 12:38:58 PM, Response: 12:39:00 PM, Elapsed: 2277, URL:/contents?sort=dateCreatedDesc&fields=banner,subject,tags,permalink,contentImages,publi...

      Request: 12:39:00 PM, Response: 12:39:06 PM, Elapsed: 5360, URL:/contents?sort=dateCreatedDesc&fields=banner,subject,tags,permalink,contentImages,publi...

      Request: 12:39:06 PM, Response: 12:39:27 PM, Elapsed: 20959, URL:/contents?sort=dateCreatedDesc&fields=banner,subject,tags,permalink,contentImages,publ...

      Request: 12:39:27 PM, Response: 12:39:31 PM, Elapsed: 4692, URL:/contents?sort=dateCreatedDesc&fields=banner,subject,tags,permalink,contentImages,publi...

      Request: 12:39:31 PM, Response: 12:39:46 PM, Elapsed: 14374, URL:/contents?sort=dateCreatedDesc&fields=banner,subject,tags,permalink,contentImages,publ...

      Request: 12:39:46 PM, Response: 12:39:52 PM, Elapsed: 6591, URL:/contents?sort=dateCreatedDesc&fields=banner,subject,tags,permalink,contentImages,publi...

      Request: 12:39:52 PM, Response: 12:40:06 PM, Elapsed: 13565, URL:/contents?sort=dateCreatedDesc&fields=banner,subject,tags,permalink,contentImages,publ...

      Request: 12:40:06 PM, Response: 12:40:16 PM, Elapsed: 10432, URL:/contents?sort=dateCreatedDesc&fields=banner,subject,tags,permalink,contentImages,publ...

      Request: 12:40:16 PM, Response: 12:40:21 PM, Elapsed: 4488, URL:/contents?sort=dateCreatedDesc&fields=banner,subject,tags,permalink,contentImages,publi...

      Request: 12:40:21 PM, Response: 12:40:28 PM, Elapsed: 6565, URL:/contents?sort=dateCreatedDesc&fields=banner,subject,tags,permalink,contentImages,publi...

      Request: 12:40:28 PM, Response: 12:40:37 PM, Elapsed: 9079, URL:/contents?sort=dateCreatedDesc&fields=banner,subject,tags,permalink,contentImages,publi...

      Request: 12:40:37 PM, Response: 12:40:44 PM, Elapsed: 7242, URL:/contents?sort=dateCreatedDesc&fields=banner,subject,tags,permalink,contentImages,publi...

      Request: 12:40:44 PM, Response: 12:40:52 PM, Elapsed: 7822, URL:/contents?sort=dateCreatedDesc&fields=banner,subject,tags,permalink,contentImages,publi...

       

       

      Related: Making REST API calls directly from a Jive app or tile



        • Re: Reponse from osapi.jive.core.get() Extremely Slow
          jgoldhammer

          Hi Eric,

           

          very interesting observation!

           

          "social/rpc" calls are handled differently in comparison to normal ajax calls- social/rpc calls are handled by the opensocial container Apache Shindig within Jive. Technically this is the JiveJsonRpcServlet which extends the JsonRPCServlet (shindig/JsonRpcServlet.java at trunk · apache/shindig · GitHub ) from Apache Shindig (GitHub - apache/shindig: Mirror of Apache Shindig (incubating) ). This servlet hands over all calls to a  HttpRequestHandler shindig/HttpRequestHandler.java at trunk · apache/shindig · GitHub which executes this requests via own requestpipeline (shindig/DefaultRequestPipeline.java at trunk · apache/shindig · GitHub ). This pipeline will call the jive endpoint again via network to execute the plain ajax request (the same like in postman).

           

          My guess: Aurea has made a change in the shindig execution layer which leads to this result. Maybe we have limited resources here, so that the layer cannot handle all incoming requests at the same time and social-rpc-requests have to wait to be executed. That would explain the different response times, especially in comparison with the direct ajax call.

           

          In the end only Aurea can tell you via application monitoring what the problem is. AFAIK they use New Relic and should be able to answer this question...

           

          Thanks

          Jens

            • Re: Reponse from osapi.jive.core.get() Extremely Slow
              eric.anastas

              Thanks for the very informative response!

               

              I originally filed a support ticket with Aurea on this issue, but the support rep responded saying there's nothing he can do because customizations and the REST API are beyond the scope of Aurea support .

               

              What can Jive Support help you with? What can't Support do?

               

              So what options do I have from here? This obviously isn't something I can troubleshoot.

                • Re: Reponse from osapi.jive.core.get() Extremely Slow
                  jgoldhammer

                  Eric,

                  ok- understood.

                   

                  Some other questions:

                  • Was your jive platform upgraded during that time?
                  • Do you see other social/rpc calls from the jive platform itself which are slow?

                   

                  If you find some slow calls from the platform, you could create a new support ticket with these findings. I think it is a general issue and not related to your custom tiles...

                   

                  Thanks

                  Jens

                    • Re: Reponse from osapi.jive.core.get() Extremely Slow
                      eric.anastas

                      I'm not aware of our instance of Jive being upgraded when this started becoming a problem. We are on Jive Cloud and I see "Jive SBS 2019.1.0.0" on the top right of the admin panell.

                       

                      My tile makes other requests to osapi.jive.core.get() which do not take a long time. Here's what the tile does.

                       

                      1. Get current users streams from "/people/@me/streams" and only record offical "publication" streams.
                      1. Gets the associated places for each stream "/streams/{streamID}/associations

                       

                      Next I attempt to read the most recently created blogs in any of these places. Here's my code that that generates the request URL.

                       

                      var featuredBlogsReqUri = "/contents?sort=dateCreatedDesc&startIndex=0" +

                          "&fields=banner,subject,tags,permalink,contentImages,published,-resources" +

                          "&includeBlogs=True&filter=type(post)";

                       

                          if (newsPlaceUris.length > 0) {

                       

                       

                              featuredBlogsReqUri += "&filter=place(";

                       

                              for (var i = 0; i < newsPlaceUris.length; i++) {

                                  featuredBlogsReqUri += newsPlaceUris[i];

                       

                       

                                  if (i < newsPlaceUris.length - 1) featuredBlogsReqUri += ",";

                                  else featuredBlogsReqUri += ")";

                                }

                              }

                       

                      Requesting the URLs generated from this code directly to the rest API is fast, but is slow through osapi.jive.core.get().

                        • Re: Reponse from osapi.jive.core.get() Extremely Slow
                          jgoldhammer

                          So it seems to be related with the upgrade, but it does not seem to be a general issue with osapi. But nevertheless, only Aurea can help here. I have reached out to some  contacts, but it seems that there is no one responsible at Aurea for such kind of issues.

                           

                          I would suggest to reach out your account manager to escalate this issue...

                          The problem is very clear and should be straight forward to solve it...