“Resource contention on server” – Multiple processes competing for server resources.

Loading

Troubleshooting “Resource Contention on Server” in SharePoint

Issue: Multiple processes competing for CPU, memory, disk, and network resources, leading to slowdowns, crashes, or degraded performance.
Causes: High SQL Server usage, IIS worker process overload, background services consuming excessive resources, inefficient workflows, or misconfigured resource allocation.


1. Identify Resource Contention Sources

Before applying fixes, determine which process is consuming excessive resources.

Tools for Diagnosis

🔹 Task Manager (taskmgr.exe) → Identify high CPU, RAM, and disk-consuming processes.
🔹 Resource Monitor (resmon.exe) → Analyze resource usage at a granular level.
🔹 Performance Monitor (perfmon.msc) → Track server resource consumption over time.
🔹 SharePoint Health Analyzer → Detect warnings related to resource contention.
🔹 SQL Server Profiler → Identify long-running and resource-heavy queries.
🔹 IIS Logs & Worker Process (w3wp.exe) Monitoring → Check for high CPU or memory spikes.

Check for System-Wide Resource Issues

✅ Open Task Manager → Check CPU, Memory, Disk, and Network usage.
✅ Use Get-Process in PowerShell to list high-resource-consuming processes:

Get-Process | Sort-Object CPU -Descending | Select-Object -First 10

✅ Run perfmon.msc and analyze CPU, memory, and disk metrics.


2. Optimize SQL Server to Reduce Load on SharePoint

SQL Server is the primary backend for SharePoint, and high SQL load can lead to resource contention.

Fixes

🔹 Set a maximum memory limit for SQL Server to prevent excessive RAM usage:

EXEC sp_configure 'max server memory', 12288; -- Set to 12GB (adjust as needed)
RECONFIGURE;

🔹 Optimize database queries:

  • Identify slow queries: SELECT * FROM sys.dm_exec_requests WHERE status = 'suspended';
  • Rebuild fragmented indexes: ALTER INDEX ALL ON [dbo.AllDocs] REBUILD;
  • Reduce autogrowth settings (set fixed size instead of percentage).
    🔹 Move transaction logs to a separate disk to reduce disk contention.

3. Manage IIS Application Pools to Reduce CPU & Memory Usage

Each IIS Application Pool consumes resources, and too many running pools can lead to high CPU and memory contention.

Fixes

🔹 Open IIS Manager (inetmgr)Application Pools.
🔹 Configure application pool recycling to free memory periodically.
🔹 Reduce the number of web applications running in separate pools.
🔹 Enable Web Garden Mode to distribute load across CPU cores.

PowerShell to List IIS Worker Processes & Their Memory Usage:

Get-WmiObject Win32_Process | Where-Object { $_.Name -eq "w3wp.exe" } | Sort-Object -Property WorkingSetSize -Descending

4. Optimize SharePoint Timer Jobs & Background Services

Excessive SharePoint Timer Jobs and background services consume CPU and memory.

Fixes

🔹 Open Central AdministrationMonitoringReview Job Definitions.
🔹 Disable or schedule non-critical jobs during off-peak hours.
🔹 Restart SharePoint Timer Service (SPTimerV4) periodically:

Restart-Service SPTimerV4

🔹 Identify and disable unused SharePoint services (e.g., Excel Services, PerformancePoint, BCS).


5. Optimize SharePoint Caching to Reduce Resource Load

Inefficient caching leads to high CPU and memory consumption.

Fixes

🔹 Enable BLOB Caching in web.config to reduce SQL Server load:

<BlobCache location="C:\BlobCache" path=".*\.(gif|jpg|png|css|js|ico)$" maxSize="5" enabled="true" />

🔹 Enable Output Caching in Central Administration for frequently accessed pages.
🔹 Reduce Object Cache Size for site collections.


6. Reduce Large List & Workflow Resource Usage

Large lists and complex workflows cause high CPU and RAM usage.

Fixes

🔹 Enable List View Threshold limits (Central Admin → Manage Web Applications → Resource Throttling).
🔹 Index columns in large lists to improve query efficiency.
🔹 Archive old workflows and remove unused ones.
🔹 Use Power Automate instead of SharePoint Designer workflows.


7. Balance CPU & Memory Usage with Process Priority Adjustments

To prevent a single process from consuming too many resources, adjust priority settings.

Fixes

🔹 Lower process priority for non-critical services:

  • Open Task Manager → Right-click a high-usage process → Set Priority → Below Normal.
    🔹 Use PowerShell to adjust process priority dynamically:
Get-Process w3wp | ForEach-Object { $_.PriorityClass = "BelowNormal" }

🔹 Implement CPU affinity settings for IIS Worker Processes to balance the load.


8. Optimize Disk I/O and Virtual Memory Settings

If SharePoint servers experience high disk usage, it can slow down resource allocation.

Fixes

🔹 Move SQL database and transaction logs to separate drives.
🔹 Increase paging file size (set it to 1.5x RAM size).
🔹 Use SSDs instead of HDDs for better disk performance.
🔹 Run Disk Cleanup (cleanmgr) to remove unnecessary files.


9. Optimize Network Performance to Prevent Bottlenecks

Network congestion can create resource contention by overloading SharePoint’s backend processes.

Fixes

🔹 Use CDN (Content Delivery Network) for static assets.
🔹 Optimize firewall and proxy settings to reduce latency.
🔹 Run iPerf or Wireshark to check for high-latency connections.


10. Regular Monitoring and Maintenance

10.1. Automate Resource Monitoring

✅ Set up Performance Monitor Alerts for high CPU/memory usage.
✅ Use SharePoint Health Analyzer to detect performance issues.
✅ Configure Event Viewer Alerts for resource contention warnings.

10.2. Keep SharePoint & SQL Server Updated

✅ Apply the latest SharePoint Cumulative Updates (CUs).
✅ Regularly patch SQL Server and Windows Server.


Leave a Reply

Your email address will not be published. Required fields are marked *