LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 08-21-2018, 04:50 AM   #1
wablo
LQ Newbie
 
Registered: Jul 2017
Distribution: Fedora, Centos , Debian
Posts: 4

Rep: Reputation: Disabled
Question MariaDB backup allert and performance


Hi guys
I have a little problem with a backup of MariaDB Server slave, to dump the db I am using a simple bash script

/bin/nice -n 10 ionice -c2 -n 7 /bin/mysqldump -u $username --password=$password $db | /bin/gzip > "$backupdir""$db"_"$date".gz

and it is working correctly if I start the script manually , if I set a script in crontab the zabbix allert sends me more notifications about "many processes" or "Process load is too high"
I reduce the zabbix allert using pigz and no gzip but the monitorig sends always some allert.
How can I solve this problem?

Another question, if I start the script manually the task completes in 30 minutes instead the scheduled task lasts more than 6 hours with pigz and 6 hours with the gzip.

any advice will be appreciated

Wablo
 
Old 08-21-2018, 06:53 AM   #2
rigor
Member
 
Registered: Sep 2003
Location: 19th moon ................. ................Planet Covid ................Another Galaxy;............. ................Not Yours
Posts: 705

Rep: Reputation: Disabled
Hi Wablo,

AFAIK, piping is inherently a sequential procedure. So trying to use that with pigz which tries to process data in parallel, might not really accomplish very much. If you have the space available, I would tend to think you might want to use pigz once the entire dump file is produced.

Also, there are different compression algorithms, and depending on the details of the algorithm, there can also potentially be different ways in which a particular compression algorithm can be applied. For example, to a small amount of data, or to an entire large file at once. I wasn't certain, but I did some quick testing, and it seems that using gzip on an entire file, rather than applying it to data coming through a pipe, it tends to take less time when run on an entire file, at least in the environment I'm using.

I also have to wonder if the particular way in which you're trying to combine nice and ionice is actually accomplishing what you want. Along with that, is there any difference between the load on the database, apart from the dump procedure, at the time when you run the script manually, versus the time it is run by cron? To the extent possible, you might want to make sure that the cron job runs in a period during which there is typically the lowest load on the database engine.

Then too, depending on what you are relying, there can be differences in the context in which something is run by cron, versus the way it is run from a command line. You have to take care to make sure that any factors that the script you're running relies on in the interactive shell environment, are provided in some form, for use with a cron job.

HTH,

rigor
 
Old 08-22-2018, 08:11 AM   #3
wablo
LQ Newbie
 
Registered: Jul 2017
Distribution: Fedora, Centos , Debian
Posts: 4

Original Poster
Rep: Reputation: Disabled
Hi rigor,
thanks for the reply, i am using nice and ionice to reduce the load over the server and limit the allert from zabbix, i try to split the script in 2 step as you suggested.
first step dump the DB and second step compress the dump with gizp

wablo
 
  


Reply

Tags
bash script $@, mariadb, zabbix



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] btrfs issue with mariadb incremental backup siranee.ja Linux - Software 10 08-14-2017 09:46 PM
LXer: How To Use Mytop To Monitor MySQL/MariaDB Performance In Linux LXer Syndicated Linux News 0 07-31-2017 12:33 PM
[SOLVED] Backup, shrink backup and modify MBR of backup jps1x2 Linux - General 1 12-17-2013 05:03 AM
Software Raid 6 - poor read performance / fast write performance Kvothe Linux - Server 0 02-28-2011 03:11 PM
LXer: Performance Technologies Announces Availability of AMC121 High-Performance Comp LXer Syndicated Linux News 0 09-18-2007 10:30 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 03:11 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration