Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Formula for allocation of server capacity

  1. Nov 20, 2004 #1
    :grumpy: Can anyone help? I have an interesting issue. I've chosen to study maths and computer science and one of the problems I've been asked to solve, potentially using a 3D Modeling formula is:

    In a Shared Server environment, where total capacity of a server is measured by total CPU capacity, total disk capacity and total memory capacity, I need a formula to help me understand how much each user is requesting of the total capacity.

    By example:
    On a single server total CPU is 2.88 Ghz, 16Gb Memory and 146Gb of Disk Space.
    I have a user who only wants to use 1Ghz CPU, 2Gb Mem and 2Gb of Disk Space. What formula can I use that tells me what percentage of the total capacity of the machine this person is requiring?

    thanks for any help
  2. jcsd
  3. Nov 20, 2004 #2


    User Avatar
    Staff Emeritus

    Now I don't know what operating system your using, but you can do what you want VERY easily in Linux and Unix. All you have to do is edit /etc/security/limits.conf

    In this file you tell it exactly how much resources a user can have and what priority they get it at.

    I would suggest doing research on this file and see how you want to set it up.
    Last edited: Nov 20, 2004
  4. Nov 20, 2004 #3

    The point is I'm trying to allocate a cost to each user, of the overall server cost, before they go live. Therefore there isn't any data to collect usage figures against. Even if there was I need to charge them before they use the box. Therefore I have to understand what allocation they are requesting.

  5. Nov 20, 2004 #4


    User Avatar
    Staff Emeritus

    Why is it so difficult to allocate a cost to each user? Just put a price per Mhz or per GB that the user would be willing to pay and just add up the totals. The pricing should also be according to which resource is more valuable. For example hard drives space is very cheap compared to CPU speed.
  6. Nov 20, 2004 #5
    Well the way the question is phrased seems pretty odd. What exactly is a "shared server enviroment". Do they mean just a multitasking OS? Also, what exactly is meant by cost. Do they just want a percentage? So if you use 2 Gb of memory and their are 8 Gb total, you are using 25%?

    Division of CPU time is certainly not measured in Ghz usage. You don't "use up" clock frequency. If the processor is running at 2.2 Ghz, it doesn't matter if its doing nothing, its always going to running at 2.2 Ghz. Processes are allocated small time slices. On certain operating systems such as Linux, you can tell a process to be "nice" and not request all the time available. Look up the Linux command nice if you have it installed. I'm not familiar of a way to do this in Windows.
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook