IsInRole Performance Issue

Ask a Question related to ASP.NET Security, Design and Development.

  1. #1

    Default IsInRole Performance Issue

    Hi,
    We have a very large AD here and I am noticing that the WindowsPrinciple
    IsInRole function is taking upwards of 1 second to respond with just a single
    user. I am assuming that this function re-queries the AD everytime. When it
    reaches about 50 users each query is taking > 10 seconds. Is there anyway to
    cache the AD query and still use the IsInRole?
    Thanks :)
    David Nicholson - SP/A Shaw Cablesystems Guest

  2. Similar Questions and Discussions

    1. Performance issue
      I have an array with around 40 different url values in it. Im trying to cfhttp each URL in turn, and then parse the contents of each URL one by one....
    2. CFMail - performance issue
      Hi, I have developed a discussion board on which users can subscribe to particular topics. Subscribed users receive an email (with link back to...
    3. 7.x to 9.x Performance issue in the extreme
      Greetings, The problem: I run an identical program on Server A and Server B. On Server A the program runs in 12 seconds. On Server B it takes 1.5...
    4. Performance Issue using SQLJ
      Hi. We're looking at using SQLJ to see how we could incorporate it into our environment and achieve better throughput and cost savings over using...
    5. Solaris/UFS logging performance issue.
      Some systems here have been upgraded from Solaris 2.6 to Solaris 8. Broadly, these systems run Veritas Volume Manager (VxVM) on A5200s - one root...
  3. #2

    Default Re: IsInRole Performance Issue


    David, did you ever resolve this problem? We are seeing very simila
    problems.
    -mark

    David Nicholson - SP/A Shaw Cablesystems wrote:
    > *Hi,
    > We have a very large AD here and I am noticing that th
    > WindowsPrinciple
    > IsInRole function is taking upwards of 1 second to respond with jus
    > a single
    > user. I am assuming that this function re-queries the AD everytime
    > When it
    > reaches about 50 users each query is taking > 10 seconds. Is ther
    > anyway to
    > cache the AD query and still use the IsInRole?
    > Thanks :)

    -
    moverto
    -----------------------------------------------------------------------
    Posted via [url]http://www.codecomments.co[/url]
    -----------------------------------------------------------------------

    moverton Guest

  4. #3

    Default Re: IsInRole Performance Issue

    Do you get performance problems when the number of roles a user is in is
    higher than the magic number 23 ?

    Gabriel Lozano-Morán

    "moverton" <moverton.1o60hp@mail.codecomments.com> wrote in message
    news:moverton.1o60hp@mail.codecomments.com...
    >
    > David, did you ever resolve this problem? We are seeing very similar
    > problems.
    > -mark
    >
    > David Nicholson - SP/A Shaw Cablesystems wrote:
    >> *Hi,
    >> We have a very large AD here and I am noticing that the
    >> WindowsPrinciple
    >> IsInRole function is taking upwards of 1 second to respond with just
    >> a single
    >> user. I am assuming that this function re-queries the AD everytime.
    >> When it
    >> reaches about 50 users each query is taking > 10 seconds. Is there
    >> anyway to
    >> cache the AD query and still use the IsInRole?
    >> Thanks :) *
    >
    >
    >
    > --
    > moverton
    > ------------------------------------------------------------------------
    > Posted via [url]http://www.codecomments.com[/url]
    > ------------------------------------------------------------------------
    >

    Gabriel Lozano-Morán Guest

  5. #4

    Default Re: IsInRole Performance Issue

    Gabriel Lozano-Moran wrote:
    > Do you get performance problems when the number of roles a user is in
    > is higher than the magic number 23 ?
    >
    > Gabriel Lozano-Moran
    >
    > "moverton" <moverton.1o60hp@mail.codecomments.com> wrote in message
    > news:moverton.1o60hp@mail.codecomments.com...
    > >
    > > David, did you ever resolve this problem? We are seeing very
    > > similar problems.
    > > -mark
    > >
    > > David Nicholson - SP/A Shaw Cablesystems wrote:
    > >> *Hi,
    > >> We have a very large AD here and I am noticing that the
    > >> WindowsPrinciple
    > >> IsInRole function is taking upwards of 1 second to respond with
    > just >> a single
    > >> user. I am assuming that this function re-queries the AD everytime.
    > >> When it
    > >> reaches about 50 users each query is taking > 10 seconds. Is there
    > >> anyway to
    > >> cache the AD query and still use the IsInRole?
    > >> Thanks :) *
    > >
    > >
    > >
    > > --
    > > moverton
    > > --------------------------------------------------------------------
    > > ---- Posted via [url]http://www.codecomments.com[/url]
    > > --------------------------------------------------------------------
    > > ----
    > >
    Try using the CacheRolesInCookie property on the Roles class (ASP.NET
    2.0).

    --
    Joe Gilkey
    Principal Programmer / Analyst
    NAPCO Security Group / Continental Instruments
    Joe Gilkey Guest

  6. #5

    Default Re: IsInRole Performance Issue


    moverton wrote:
    > *David, did you ever resolve this problem? We are seeing very
    > similar problems.
    > -mark *
    Hey guys check out my blog on this subject,
    [url]http://blogs.msdn.com/toddca[/url]



    --
    toddca
    ------------------------------------------------------------------------
    Posted via [url]http://www.codecomments.com[/url]
    ------------------------------------------------------------------------

    toddca Guest

  7. #6

    Default Re: IsInRole Performance Issue

    Hey Todd!

    That's a great post. Thanks for putting that together.

    I really like your approach of resolve the role into a SID and check that
    directly against the token instead of the other way around. It is very
    common for the application to be interested in a pretty small number of
    different groups/roles, so it really makes sense to do it this way.

    Another behavior that I've noticed is that tends to affect performance is
    that the ASP.NET model creates a new WindowsIdentity/WindowsPrincipal object
    for each request instead of reusing an existing one. The internal hashtable
    that holds the resolved group names needs to get reinitialized for each
    request, which can also be slow. Simply caching the WindowsPrincipal and
    reusing will make subsequent calls IsInRole MUCH faster.

    This doesn't address the issue of the slow initial resolution like your code
    does. I was just pointing out another subtle issue with the current model.

    Thanks again!

    Joe K.

    "toddca" <toddca.1o8shs@mail.codecomments.com> wrote in message
    news:toddca.1o8shs@mail.codecomments.com...
    >
    > moverton wrote:
    >> *David, did you ever resolve this problem? We are seeing very
    >> similar problems.
    >> -mark *
    >
    > Hey guys check out my blog on this subject,
    > [url]http://blogs.msdn.com/toddca[/url]
    >
    >
    >
    > --
    > toddca
    > ------------------------------------------------------------------------
    > Posted via [url]http://www.codecomments.com[/url]
    > ------------------------------------------------------------------------
    >

    Joe Kaplan \(MVP - ADSI\) Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139