The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Suspend account based on serverload

Discussion in 'General Discussion' started by sc00zy, Apr 15, 2008.

  1. sc00zy

    sc00zy Active Member

    Joined:
    Jan 2, 2006
    Messages:
    27
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    Assen, The Netherlands
    Is it possible to automaticly suspend an account when it's load is xx%?
     
  2. LiNUxG0d

    LiNUxG0d Well-Known Member

    Joined:
    Jun 25, 2003
    Messages:
    206
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Gatineau, Quebec, Canada
    Hey there,

    I don't think there's an auto-suspend option built-in, no.

    If someone knows of one, please enlighten us. :)

    Regards,
     
  3. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,469
    Likes Received:
    196
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
  4. mm1250

    mm1250 Well-Known Member

    Joined:
    Nov 10, 2006
    Messages:
    108
    Likes Received:
    0
    Trophy Points:
    16
    There isn't a cookie-cutter software out there that will do this. All the ones I've seen are custom designed by the hosts. This has been a well needed feature considering theusage of PHP/Mysql scripts have become widely used for blogs/forums and such.

    I doubt cPanel is designing this into their software but I'm even willing to pay for somone to put something of this nature together. Perhaps even sell it to the mass market was it's widely needed to control scripts.
     
  5. sc00zy

    sc00zy Active Member

    Joined:
    Jan 2, 2006
    Messages:
    27
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    Assen, The Netherlands
    Thanks for the replies. It's a pitty there isn't a solution for this yet. We'll wait :)
     
  6. electric

    electric Well-Known Member

    Joined:
    Nov 5, 2001
    Messages:
    697
    Likes Received:
    1
    Trophy Points:
    18
    I agree that this ability is sorely needed.

    It would be nice if cpanel had the ability to limit accounts based on cpu or memory usage, instead of just disk and bandwidth.

    If they can implement this feature, it will really set their control panel apart from the others.
     
  7. BackRack

    BackRack Member

    Joined:
    May 6, 2004
    Messages:
    17
    Likes Received:
    0
    Trophy Points:
    1
    cPanel will email you two alerts titled [cpuwatchcheck] and [statscheck].

    statscheck is important in your case and it looks something like the example below. You may suspend the user account in WHM.

    [statscheck] Stats/Server Overload on edited out
    IMPORTANT: Do not ignore this email.
    This is cPanel stats runner on server edited out
    While processing the log files for user edited out, the cpu has been
    maxed out for more than a 6 hour period. The current load/uptime line on the server at
    the time of this email is
    07:03:45 up 96 days, 3:36, 0 users, load average: 5.30, 5.97, 6.65
    You should check the server to see why the load is so high and take
    steps to lower the load. If you want stats to continue to run even with a high load;

    Edit
    /var/cpanel/cpanel.config and change extracpus to a number larger then 0 (run
    /usr/local/cpanel/startup afterwards to pickup the changes).
     
  8. pcsousa

    pcsousa Well-Known Member

    Joined:
    May 28, 2004
    Messages:
    63
    Likes Received:
    0
    Trophy Points:
    6
    Hello

    Sorry for open an this old topic, but I'm looking a way to register server load average for specific user. If it is possible I can extract stats and check if user is accomplishing with low cost accounts SLA. As you know most accounts are now traffic unlimited. Also space unlimited is out there and growing. The only way to control costs/beneficts is checking the impact of each account/site in more expensive resources like memory and CPU.

    I think we can only count cpu usage for php scripts (using suexec) because apache appears on top as "nobody" and mysql as "mysql" users and not as linux/cpanel user, but if I can register php script cpu usage it helps a lot.

    Do you know if there is any way out there to do it? cPanel way it will be the best way but a bash script or any ideas to develop a script helps.

    Many thanks.

    Regards.
     
  9. pcsousa

    pcsousa Well-Known Member

    Joined:
    May 28, 2004
    Messages:
    63
    Likes Received:
    0
    Trophy Points:
    6
    For instance, this user is permanently using +10% cpu with a single site, paying only 3 or 4 eur year. It's using simple SMF forum but with many members, low hd space, not mutch bw, but there must be some programing bad practice (unfortunatly it's frequently, maybe some mod for SMF, dont know) that is making it consuming lots of cpu permanently.

    PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
    21551 uidXXX 18 0 0 0 0 Z 12 0.0 0:00.35
    PHP:
     <defunct>
    (...)
    25273 uidXXX    18   0     0    0    0 Z   [B]10[/B]  0.0   0:00.31 [php] <defunct>
    (...)
    25361 uidXXX    18   0     0    0    0 Z   [B]15[/B]  0.0   0:00.44 [php] <defunct>
    25369 uidXXX    18   0     0    0    0 Z   [B]12[/B]  0.0   0:00.35 [php] <defunct>
    (...)
    25438 uidXXX    18   0     0    0    0 Z   [B]12[/B]  0.0   0:00.36 [php] <defunct>
    25456 uidXXX    18   0     0    0    0 Z    [B]9[/B]  0.0   0:00.26 [php] <defunct>
    25444 uidXXX    19   0     0    0    0 Z    [B]8[/B]  0.0   0:00.25 [php] <defunct>
    (...)
    25772 uidXXX    18   0  175m  27m 6108 R   [B]12[/B]  0.3   0:00.35 /usr/bin/php /home2/uidXXX/public_html/index.php
    (...)

    uidXXX is system/cpanel user.

    these are some I catched from top in the last 2 minutes
     
  10. simplybe

    simplybe Well-Known Member

    Joined:
    Nov 29, 2002
    Messages:
    153
    Likes Received:
    0
    Trophy Points:
    16
    check the size of their database. I have just had to purge a wordpress database that was 490mb because they had 200,000 spam comments in the comments table.

    To make matters worse cpanel did not count this against their quota ! I had to use modify quota in whm before cpanel counted the mysql. Now the server load is down and the account hardly uses any cpu or mem.

    You could also check your /etc/my.cnf settings for better performance. Also get the customer to change the forum settings eg load less pages at once, set a delay between searches etc...
     
  11. pcsousa

    pcsousa Well-Known Member

    Joined:
    May 28, 2004
    Messages:
    63
    Likes Received:
    0
    Trophy Points:
    6
    I've requested him to remove chat (ajax), but not helps too much. This site is consuming more than another site we host with adult content and a forum with much more members. It's probably something due to programming bad practices, or maybe your suggestion (something related to database; I do not realy beleave that's spam messages... it's a high used forum). any way they do not pay for experts analises ;). I undurstand and thanks your suggestion, but I must develop a script to register php loads and make an average at the end of the month.

    I'll start one by checking processes and register information each second, If I have some time. Any help on this way is appreciate.

    Regards.
     
Loading...

Share This Page