Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Garbage Collection Modes: If 2 apps exist on a server, does "Server Mode" rob Peter to pay Paul?

A 2-parter (if necessary I can seperate questions to award seperate right answers):

We're in a situation where running in server mode is likely appropriate: We have 2 enterprise level apps running on the same farm. If I put the app config Collection Modes of both apps in "Server Mode" am I risking hurting one app every time the other GC's?

Will the Network Load Balancer shift traffic away from a machine in the middle of GC (again in server mode)?

EDIT I broke the Load Balancing part of this question over to here: Is the network load balancer of a web farm affected by GC strain?

like image 971
Rikon Avatar asked Aug 03 '11 18:08

Rikon


1 Answers

If you are concerned about two enterprise app influencing performance of each other you shall consider moving them into two separate VMs.

GC is optimised and running in it's own thread(s). It is designed to be invisible for the current application. So on a multiprocessor enterprise server, a separate process shall not be damaged at all.

From the other point, server is still getting some load from GC. If you feel that GC somehow slows down your applications, you might probably perform some memory and CPU profiling to see where is a problem. You may find a way to optimize code and use less resources.

From J.Richter "CLR via C# v3" p.585

This mode fine-tunes the garbage collector for server-side applications. The garbage collector assumes that no other applications (client or server) are running on the machine and it assumes that all the CPUs on the machine are available to do a garbage collection. This GC mode causes the managed heap to be split into several sections, one per CPU. When a garbage collection is initiated, the garbage collector has one thread per CPU; each thread collects its own section in parallel with the other threads. Parallel collections work well for server applications in which the worker threads tend to exhibit uniform behavior. This feature requires the application to be running on a computer with multiple CPUs so that the threads can truly be working simultaneously to attain a performance improvement.

like image 125
oleksii Avatar answered Nov 10 '22 00:11

oleksii