Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SPDistributedCacheService: Add support for backgroundGC #1397

Open
ChristophHannappel opened this issue Mar 9, 2022 · 3 comments
Open

SPDistributedCacheService: Add support for backgroundGC #1397

ChristophHannappel opened this issue Mar 9, 2022 · 3 comments
Assignees
Labels
enhancement The issue is an enhancement request. in progress The issue is being actively worked on by someone.

Comments

@ChristophHannappel
Copy link
Contributor

Resource proposal

The Article Installing Windows Server AppFabric updates SharePoint 2013 Servers recommends enabling the backgroundGC for the DistributedCacheService.exe via the DistributedCacheService.exe.config file.

Details Cumulative update package 3 for Microsoft AppFabric 1.1 for Windows Server.

SharePoint Subscription Edition enables this by default. All previous versions need to enable it manually.
Since the SPDistributedCacheService has to run on every Node it would be a good fit, to add this to the ressource.

I can create a pull request, if this is the right ressource

Proposed properties

Property Type qualifier Data type Description Default value Allowed values
backgroundGC write boolean Should the DistributedCacheService use the nonblocking garbage collection (background server garbage collection) None $true, $false

Special considerations or limitations

Code Example

[system.reflection.assembly]::LoadWithPartialName("System.Configuration") | Out-Null

# intentionally leave off the trailing ".config" as OpenExeConfiguration will auto-append that
$configFilePath = "$env:ProgramFiles\AppFabric 1.1 for Windows Server\DistributedCacheService.exe"
$appFabricConfig = [System.Configuration.ConfigurationManager]::OpenExeConfiguration($configFilePath)

# if backgroundGC setting does not exist add it, else check if value is "false" and change to "true"
if($appFabricConfig.AppSettings.Settings.AllKeys -notcontains "backgroundGC")
{
    $appFabricConfig.AppSettings.Settings.Add("backgroundGC", "true")
}
elseif ($appFabricConfig.AppSettings.Settings["backgroundGC"].Value -eq "false")
{
    $appFabricConfig.AppSettings.Settings["backgroundGC"].Value = "true"
}

# save changes to config file
$appFabricConfig.Save()
@ykuijs ykuijs added enhancement The issue is an enhancement request. in progress The issue is being actively worked on by someone. labels Mar 9, 2022
@ykuijs
Copy link
Member

ykuijs commented Mar 9, 2022

Hi @ChristophHannappel, I agree that the SPDistributedCacheService resource indeed sounds like the best resource for this enhancement! I have assigned this issue to you!

@ykuijs
Copy link
Member

ykuijs commented May 13, 2022

Hi @ChristophHannappel, any idea when you are able to fix this issue?

@ChristophHannappel
Copy link
Contributor Author

@ykuijs I think within the next 3 weeks. Ill have kinda working code and think creating a meaning full unit test is the largest challange for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement The issue is an enhancement request. in progress The issue is being actively worked on by someone.
Projects
None yet
Development

No branches or pull requests

2 participants