Highlighted

How can I measure average waiting time as nodes increase efficiently?

chung_yonge1684

06-11-2018

Hello Everyone,

I have implemented the logic for dispatcher on Apache Server programatically.

My logic for dispatcher is like below one.

-Step01 : Delete old cache.

-Step02 : Create new cache.

But I found serious issue when I tested cache on dispatcher.

New cache was always deleted because creating new cache was faster than deleting old cache.

So I had to add 1 second for waiting time before new cache was created like below one.

boolean deleted = DispatcherUtil.invokeToDeleteCache(resolver, replicationAction.getPaths(), ReplicationActionType.DELETE);

              if (deleted) {

                   try {

                              TimeUnit.SECONDS.sleep(1); // wait 1 second

                    } catch (InterruptedException e) {

                                log.error(e.getMessage(), e);

                    }

                    DispatcherUtil.invokeToCreateCache(resolver, replicationAction.getPaths());

               }

After I added 1 second for waiting time, new cache has created successfully.

So I wonder what the average waiting time is as nodes increase like below picture.

1615740_pastedImage_1.png

How can I measure average waiting time as nodes increase efficiently?

Regards

Chung Yong.

Replies

Highlighted

smacdonald2008

06-11-2018

I am not that there can be a formula that will work for all instances. I am sure there will be different factors. Having said that - lets see what other AEM community members have to say about this.

Highlighted

Jörg_Hoh

Employee

06-11-2018

Hi,

may I ask the question what your goal is? I never saw a requirement to write code to invalidate the dispatcher cache. Also I am not familiar with the terms "old cache" and "new cache" regarding dispatcher. Can you elaborate your usecase in more detail?

Thanks,

Jörg