I have 2 service fabric application (sln) with 3 services (3 code packages). I want to distribute those in 40% 20% 20% of max CPU percentage irrespective of core i.e. no limitation on number of CPU cores (current machine is 4 core logical). According to above content/blog if I specify the CpuShares = 512 , CpuShares = 256 and CpuShares = 256 then it should take max CPU of 40 , 20 , 20 percent. However this is not the case it only allowed 5% 2% and 2% of max CPU usages for respective services. By reading this post (https://learn.microsoft.com/en-us/azure/service-fabric/service-fabric-resource-governance) I thought 1024 is default value (max value) for CpuShares , after lot of try and error I finally come to the value 10,000 for CpuShares if we apply any values greater than this we get error in service explorer saying Invalid Arg for CpuShare. So considering 10,000 = 100% CPU usage allowed. I have modified above CPU share values to CpuShares = 4000, CpuShares = 2000 and CpuShares = 2000 in testing I can see the max CPU percent usage where 40% 20% 20% (not exact 5% variance ). So the question is I could not find 10,000 = 100% CPU usage value in any of the documents. So I want to confirm if this is correct and if not then how can I restrict the service or code package to specific percentage. Please kindly help on this
Service fabric code package value of CpuShares for 100% cpu usage(max)
1.1k Views Asked by Mandar Nagarkar At
1
There are 1 best solutions below
Related Questions in AZURE-SERVICE-FABRIC
- new thread blocks main thread
- Extracting viewCount & SubscriberCount from YouTube API V3 for a given channel, where channelID does not equal userID
- Display images on Django Template Site
- Difference between list() and dict() with generators
- How can I serialize a numpy array while preserving matrix dimensions?
- Protractor did not run properly when using browser.wait, msg: "Wait timed out after XXXms"
- Why is my program adding int as string (4+7 = 47)?
- store numpy array in mysql
- how to omit the less frequent words from a dictionary in python?
- Update a text file with ( new words+ \n ) after the words is appended into a list
Related Questions in SERVICE-FABRIC-STATELESS
- new thread blocks main thread
- Extracting viewCount & SubscriberCount from YouTube API V3 for a given channel, where channelID does not equal userID
- Display images on Django Template Site
- Difference between list() and dict() with generators
- How can I serialize a numpy array while preserving matrix dimensions?
- Protractor did not run properly when using browser.wait, msg: "Wait timed out after XXXms"
- Why is my program adding int as string (4+7 = 47)?
- store numpy array in mysql
- how to omit the less frequent words from a dictionary in python?
- Update a text file with ( new words+ \n ) after the words is appended into a list
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
A common misconception about the resources governance for services in SF is that it is a resource reserved and isolated capacity for your service, like it is on a docker containers, and this is not true.
These metrics are just soft limits to keep balance of the services in the cluster, does not mean they are reserved exclusively for your services, other services can, and will consume these resources if no limit are set.
The metrics are measures to find a proper balance of services in the cluster and place services in nodes with available resources, so assuming you have your services A, B and C, and each service has a specific amount of resources requirement, lets say Memory, that is an easy value to understand, A=1000MB, B=512MB, C=512MB, and the a node has 2GB of memory, these can be placed in the same node, so assuming service C needs 1000MB, when service C need to be activated, it will avoid the same node where A and B are activated, because it does not have the capacity to run in there, even though these services are not consuming all resources requested, and another node will be elected.
From the docs:
Regarding your main question about the shares:
The same docs describe that shares are a proportion of a reserved CPU Core reserved to a Service package split between all the code packages activated on that node, if you define the shares for each code package, the sum of them will be the total, and each one will get a proportion of these shares.
How these shares are controlled?
Assuming a Service Package with the code packages A and B are activated, with the following share split:
SF will:
These limits are constrained by Job Objects, when a process(code package) is activated, it is assigned to a Job where these restrictions are set, whenever the process consumes more cycles than the restriction set in the job, the threads are pre-empted and another process thread is scheduled in the core. In the code, they suggest that
10000 represents all available cores
but the correct isnumber of processor cycles that the threads in a job object can use during each scheduling interval
. In a Job, 10000 cycle is the interval of each job schedule, a thread is scheduled in this Job and will consume x cycles of this schedule, and you will only consume the 10000 cycles if you reserve 4 cores.The exact logic is in this bit of code:
Some tricks:
If you need more info, take a look in the source here
PS: I got a bit dizzy calculating all these numbers, I will probably review again later!