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

Avatar

Avatar

chung_yonge1684

Avatar

chung_yonge1684

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

Avatar

Avatar

smacdonald2008

Total Posts

12.7K

Likes

1.4K

Correct Reply

2.3K

Avatar

smacdonald2008

Total Posts

12.7K

Likes

1.4K

Correct Reply

2.3K
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.

Avatar

Avatar

Jörg_Hoh

Employee

Total Posts

3.0K

Likes

953

Correct Reply

1.0K

Avatar

Jörg_Hoh

Employee

Total Posts

3.0K

Likes

953

Correct Reply

1.0K
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