10 Replies Latest reply on May 23, 2013 7:43 AM by Nicolas Filotto

    Navigation move takes too long

    Jan Tilo Henseler Newbie

      Hi all,

       

      currently we have a problem in moving navigation nodes in the portal.

       

      We are working on GateIn 3.5.0, but the Problem is also reproducable in GateIn 3.4.0.

       

      Navigation nodes are created by an automated process. The amount of nodes is high. (1000 nodes, with an navigation depth up to 5 levels)

      If we try to move a node (with subnodes), the changes are persisted after about 2-3 hours.

       

      I measured the time the navigationService.saveNode() method takes to finished. This is about 2min.

      Afterwards I looked into the JCR, but the changes are not saved.

       

      As already said, the changes can be seen in JCR (and on the web frontend) after about 2 or 3 hours.

       

      Do be sure that my implementation is not the problem, I moved the navigation by using the standard "Edit navigation" functionality, with same results.

       

      Does anybody has a suggestion how to decrease the time of saving.

       

      Btw.: The time of saving increased after we switched to GateIn 3.4.0. In older versions the time was not such a big problem.

       


      I am grateful for any help.

       

      Regards

      Jan Tilo

        • 1. Re: Navigation move takes too long
          Minh Hoang TO Novice

          Could you describe how navigation nodes were created?

          • 2. Re: Navigation move takes too long
            Jan Tilo Henseler Newbie

            The navigation nodes are written into JCR, means a "mop:navigation" item and its children are written into the portal-system workspace.

            The nodes are created below an invisible navigation node.

            After all nodes are created, the nodes are moved to be sctive by using the NavigationService.

             

            This approach currently works ok, if the amount of created nodes is low.

            • 3. Re: Navigation move takes too long
              Minh Hoang TO Novice

              We are investigating the issue and would feedback you as soon as possible.

              • 4. Re: Navigation move takes too long
                Minh Hoang TO Novice

                @Jan:

                Did you move the node with Cut&Paste instead of Copy/Paste? I tried to move a node with about 1000 descendents to another node and see that the changes is persisted quickly.

                 

                 

                Anyway, while i created a node with 1000 children for such test (via my own tool which relies on NavigationService), i noticed that:

                 

                1. It took not much time to create the first 600 children

                2. It took much much much time to create the next 400 children

                 

                CPU record from JProfiler told me that the bottleneck is index-stuff in JCR

                • 5. Re: Navigation move takes too long
                  Jan Tilo Henseler Newbie

                  Hi,

                   

                  I tested the following:

                   

                  I moved the node with Cut&Paste. The Frontend shows the message "saving". This takes about 30sec-1min. I can see the change in this admin view (Edit Navigation). Afterwards I refreshed the portal. The navigation is not changed. Then I opened "Edit Navigation" again. The changes are not shown.

                  I also can see, that CPU load is high, also after the save is finished. If I access the portal after the CPU load decreases the navigation is changed.

                   

                  Second test:

                  I move the navigation by using NavigationService/NavigationContext. I take a node and put it below another node(NodeContext.add(null, otherNode)). Afterwards I call NavigationService.save().

                  I inspected the same result. NavigationService.save finishes after 1-2min. The persistence in JCR changes later (1-2hours).

                   

                  Do you know any other API/Service function to manipulate my navigation?

                  • 6. Re: Navigation move takes too long
                    Minh Hoang TO Novice

                    Jan Tilo Henseler wrote:

                     

                    Hi,

                     

                    I tested the following:

                     

                    I moved the node with Cut&Paste. The Frontend shows the message "saving". This takes about 30sec-1min. I can see the change in this admin view (Edit Navigation). Afterwards I refreshed the portal. The navigation is not changed. Then I opened "Edit Navigation" again. The changes are not shown.

                    I also can see, that CPU load is high, also after the save is finished. If I access the portal after the CPU load decreases the navigation is changed.

                     

                    Second test:

                    I move the navigation by using NavigationService/NavigationContext. I take a node and put it below another node(NodeContext.add(null, otherNode)). Afterwards I call NavigationService.save().

                    I inspected the same result. NavigationService.save finishes after 1-2min. The persistence in JCR changes later (1-2hours).

                     

                    Do you know any other API/Service function to manipulate my navigation?

                     

                    I used Crash (our command line tool to access/manipulate JCR nodes)  to check the persistence and saw that moving a node containing 1000 children to other node (using Cut&Paste) was done quickly.

                     

                    My test environment is:  GateIn 3.6.M01-SNAPSHOT (which is not diff from GateIn 3.5 in term of nav service)  +  Tomcat 7 + MySQL

                     

                    To manipulate navigation, you could use https://github.com/crashub/crash . Just deploy the .war generated from artifact  jcr/exo and connect to Crash agent via  command telnet localhost 5000

                     

                    You could also use my service component https://github.com/mto/gatein-data-injector  to manipulate via JConsole

                    • 7. Re: Navigation move takes too long
                      Minh Hoang TO Novice

                      @Jan: Could you describe your test environment (Server, DB, memory configuration) and layout of your moved navigation?

                      • 8. Re: Navigation move takes too long
                        Minh Hoang TO Novice

                        Environment:  GateIn 3.6.0-M01-SNAPSHOT + MySQL

                         

                        I moved 1000 nodes using Cut/Paste as illustrated in screenshots and it took about 2 minutes to persist move action

                         

                        1. firstLevel node has 4 children and each child has 200 children

                        testMoveNav_1.png

                         

                        2. Move firstLevel node to newFirstLevel node  (using Cut/Paste and click on Save button)

                         

                        testMoveNav_2.png

                         

                        testMoveNav_3.png

                         

                        3. As two minutes elapsed (clock at top-right corner of my screen), reopen the navigation management popup to see the change persisted

                        testMoveNav_4.png

                         

                        testMoveNav_5.png

                        • 9. Re: Navigation move takes too long
                          Minh Hoang TO Novice

                          JProfiler snapshot for above move action in attached file