-
Hi! Our M365 rollout journey is in full swing, we are a very large enterprise with tens of thousands of on-prem site collections, gradually expanding into SP Online (and teams, which as you know create an SP Online site for each team!) We have a custom application for users to manage their assets (teams, sites, etc) which we keep in sync via the graph API and utilizing the pnp core library. Our tenant site collection count is approaching 7,000 site collections, and our scanner is running out of memory as it appears we cannot paginate the
I can keep cranking up the memory on my container, but this is not a sustainable path - before I start digging into the internals of the library to figure out how to do this, has anyone else encountered this, or does the library actually allow pagination on this call and I cannot figure it out? Thank you! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
@Sean-LM : this method indeed will load all site collections in memory and return them. The amount of data for 7000 site collections however should not be huge unless you keep additional data in memory for all 7000. I assume you've kept the What memory do you allocate for your container? |
Beta Was this translation helpful? Give feedback.
One of the first things the container does upon spin-up (it runs a console app) is begin gathering those sites. The out of memory exception was being thrown from within
GetSiteCollectionsWithDetailsAsync
, not during any post processing of the data (and thus loading additional things into memory.)I went all the way to 4GB memory on the container but was still running out. I have since solved this issue (sorry for not coming back and updating) by implementing our own version of
SiteCollectionEnumerator.GetWithDetailsViaTenantAdminHiddenListAsync
which our code can call and accepts two new arguments:pageSize
andnextHref
.The page size is parameterized in the CAML query:
<RowLimit Paged='T…