Help - Search - Members - Calendar
Full Version: getting crazy with backups
The Planet Forums > Control Panels > cPanel/WHM
naiad
all of my servers with cpanel got high load and cpu when backup hosting accounts... I have checked memory, hd's, updated whm, etc...

but most of nights when backup is running, load average goes up to 30 or 40!. For testing I kill the current proccess of "pkacct" and the server goes down to 1 or 2 of load average as normal.

All my accounts have normal files, nothing more than 10Mb, and the final average tar.gz per account is about 200-300 MB... normal!

So, i think the problem is focus in "pkacct". I do not know how you guys do the backups normally. For me it's a crazy task which I have to monitor myself many dawns icon_razz.gif

Thank you for any help
web1
If you get your root e-mails, it sends you a backup report that says this between accounts:

Waiting for load to go down to continue
pkgacct started.

The script is
/scripts/cpbackup

And you are in luck, it's a perl script! So you could find where it's waiting for CPU and add another call for it to do that somewhere else.

The only obvious thing I see when looking quickly is a call to /bin/cpuwatch

The easier thing to do might be to see if there's a setting for load in the control panel.

I have been monitoring load and it's looking pretty normal 24/7 and my CPU isn't the best, it's a little old. So you have some sort of problem.

If you have sites with a whole lot of graphics that are not compressable, maybe the gzip program is spending a lot of time on them.

Some simple shell commands:
cat /proc/loadavg
uptime

Something like that could be put in the script that does the packaging in places where you want to know what the load is. Then you can track down where it's doing the worst.

/scripts/pkgacct

Always make a copy of the old script!

Good luck.
naiad
i understand you but not totally icon_razz.gif

I have run tright now /scripts/cpbackup manually... and in 1 minute the load average raise 5 and 6...

how can i know exactly what in that script is doing that ? i think is gzip ... icon_razz.gif

also i have seen "cpunum" variable... and i see in ps xauf that 7.0 is the top load in which it would pause the backup... but

1) i do not know how to change it... i do not know where does it comes... nothing in WHM setup

2) i do not know if forcing it in code, it would be nice for backup script... ok, the load will not reach for example 3 of load... but, it will last more... maybe 1 day !
naiad
I have checked "Big Sister" alarms of load average (i'm silly icon_razz.gif)
Ok... "pckacct" script is ALWAYS running and eating cpu when load goes beyond 2.0

ok... pckacct is the problem...

how can i fix it ? icon_razz.gif how can i know what exactly disturb there ?

i'm still thinking is gzip...
web1
If you are going to run a server you are going to have to learn a little programming. It's just part of the job. If you think all you have to do is just push buttons on your control panel, then you will always be limited by the people who put out the panel and their schedule.

Lots of references and stuff on the net for perl and shell programming.

As for where to put the CPU load print statement, look at the script, there's already print's for what you already know about "Copying mailman archives....Done", "Copying homedir....Done", you can put your printouts there and they should show up in your email.

I wouldn't put them everywhere, just in places where you think it slows down, then you can get an idea where it's having problems.

One other idea, what about "iowait" in "top" ? Did you look at that while it's running? Maybe you have a hardrive problem with excessive retries slowing things down or even a bad interface.

Is memory all being used? Is this a windows [memory hogging] server?
naiad
thanx... i will put some echoes and look for iowait.
that's the clues i was looking for.

I know programming, and i DO know sysadmin is not some buttons to push.

I just wanted some clues as you gave me.

Thank you
naiad
iowait goes too high (90%) when cpanellogd or pkcacct is running
any ideas ?

# df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sda1 73837084 29234772 40851540 42% /
none 255692 0 255692 0% /dev/shm
/dev/sda2 2063536 1402624 556088 72% /var
/usr/tmpDSK 247919 7994 227125 4% /tmp
/tmp 247919 7994 227125 4% /var/tmp

# smartctl -H /dev/sda1
smartctl version 5.1-11 Copyright © 2002-3 Bruce Allen
Home page is http://smartmontools.sourceforge.net/

SMART Sense: Ok!

# smartctl -H /dev/sda2
smartctl version 5.1-11 Copyright © 2002-3 Bruce Allen
Home page is http://smartmontools.sourceforge.net/

SMART Sense: Ok!
eth00
An even simpler solution then doing all of the above is simply enabling the uncompressed backups. This will use rsync instead of the .tar.gz which is a LOT less cpu intensive and should help a fair amount.
web1
QUOTE (eth00)
An even simpler solution then doing all of the above is simply enabling the uncompressed backups. This will use rsync instead of the .tar.gz which is a LOT less cpu intensive and should help a fair amount.
Better see if you have the disk space for that.

Why is /var on another drive? It looks almost full. Any chance that when you run the backup it's filling that drive up? Also, going into swap because memory is full could really slow things down. So how much swap space is being used when you run the backup?

Iowait being real high is a bad sign that your hard drive is slow or the interface has some sort of problem or there's just massive disk use because you are also using swap space. Maybe a driver problem? see what dmesg or your boot log says.
naiad
QUOTE (eth00)
An even simpler solution then doing all of the above is simply enabling the uncompressed backups. This will use rsync instead of the .tar.gz which is a LOT less cpu intensive and should help a fair amount.


is this ?
"Incremental backup (only backup what has changed. (**No Compression**, not compatible w/ftp backups)"
naiad
QUOTE (web1)
Better see if you have the disk space for that.

Why is /var on another drive? It looks almost full. Any chance that when you run the backup it's filling that drive up? Also, going into swap because memory is full could really slow things down. So how much swap space is being used when you run the backup?

Iowait being real high is a bad sign that your hard drive is slow or the interface has some sort of problem or there's just massive disk use because you are also using swap space. Maybe a driver problem? see what dmesg or your boot log says.



/var is mounted in this way in NTT Datacenter's icon_razz.gif
Drive is not filled, because backups are in / partition... in /backups directory

looking up status when pkacct is running shows me that:
- swap disk are used about 50%
- iowait always playing around 90%

demsg has no clues about hard disk... everything seems fine
eth00
QUOTE (naiad)
is this ?
"Incremental backup (only backup what has changed. (**No Compression**, not compatible w/ftp backups)"


Yes that is what you want.
naiad
maybe it's because is the first time, but it's eating too much cpu/memory than the normal backup with tar.gz's files.

is it possible ?
naiad
i do not understand, seriously...
this is my graph of http seconds response...
The "mountains" are always caused by the backups...




is there any way to do backups without this lost of responding ?
naiad
and packaging just with tar without gzip ? (removing the "z" option in tar)
that would be faster ? more hd, but faster ? more than rsync ? icon_smile.gif
eth00
As I stated above the rsync is fastest, the first time it will take awhile but after that it should be ok.
naiad
rsync will need the same free HD than /home occupies, isnt it ?
theuruguayan
yeah..
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.