11

We're implementing a .NET DXA based solution for a client, and part of the scope of work will be to conduct load testing to bring the site in line with a performance budget.

Our initial investigations using a simple single JMeter test (50 users ramping up over 5 seconds) is that the website response times go through the floor and CPU maxes out as soon as we put any load on it. We thought this may just be limited to our implementation, but having testing against a vanilla DXA solution the problem persists.

Instrumentation indicates that the performance bottleneck occurs when resolving links, and that this doesn't seem to change regardless of whether we have object caching enabled.

When we switch on asp.net output caching for the PageController we do find that we can alleviate the issue, but once the cache expires it seems to cascade again.

The final site will be behind Akamai, which combined with page caching will hopefully help, but it would be great if there's a better approach as it feels like we'd just be masking an underlying issue.

Has anybody else experienced this issue, and if so do you have any pointers?

Thanks in advance,

Tom

screenshot of graph

4
  • Do you have SDL cache enabled in the storage configuration? Mar 2, 2016 at 15:31
  • Hi guys, thanks for the help - it turns out that we had a typo in the object caching configuration (doh!); everything is working much better now!
    – tomjgroves
    Mar 2, 2016 at 16:19
  • 1
    Nice to hear. Indeed, with object caching set up correctly you'll get very fast response times as Nuno noted awhile back (note queries are now cached as well). It'd be great to see the comparison results with caching working--could you post the follow-up graph if you have time? Mar 3, 2016 at 8:15
  • 2
    @AlvinReyes here you go - this is with object caching and .NET output caching. Quite the difference! Thanks again to everybody for the prompt and useful advice :-)
    – tomjgroves
    Mar 3, 2016 at 9:07

2 Answers 2

9

There are various optimization and checks you can do for performance in DXA

  • Enable DD4T caching.
  • <add key="CacheSettings_CallBackInterval" value="30" /> <add key="DD4T.CacheSettings.Page" value="3600" /> <add key="DD4T.CacheSettings.Component" value="3600" />
  • Outputcaching as you mentioned.
  • Make sure your binaries css, images, and js are getting cached(max age) in browser, it could be a big performance impact as each binaries request also go to your code which do some validation before serving the binary. we recently faced issue because of this.
  • Make your code CDN ready with cache-control:public for the binaries, it will help when you get the code at production. CDN/Akamai is very much required on production.
3
  • Cheers Raj; as I mentioned we had an issue with a typo around object caching, but this was very helpful indeed.
    – tomjgroves
    Mar 2, 2016 at 16:19
  • Great, object cache @chris already mentioned in the comment so i skipped that :). Object cache, its very basic stuff but above steps only from my experience in DXA.
    – Raj Kumar
    Mar 2, 2016 at 16:29
  • @RajKumar - In your experience do you have any pointers or best practices for setting these Cache-Control headers for binaries for DXA/DD4T? Mar 24, 2016 at 12:27
6

You enable Tridion caching by updating your Storage Configuration, as shown below

<ObjectCache Enabled="true">
  <Policy Type="LRU" Class="com.tridion.cache.LRUPolicy">
    <Param Name="MemSize" Value="16mb"/>
  </Policy>
  <Features>
    <Feature Type="DependencyTracker" Class="com.tridion.cache.DependencyTracker"/>
  </Features>
</ObjectCache>

Then for each item you would like to store in cache, you should also set

<Item typeMapping="Page" cached="true" storageId="defaultFile"/>

You may also wish to consider MemSize. You can see if Items are being removed from cache due to memory limits by enabling logging

You can read more on Tridion caching here: http://docs.sdl.com/LiveContent/content/en-US/SDL%20Tridion%20full%20documentation-v1/GUID-5BAC30F0-A91F-424F-8D08-093B863B65EF

1
  • In addition to "MemSize", don't forget "Size" which limits the number of items in the cache, and defaults to 128. This is quickly used up if you have a lot of link objects in the cache, and as the question mentions link resolving, I wonder whether the links are causing cache churn. Oct 30, 2019 at 19:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.