Throttle certain websites?

Discussion in 'General' started by optize, Feb 2, 2010.

  1. optize

    optize Well-Known Member

    We have a few websites that just take up way too many resources. We were wondering if LiteSpeed had anything that could help throttle those websites only and not affect the other people.

    We'd be interested in things such as cpu/memory limiting, connections per ip limits, total connection limits.

    I know you can do the connection limits on a global scale, but what about per site?
  2. mistwang

    mistwang LiteSpeed Staff

    If you use PHP suEXEC, it should assign dedicate PHP processes for each account, so it will take care of cpu/memory limits.

    Right now, it is not possible to limit the total connections per vhost, the reason is that when server accept a new connection, it has no idea which vhost it is for before receiving the full request. If this vhost is IP based vhost with a dedicate IP, it is possible to implement a connection limit, but it is not available in LSWS yet.

    Usually, connection is cheap, so it wont be a problem unless your server is under attack.
  3. optize

    optize Well-Known Member

    We do use PHP suEXEC and do see the processes;

    11033 user1 16 0 123m 27m 6260 S 21.3 0.3 0:01.08 lsphp5
    10496 user2 16 0 124m 27m 6080 S 11.6 0.3 0:06.84 lsphp5

    For example, these users are using 21% and 11%. Is there a way to say 'Don't let user user1 use more then 5% of the CPU?'
  4. mistwang

    mistwang LiteSpeed Staff

    To my knowledge, Linux cannot do per user resource limit on CPU time, it is up to the kernel process scheduler.
  5. Tony

    Tony Well-Known Member

    This is correct although some have went and created kernel patches and external applications to attempt to limit user usage. It's not available for free or even paid usage though.

Share This Page