Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 8 of 8
  1. #1
    cPanel Partner NOC cPanel Partner NOC Badge cyon's Avatar
    Join Date
    Jan 2003
    Posts
    323

    Default pkgacct script very slow since WHM 11.25.x

    Hi

    I noticed that the pkgacct script with the --skiphomedir option takes significantly longer to complete since WHM 11.25.x. After a little research I found what is causing the delay. The following code block was added to the pkgacct script in WHM 11.25.x.

    /scripts/pkgacct Line 1237

    Code:
    if ($skiphomedir) {
    my $du = qx( du -s $homedir );
    my($homesize_kb) = ($du =~ m/^(\d+)/);
    ## FreeBSD does not have the -b option; performing the calculation manually.
    my $homesize = $homesize_kb * 1024;
    print "\nhomesize is: $homesize\n";
    }
    This code snippet is calculating the size of the users home directory. The "du -s /home/$user" command can be very slow to calculate the size of large accounts. It looks like the variable $homesize is only needed to "echo" the size of the home directory. If this is the case I would recommend using a faster method like "quota $user" to get the actual size of the users home directory.

    Example script to calculate the size (MB) of a users homedir. using the quota command:
    user_quota=$(quota $user | grep $volume | awk '{print $2}' | sed 's/*//g') | echo "$user: $user_quota $(echo "scale=1 ; ${user_quota}/1024" | bc)"

    What do you guys think about this ?

    Brgds

    Nicolas

  2. #2
    Member BlackRain's Avatar
    Join Date
    May 2003
    Posts
    36

    Default

    Quote Originally Posted by cyon View Post
    Hi

    I noticed that the pkgacct script with the --skiphomedir option takes significantly longer to complete since WHM 11.25.x. After a little research I found what is causing the delay. The following code block was added to the pkgacct script in WHM 11.25.x.

    /scripts/pkgacct Line 1237

    Code:
    if ($skiphomedir) {
    my $du = qx( du -s $homedir );
    my($homesize_kb) = ($du =~ m/^(\d+)/);
    ## FreeBSD does not have the -b option; performing the calculation manually.
    my $homesize = $homesize_kb * 1024;
    print "\nhomesize is: $homesize\n";
    }
    This code snippet is calculating the size of the users home directory. The "du -s /home/$user" command can be very slow to calculate the size of large accounts. It looks like the variable $homesize is only needed to "echo" the size of the home directory. If this is the case I would recommend using a faster method like "quota $user" to get the actual size of the users home directory.

    Example script to calculate the size (MB) of a users homedir. using the quota command:
    user_quota=$(quota $user | grep $volume | awk '{print $2}' | sed 's/*//g') | echo "$user: $user_quota $(echo "scale=1 ; ${user_quota}/1024" | bc)"

    What do you guys think about this ?

    Brgds

    Nicolas

    We are having the same problem with backups since the upgrade. Now, we are getting high server loads and incomplete backups.

    cPanel 11.25.0-C43473 - WHM 11.25.0 - X 3.9
    CENTOS 5.4 i686

  3. #3
    Member
    Join Date
    Jul 2005
    Location
    Sticky On Internet
    Posts
    555

    Default

    I believe cPanel did some tweak to cpbackup script in FEB, and backup was real smooth, but since one week I am seeing too many problems when weekly backup is run.

    I must say last month i was surprised to see backup didn't gave any high loads, but this month i had a bad sunday, cause 3 of servers were giving Load alerts during backup run.

  4. #4
    Member konrath's Avatar
    Join Date
    May 2005
    Location
    Brasil
    Posts
    314

    Default

    same here... 48 hours to make 100GB of backups

  5. #5
    cPanel Partner NOC cPanel Partner NOC Badge
    Join Date
    May 2003
    Location
    Ukraine
    Posts
    195
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    No one from cPanel interesting??

    Why at all to add not needed for backup information into the backup scripts?
    If you need additional info then you can run backup with some option.
    But by default backup should be simple, fast and with minimal load.

    p.s. I still don't understand for years why backup makes copy of full account before tarring&gzipping. Is this additional MEGA-load really required?

    p.p.s I think cPanel's QAs testing their backup on servers with 10 accounts with 5 files each and with 10Megs of total size.
    Regards, Alexey

  6. #6
    Member
    Join Date
    Jul 2005
    Location
    Sticky On Internet
    Posts
    555

    Default

    Quote Originally Posted by AlexAT View Post
    p.s. I still don't understand for years why backup makes copy of full account before tarring&gzipping. Is this additional MEGA-load really required?
    You can use Increamental backup's if you want to back only what has changed. but it would not compress the output.

    If you are using compressed backup, whole account would be backed up until you edit and manually remove some dirs using. cpbackup-exclude.conf

  7. #7
    cPanel Partner NOC cPanel Partner NOC Badge
    Join Date
    May 2003
    Location
    Ukraine
    Posts
    195
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    Quote Originally Posted by mohit View Post
    You can use Increamental backup's if you want to back only what has changed. but it would not compress the output.

    If you are using compressed backup, whole account would be backed up until you edit and manually remove some dirs using. cpbackup-exclude.conf
    I said about not needed step (copying whole account into other place) and you suggest me to use incremental backup.
    How this help ?
    Regards, Alexey

  8. #8
    cPanel Development cpanelkenneth's Avatar
    Join Date
    Apr 2006
    Posts
    3,782
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    Quote Originally Posted by cyon View Post
    Hi

    I noticed that the pkgacct script with the --skiphomedir option takes significantly longer to complete since WHM 11.25.x. After a little research I found what is causing the delay. The following code block was added to the pkgacct script in WHM 11.25.x.

    /scripts/pkgacct Line 1237

    Code:
    if ($skiphomedir) {
    my $du = qx( du -s $homedir );
    my($homesize_kb) = ($du =~ m/^(\d+)/);
    ## FreeBSD does not have the -b option; performing the calculation manually.
    my $homesize = $homesize_kb * 1024;
    print "\nhomesize is: $homesize\n";
    }
    This code snippet is calculating the size of the users home directory. The "du -s /home/$user" command can be very slow to calculate the size of large accounts. It looks like the variable $homesize is only needed to "echo" the size of the home directory. If this is the case I would recommend using a faster method like "quota $user" to get the actual size of the users home directory.

    Example script to calculate the size (MB) of a users homedir. using the quota command:
    user_quota=$(quota $user | grep $volume | awk '{print $2}' | sed 's/*//g') | echo "$user: $user_quota $(echo "scale=1 ; ${user_quota}/1024" | bc)"

    What do you guys think about this ?

    Brgds

    Nicolas
    The --skiphomedir parameter was implemented for use during account transfer. While it is useful for some backup scenarios that is not its intended design. The additional information added to the block in question for cPanel 11.25.0 was done to improve reporting and failure handling during account transfers.

    The use of du was necessitated to provide accurate reporting information as it is very common for files in /home/user to be owned by the nobody user ( think PHP web apps ). The quota command will not reveal that information.
    Kenneth
    Product Manager
    cPanel, Inc.

Similar Threads & Tags
Similar threads

  1. running pkgacct script on second drive
    By snardi67.gaming in forum Data Protection
    Replies: 1
    Last Post: 09-23-2009, 10:45 AM
  2. Couple of Script Questions: WHM Lite & pkgacct vs pkgacct2
    By Xyrael in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 03-18-2006, 11:53 AM
  3. Questions about pkgacct script
    By TheKog in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 01-19-2006, 10:54 AM
  4. pkgacct script not consistent in saving mysql dbs
    By te2586 in forum cPanel and WHM Discussions
    Replies: 8
    Last Post: 01-12-2006, 03:37 AM
  5. pkgacct script acts different with cron
    By TCSLEA in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 12-24-2003, 09:30 AM
Tags for this Thread
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube