Results 1 to 9 of 9
  1. #1
    Join Date
    Aug 2004
    Posts
    242

    Limit CPU/RAM per account

    How do you limit CPU/RAM per account on a shared web server without virtualization? Something like what Dreamhost is now offering, for instance for user "john", assign 256MB of RAM and 10% of CPU. Without Virtuozzo and friends. Any idea?

  2. #2
    Join Date
    Mar 2003
    Location
    Canada
    Posts
    9,072
    What you're looking for is ulimit, although it's my understanding that Dreamhost has a bunch of custom scripts to keep everything in check.

    Manpage:
    http://bama.ua.edu/cgi-bin/man-cgi?ulimit+1
    RACK911 Labs | Penetration Testing | https://www.RACK911Labs.ca

    www.HostingSecList.com - Security Notices for the Hosting Community.

  3. #3
    Join Date
    Aug 2004
    Posts
    242

  4. #4
    Join Date
    Jun 2006
    Location
    Cluj Napoca
    Posts
    469
    You cannot limit CPU/RAM per account. An account can get your apache to spawn 1000 childs and you cannot limit that. The same is for mysql. If you are only looking to limit the resources that a user can use when executing a php or other scripts you can do that with ulimit but I am not shure if that is what you want.
    IntoDNS - Check your DNS health and configuration
    FLEIO - OpenStack billing and control panel for service providers

  5. #5
    Join Date
    Jan 2004
    Location
    Greece
    Posts
    2,211
    You can limit it but you have to run php as fastcgi and not as apache module.

  6. #6
    Join Date
    Aug 2007
    Location
    South East
    Posts
    26
    I didn't know you chould do that, thanks!

  7. #7
    Join Date
    Jun 2006
    Location
    Cluj Napoca
    Posts
    469
    Yes, you could do that, but php as cgi will not serve images and replace mysql. It's a start anyway.
    IntoDNS - Check your DNS health and configuration
    FLEIO - OpenStack billing and control panel for service providers

  8. #8
    Join Date
    Jan 2004
    Location
    Greece
    Posts
    2,211
    Of course serving images works, else you would see the images in my website

  9. #9
    Join Date
    Jun 2006
    Location
    Cluj Napoca
    Posts
    469
    Apache servs images not the cgi process, that is what I meant.
    IntoDNS - Check your DNS health and configuration
    FLEIO - OpenStack billing and control panel for service providers

Posting Permissions

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