15 Replies Latest reply on Jun 16, 2015 12:22 AM by Konstantin

    Tinder cpu overheat

    Konstantin

      Our company had made some profiling of Openfire 3.9.3 instance under frequent messaging and presence requests and find out that current Tinder implementation waste cpu time.
      We've made some refactor and update org.gnu.inet.libidn from 1.15 to 1.28, we've got this refactored implementation in production for couple of month, so we think that it is the time to contribute some... We are ready to post pull request to Tinder git repo but looks like better to get issue assigned first, so that is all about )

       

      In short: 2 classes changed + updated pom with uploaded to JCenter new libidn version, author of libidn was asked to update it in maven central too, but it would require much time ([OSSRH-13173] Please create project for GNU Libidn JAVA port - Sonatype JIRA )

       

      Here some screenshots of profiling results:

      1. Before any Tinder changes

      Снимок экрана 2015-01-13 в 14.51.46.png

       

      2. After refactoring Tinder

      after_refactor_before_libidn.png

       

      3. Refactored Tinder and fresh libidn (1.28)

      after_libidn.png

        • Re: Tinder cpu overheat
          Flow

          That's great!

           

          Created TINDER-70, note that the latest libidn version appears to be 1.29 at the time of writing.

           

          Could you ask Simon Josefsson to put this version ot OSS Sonatype, so that we can use the maven artifact instead of adding binaries to the repo?

            • Re: Tinder cpu overheat
              Flow
              Could you ask Simon Josefsson to put this version ot OSS Sonatype, so that we can use the maven artifact instead of adding binaries to the repo?

              Never mind, I see this is already in progress at OSSRH-13173.

              • Re: Tinder cpu overheat
                Konstantin

                Cant predict how long it will take to update Maven Central, anyway may additional public repo (http://jcenter.bintray.com/) be used inside Tinder's pom?

                • Re: Tinder cpu overheat
                  Konstantin

                  One more question: https://igniterealtime.org/issues/browse/TINDER-70created issue is about only libidn update, but not the last part is 2 refactored Tinder classes, should I upload pull request under the same brunch and issue?

                    • Re: Tinder cpu overheat
                      Flow

                      If the refactoring is a direct requirement from the libidn update then it goes in the same commit. If not I guess it's ok if you use the same PR but use an extra commit, and I think no additional issue will be required..

                    • Re: Tinder cpu overheat
                      CSH

                      so that we can use the maven artifact instead of adding binaries to the repo?

                      Binaries are added to the repo anyway. Tinder and stringprep.jar are here:

                      Openfire/build/lib/merge at master · igniterealtime/Openfire · GitHub

                       

                      Artifact versions are maintained in this file:

                      Openfire/versions.txt at master · igniterealtime/Openfire · GitHub

                       

                      So there's no need to wait until it's available on Maven Central, because Openfire doesn't use it anyway (unfortunately).

                       

                      @Konstantin, you could therefore go ahead and prepare a pull request which contains the new stringprep.jar and an updated versions.txt.

                      If the new jar requires a Tinder update, you would also need to update Tinder first, make a PR for Tinder and then a PR for Openfire containing the new tinder.jar.

                        • Re: Tinder cpu overheat
                          Konstantin

                          The problem is that I DO need update tinder codebase and it uses libidn artifact from Maven Central.
                          I suggested use JCenter repo in tinder coz we already published there 1.28 version of libidn.
                          Btw some review was done on JCenter side before let us publish.
                          So I was told to wait official release on Maven Central.
                          Without resolution from where I should use libidn I cant move on...

                            • Re: Tinder cpu overheat
                              CSH

                              Ah I thought you only wanted to update Openfire.

                               

                              If your your code changes to Tinder require the latest stringprep.jar, we have a problem, yes. (but only until it's available on Central).

                              If your your code changes to Tinder run with an older version of stringprep.jar, everything is fine. You could update the code without updating strinprep.jar (and do that one later).

                               

                              If you want to update only Openfire you could build tinder.jar locally with the latest stringprep.jar and then update Openfire with the new tinder.jar and stringprep.jar. I know this is very ugly and probably should better be avoided, but Openfire runs on a tinder-1.3.0-SNAPSHOT anyways and I think nobody knows which version (build) it actually is.

                                • Re: Tinder cpu overheat
                                  Konstantin

                                  Looks like Tinder does not use stringprep.jar at all, it uses libidn.jar
                                  We found CPU consumption first within Tinder and after fixing it found the same troubles inside old libidn.jar (1.15).
                                  So we update tinder code AND update libidn.jar to 1.28 (see the first post with all 3 stages graphs: "before" - "only tinder" - "tinder and libidn").
                                  We did not touch stringprep.jar at all.
                                  So I was going to update 2 libs inside Openfire to fix CPU consumption: tinder and libidn, not stringprep.
                                  For now I'm thinking about PR to tinder with Bintray repo dependency inside - just to let team see what was changed and let update that PR or update it just on merge (if it will be merged) with official libidn Maven release later.
                                  And we are going to setup Travis build for our Tinder branch and thus Opefire team will be able to get both jars just from public Bintray repo.

                                  • Re: Tinder cpu overheat
                                    Konstantin

                                    PR was uploaded to Tinder
                                    https://github.com/igniterealtime/tinder/pull/1

                                     

                                    2 libs may be updated in Openfire to apply this fix:

                                     

                                    1. libidn.jar to 1.28(1.29) version available on http://ftp.gnu.org/gnu/libidn/

                                    2. New tinder.jar from http://dl.bintray.com/kyakimov/maven/org/igniterealtime/tinder/1.3.0/ or wait for official libidn Maven release and build it after PR merge (if it will be accepted)