5 Replies Latest reply on Aug 9, 2012 11:25 PM by Vladimir Smirnov

    jboss shedule not perform in time

    Vladimir Smirnov Newbie

           Hi. I'm using org.jboss.varia.scheduler.Scheduler on JBoss 5.1. On the testing environment in Windows OS it work correctly, but on the production AIX OS there is a strange behavior.

           I have some logging in the implementing class, and see that instance of my shedulable class is created, but method perform is not called in time. I have set the 2 hours shedule (7200000 millisec), but on AIX after start JBoss and create instance of my shedulable class in 7:32, perform method called in 12:12 once, correct do they work and then never repeatedly called after more than 12 hours.

           We setup latest IBM Java 6 for AIX, that give as noticeable increase in performance of some processes, but does not affect to the shedule problem.


           My shedulable class is implementing org.jboss.varia.scheduler.Schedulable.

           I place the listeners-service.xml to the deploy-hasingleton folder, content is:

      <?xml version="1.0" encoding="UTF-8"?>


           <mbean code="org.jboss.varia.scheduler.Scheduler" name="nat:service=ListenersCheker">

            <attribute name="StartAtStartup">true</attribute>

            <attribute name="SchedulableClass">nat.plugins.interactive.com.infoexchange.ListenersCheker</attribute>

            <attribute name="InitialStartDate">0</attribute>

            <attribute name="SchedulePeriod">7200000</attribute>

            <attribute name="InitialRepetitions">-1</attribute>





      Can someone help me to solve that problem?

        • 1. Re: jboss shedule not perform in time
          António Ribeiro Newbie

          Hey Vladimir,


          Try to use this:


          <attribute name="FixedRate">true</attribute>


          What it will do is, basically, take into consideration only the time you told JBoss the scheduler to start (SchedulePeriod). If you put this attribute to false, FixedDelay will be taken into account and then, not only the time you've sated the scheduler to start will be used but also it will have added the time that the scheduler took to process (SchedulePeriod=SchedulePeriod + AmountOfTimeOfLastProcessing).


          For more detail you can check this: http://community.jboss.org/message/168351


          Grateful for your attention.


          Best regards.

          1 of 1 people found this helpful
          • 2. Re: jboss shedule not perform in time
            Vladimir Smirnov Newbie

            Sorry for long time to wait for my answer, but i'l need time to test, because at the beginning the result was not clear.


            First of all, I discovered that failure occurs at high load of our JBoss server. When the load decreases, the service starts right on schedule.


            The first day after the addition of FixedRate parameter, I thought that the problem is solved. But the next day failures reappeared on high server load. Initially, shift reached few minutes, but one day service starts late by 3 hours.


            Finally, after week of testing, I came to the conclusion:

            1. Problem arises when a high load on the server
            2. The adding FixedRate param not solve the problem


            Also add that the main burden falls on the server when processing hundreds of thousands of requests per day, passed through Web services. These requests are handled promptly at any time, which suggests that the overall workload of the server is not overloaded.


            Also add that the time of service running (complete perform method) is maximum few (less than 2) minutes at any load.


            Any suggestions?

            • 3. Re: jboss shedule not perform in time
              António Ribeiro Newbie



              These are my suggestions:



              Hope that I gave you some enlightenment over your doubts. Any question just ask.


              Grateful for your attention.


              Best regards.

              • 4. Re: jboss shedule not perform in time
                Vladimir Smirnov Newbie

                First of all, the sheduled task is small and absolutely independed from main payload processes. The only shared resource, that i see on the my application level, is database source. But I doubt that the <depends>jboss.har:service=HibernateNAT</depends> is checked before call perform method, though perhaps I'm wrong.


                Anyway, i decide to change shedule engine for this task, and applied standart Java sheduler - Executors.newSingleThreadScheduledExecutor().scheduleAtFixedRate( this, timeout, timeout, TimeUnit.MILLISECONDS);


                I load Java sheduler from JBoss ServiceMBean. In my opinion, this is not the right approach, but now task sheduled right in time at any server load.


                I still do not know why the org.jboss.varia.scheduler.Scheduler is not properly working for me...

                • 5. Re: jboss shedule not perform in time
                  Vladimir Smirnov Newbie

                  Have same problems on JBoss 4.2.3 in the same environment (IBM Java, AIX OS). Using hardcoded standart Java sheduler on enterprise server is bad practice. I decide to move on Quartz engine, and seems it work perfect.

                  1 of 1 people found this helpful