When we use batch calls with the helpdesk-cron.sh script, for each batch command the esup-helpdesk application is loaded in batch mode so that the Indexer (for example) can update the lucene index.
For the Indexer, the indexation of some new tickets can be quick (indeed, if there is no new ticket, the execution time is about 1 second) but the call of the batch command itself with helpdesk-cron.sh script can be about 10 seconds because of the loading of all the spring beans (and during this 10 seconds, the CPU is near to 100% of use).
* So the best is in fact to call this script on a dedicated server for this kind of jobs.
* But if we have only one server for esup-helpdesk, the best can be to call this cron tasks directly from the esup-helpdesk already loaded on tomcat server.
Indeed we can make this easily with Spring + Quartz !http://static.springsource.org/spring/docs/current/spring-framework-reference/html/scheduling.html#scheduling-quartz
To use Quartz instead of Cron, you can modify Batch.java so that required batch methods are public :
* public static void updateIndex(final boolean rebuild)
* public static void archiveTickets() {
* public static void expireTickets(final boolean alerts) {
* public static void recallTickets() {
* public static void sendTicketReports() {
* public static void sendFaqReports() {
Commentaire
Vincent Bonamy dit :
When we use batch calls with the helpdesk-cron.sh script, for each batch command the esup-helpdesk application is loaded in batch mode so that the Indexer (for example) can update the lucene index.
For the Indexer, the indexation of some new tickets can be quick (indeed, if there is no new ticket, the execution time is about 1 second) but the call of the batch command itself with helpdesk-cron.sh script can be about 10 seconds because of the loading of all the spring beans (and during this 10 seconds, the CPU is near to 100% of use).
* So the best is in fact to call this script on a dedicated server for this kind of jobs.
* But if we have only one server for esup-helpdesk, the best can be to call this cron tasks directly from the esup-helpdesk already loaded on tomcat server.
Indeed we can make this easily with Spring + Quartz !http://static.springsource.org/spring/docs/current/spring-framework-reference/html/scheduling.html#scheduling-quartz
To use Quartz instead of Cron, you can modify Batch.java so that required batch methods are public :
* public static void updateIndex(final boolean rebuild)
* public static void archiveTickets() {
* public static void expireTickets(final boolean alerts) {
* public static void recallTickets() {
* public static void sendTicketReports() {
* public static void sendFaqReports() {
Next we can add quartz jobs with spring : http://static.springsource.org/spring/docs/current/spring-framework-reference/html/scheduling.html#scheduling-quartz
Below the content of a cron.xml file defining spring beans so that esup-helpdesk tasks work : you can import cron.xml in properties/applicationContext.xml.
Don't forget to add quartz.jar (for example quartz-1.8.0.jar) in webapp/WEB-INF/lib/ and redeploy.http://www.quartz-scheduler.org/