Bacula-users

Re: [Bacula-users] mysql Query increases by restore

2010-02-17 03:34:51
Subject: Re: [Bacula-users] mysql Query increases by restore
From: Arno Lehmann <al AT its-lehmann DOT de>
To: bacula-users AT lists.sourceforge DOT net
Date: Wed, 17 Feb 2010 09:32:05 +0100
Hello,

16.02.2010 09:36, Torsten Maus wrote:
> Good moring,
> 
> thank you for your answer.
> 
> ok just a word before, I had an installation (bacula 2.4.4 and 3.0.3) before 
> which worked with the mysql configuration. I upgraded to 5.0 and it still 
> worked out.
> Than I changed my complete environment and thought that a fresh installation 
> of bacula is a good idea. Indeed it seems to be the case it was not :D .....

You know the phrase "never change a running system"? :-)

> I adjusted and played yesterday evening with these key configurations:
> 
> key_buffer = 256M
> max_allowed_packet = 128M
> table_cache = 256
> sort_buffer_size = 128M
> read_buffer_size = 128M
> read_rnd_buffer_size = 128M
> myisam_sort_buffer_size = 128M
> thread_cache_size = 8
> query_cache_size= 128M
> 
> 
> My System:
> 
> RAM: 1246MB
> CPU: 3,0 GHz Athlon XP
> Debian 5.0 lenny R4
> Mysql: 5.0.51a-24+lenny3
> Bacula: 5.0.0
> Database Size: 54 MB
> Database Typ: MyISAM (default with the make _database Script of bacula ?!)

Might be... I haven't checked recently.

> Htop shows me that mysql takes 7,9 % of total memory

Ok, that would be about 9 MB if I calculate correctly. Which is not 
much, but considering the small database size and the fact that my 
mysql during tree building uses much less memory it is more than I 
would have expected.

> when doing a query. I 
> watched with mysqladmin and I saw that the mysql process is executing the 
> query command. This takes years.

Here, mysql is CPU limited, which seems to indicate that I better 
added some indexes if I wanted faster restores.

> I change the above configuration number not just once and increase them also 
> significantly (nearly to 1 GB) but the mysql process still remains with ~8% 
> Mem 
> usage.

Which indicates that MySQL doesn't need more meory for those queries. 
Might be missing indexes, then.

You may find some suggestions in the list archives, and also in the 
make_mysql_tables script.

If that doesn't help, you'll need advice from someone who knows more 
about MySQL than I do - analyzing the 'explain' output for the 
long-running query would be a good first step.

For example, I see that the query to build a file tree uses subqueries 
where no index can be used, and also uses filesort, which sounds bad 
to me - accordingly, the query takes hours.

Cheers,

Arno

> Thank for your help
> 
> Regards
> 
> Torsten
> 
> Am Montag 15 Februar 2010 20:05:42 schrieb Arno Lehmann:
>> Hi,
>>
>> 15.02.2010 15:32, Torsten Maus wrote:
>>> Hey guys,
>>>
>>> I have a problem, I installed bacula 5.0 on da fresh machine (fresh Mysql
>>> Server)
>>>
>>> My Systems looks like:
>>>
>>> - debian lenny
>>> - Mysql 5.0
>>> - Bacula 5.0
>>>
>>> When I start a backup, the bacula service automated label volumes in the
>>> appropriate size (so everything works).
>>>
>>> When I now run a restore it happens the following:
>>>
>>> 1. when I want to run restore I do the following:
>>>
>>> * restore
>>>
>>>  * 5
>>>
>>> Now the bacula server begin to query and build the tree, the CPU usage
>>> auf my mysql process launches to 100% and that is it, no change, the
>>> file tree is not build.
>> So I would check what MySQL is doing - start with 'mysqladmin -v
>> processlist' to see if it's the database still querying, or if the
>> database already sends data to Bacula.
>>
>> In the first case, you should probably start by tuning your MySQL
>> installation (which in turns means you first find which resources are
>> limiting performance), in the latter case you need to look at what
>> Bacula does.
>>
>> My impression is that MySQL is getting slow because it's lacking
>> memory. You may be able to verify that using top, vmstat, sar, or
>> other such tools. Those might even quickly point you to the things you
>> should change in your system.
>>
>>> 2. If I run a restore with a "small" job (1 or 2 files) like the backup
>>> catalog the tree is builded whin a second.
>>>
>>> But I can not restore "big" job oder even normal backups.
>>>
>>> What has happend ? and why, Backup without restore is somehow not
>>> suffient :)
>> What has happened? - Well, you told us yourself: You just installed
>> and didn't do any performance tuning :-)
>> The reasons for that are hopefully known to you ;-)
>>
>> By the way - to get more directed help, or even confirmation from
>> others that, what you find slow can be faster, you should also tell us
>> about
>> RAM in computer
>> CPU(s)
>> exact MySQL version
>> database engines used
>> database sizes (numbers of rows in the critical tables)
>> memory in use by MySQL and bacula during the tree building process
>> the relevant MySQL configuration
>>
>> Cheers,
>>
>> Arno
>>
>>> Regards
>>>
>>> Torsten
> 

-- 
Arno Lehmann
IT-Service Lehmann
Sandstr. 6, 49080 Osnabrück
www.its-lehmann.de

------------------------------------------------------------------------------
SOLARIS 10 is the OS for Data Centers - provides features such as DTrace,
Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
http://p.sf.net/sfu/solaris-dev2dev
_______________________________________________
Bacula-users mailing list
Bacula-users AT lists.sourceforge DOT net
https://lists.sourceforge.net/lists/listinfo/bacula-users

<Prev in Thread] Current Thread [Next in Thread>