3

I'm crossing posting this from the 51degrees forums as it hasn't gotten much traction there.

I went ahead and implemented the latest NuGet package version of 51Degrees into a site we manage here at work. (2.19.1.4) We are attempting to bring in house the management of the mobile views for this site (it's currently done by a third party). So the only functionality we are interested in is the detection. We disabled the redirect functionality by commenting out the redirect element in the config and we modified the logging level to Fatal (the log is in the App_Data folder).

To our understanding, those were the only changes needed. And this worked. We could switch our layout view between desktop and mobile based on the information 51degrees was providing.

While testing and promoting through DEV and QA we noted increased memory consumption in the app pool, but nothing that we were overly worried about. The app pool at standard traffic levels consumes roughly 230 MB of memory in PROD. It will spike to 300 MB during peak times, so nothing too worrisome, especially considering we do a fair amount of InProc caching.

As of Sunday we promoted 51degreees lite into PROD, but disabled the mobile views (we did this in QA as well). We wanted to see how it would perform in PROD and what kind of impact it would have on the server in a live environment. Just to reiterate, QA revealed increased memory use, but we could not replicate PROD loads and variances.

PROD revealed some concerns. Memory consumption on the app pool of one of the two frontends grew slowly throughout the day up to a peak at days end of 560MB on the app pool at 11 PM. The other peaked at 490MB.

We confirmed the problem was isolated to 51degrees by removing it from the site, recycling, and monitoring for another day. App pool memory never exceeded 300MB.

We also ran the app pool through SciTech's memory profiler to confirm. The results showed 51Degrees consuming majority of the additional memory above the expected. (We can run these tests again in a QA environment if wanted. The numbers will be lower, but they will paint a picture).

So the questions:

1) What would account for this large memory consumption? While a 500-600MB app pool isn't the end of the world, having our mobile detection solution more than double our app pool size is worrisome. (While our site isn't the heaviest traffic site, it does receive a fairly decent number of requests)

2) Are there any settings that we can apply to prevent or reduce the memory consumption? Ideally, we'd like to limit the memory consumption of 51 degrees to just the memory needed to load the product and monitor incoming requests.

Thanks for any feedback.

Khepri
  • 9,547
  • 5
  • 45
  • 61
  • I don't know anything of 51degrees, but I would suggest code reviews on the code that uses 51degrees. Be double sure to check anything that uses a shared resource(like a vector or map that multiple threads use). If the shared resource isn't locked appropriately, it might not cause run-time exceptions, but it might cause a memory leak. The code might look fine, and it might look like all of the memory is managed correctly, but when thrown into a multi-threaded arena it might cause bad things to happen. – Shaz Aug 07 '13 at 16:51
  • If 51Degrees is loaded into the app pool, there's not much you can do in terms of limiting its memory - it uses what it uses. It does sound like you need to go back to your QA environment and do some profiling around what is causing the memory spikes. It could be a memory leak in your code or the 51degrees code. Profiling should help identify the cause. You may need to simulate load though to really see the cause. – Simon Halsey Aug 07 '13 at 17:03
  • The only place where I'm really interfacing with 51Degrees is in our _ViewStart page. We check there if the user is mobile or not. Layout = Context.GetOverriddenBrowser().IsMobileDevice ? {MOBILE} : {DESKTOP}. We check against overridden because the user has the option in the site to choose desktop from mobile and vice versa. Beyond that, we made no changes to our codebase other than adding mobile views and the config that was added by 51 degrees. That's why I'm struggling with the consumption. – Khepri Aug 07 '13 at 17:18
  • This may not make an impact, but I'm curious to know if you guys are using their binary lite data file or the xml version. – MondayPaper Aug 07 '13 at 20:22

0 Answers0