Results 1 to 8 of 8
  1. #1
    Join Date
    Nov 2001
    Location
    Toronto, Canada
    Posts
    111

    Limiting Resource

    I have one of my clients using toooo much resource which cause the server to slow down or even some time the apache restart every hour. So, I would like to know how can I limit the resource for his account, and when he get over limit his site will stop working,??

    Thanks for your help,

  2. #2
    Join Date
    Apr 2001
    Location
    Depok, Indonesia
    Posts
    988
    Use RLimit command on your client's virtualhost block. http://httpd.apache.org/docs/mod/core.html#rlimitmem

  3. #3
    Join Date
    Dec 2000
    Location
    The Woodlands, Tx
    Posts
    5,962
    With hsphere, you can do this per account, but you cant with Cpanel, I dont know about others. Put this in your httpd.conf file close to the top.

    RLimitCPU 10 20
    RLimitMEM 6291456 6291456
    RLimitNPROC 3 5

    Of course, change the numbers to what suits you best..Then reload your apache.

  4. #4
    Join Date
    Nov 2001
    Location
    Toronto, Canada
    Posts
    111
    Thanks for your replys,
    Sorry I didn't say what type of server is, its RH 7.x with CPanel,

  5. #5
    Join Date
    Nov 2001
    Location
    London
    Posts
    4,857
    Originally posted by Webdude
    With hsphere, you can do this per account, but you cant with Cpanel, I dont know about others. Put this in your httpd.conf file close to the top.

    RLimitCPU 10 20
    RLimitMEM 6291456 6291456
    RLimitNPROC 3 5

    Of course, change the numbers to what suits you best..Then reload your apache.
    If you are setting these as global directives, I suggest you raise them.
    Matthew Russell | Namecheap
    Twitter: @mattdrussell

    www.namecheap.com - hosting from a registrar DONE RIGHT!

  6. #6
    Join Date
    Dec 2000
    Location
    The Woodlands, Tx
    Posts
    5,962
    Me? No, I can set these limits "per account or plan" since each of our clients have their own httpd.conf file since we do virtual servers, and not your normal hosting. Lower cost accounts get lower resources.

  7. #7
    Join Date
    Jun 2002
    Location
    long beach
    Posts
    207
    With hsphere, you can do this per account, but you cant with Cpanel, I dont know about others. Put this in your httpd.conf file close to the top.
    Does anyone else know how to set limits per accounts with cpanel or how to look up what the numbers mean in this

    RLimitCPU 10 20
    RLimitMEM 6291456 6291456
    RLimitNPROC 3 5
    I have redhat 7.3 p4 1.8 1 gig of ram 150 accounts (average size)

    Anyone know what my varibles would be for this apache code sniplet.

    Thanks for any help on this

  8. #8
    Join Date
    Dec 2000
    Location
    The Woodlands, Tx
    Posts
    5,962
    RLimitCPU 10 20
    10% soft limit on cpu
    20% hard limit on cpu time

    RLimitMEM 6291456 6291456
    Soft/Hard limit of 6 megs of ram (a bit low)

    RLimitNPROC 3 5
    Limit processes, not very effective....but does work to a certain extent.

    People often add these thinking it controls everything, it doesnt. It only controls whatever Apache controls....such as cgi that loads in the browser. CGI run from command line, cron, or other methods wont be controlled.

    In Cpanel, there is no way at this time to add these limits "per account" unless you do it manually. The way Cpanel does it...it controls everything. ie:: if one site hits that 6 megs mem limit...it restricts all sites as one...not just the one that pushed things to that limit. It's an overall limit. When you see

    RLimitCPU 10 20
    RLimitMEM 6291456 6291456
    RLimitNPROC 3 5
    at the top of your patch fig file, set them to max limits. If your server has a gig of ram....then you should set RLimitMEM to the max bytes in a gig minus a few megs for your hard setting (say -100 megs) and then about - 200 megs for your soft setting. This at least prevents everything combined from going over what physical ram you have available.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •