Gbak -service switch

60 views
Skip to first unread message

Tomasz Dubiel

unread,
Jul 17, 2022, 7:14:16 AMJul 17
to firebird-support
Hello.
Alex Peshkoff wrote:

-service switch.png
Well, IBSurgeon claims there is speed advantage using this switch:
41. Use switch -se for gbak Use switch –se to increase gbak backup and/or restore speed up to 20%, for example gbak -b -g -se service_mgr c:\db\data.fdb e:\backup\data.fbk

I confirmed that on our Windows server customer (without -g switch) with latest stable Firebird 3.0.10. Task run from Task Scheduler with high priority makes gbk archive of 26 GB database in 1 hour. Restore then was taking too long. 6 hours was not enough.
After that, I changed gbak command to use -service localhost/3050:service_mgr, for backup and restore as well. Results? Gbk file was created in half an hour and the database was restored in 2 hours.
It seems there is really some advantage of using this switch.

Tomasz Dubiel

unread,
Aug 3, 2022, 7:26:22 AMAug 3
to firebird-support
So it seems everyone agrees with me? ;)

Alexey Kovyazin

unread,
Aug 3, 2022, 7:56:41 AMAug 3
to firebird...@googlegroups.com
Hello Tomasz,

For sure there is advantage, especially on Windows . We dont suggest wrong things :)

Regards, 
Alexey Kovyazin 
IBSurgeon Software 
Almaty, Kazakhstan 

ср, 3 авг. 2022 г., 14:26 Tomasz Dubiel <tkdu...@gmail.com>:
--
You received this message because you are subscribed to the Google Groups "firebird-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebird-suppo...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/firebird-support/ee656086-3057-47e4-9681-961693301e72n%40googlegroups.com.

Tomasz Dubiel

unread,
Aug 3, 2022, 8:01:50 AMAug 3
to firebird-support
Thanks for confirming.
What I meant: if a developer of Firebird claims there should be no big advantage of using this switch and it really gives an advantage, equal to permorfing even 2 times better, maybe there is something wrong with simple gbak command?

Alexey Kovyazin

unread,
Aug 3, 2022, 8:22:02 AMAug 3
to firebird...@googlegroups.com
Tomasz,

As I understood, Alex was talking about Linux only. 
On Linux effect of service_mgr is less noticeable, of course. 

Regards, 
Alexey 



Tomasz Dubiel <tkdu...@gmail.com>:

Tomasz Dubiel

unread,
Aug 3, 2022, 8:38:12 AMAug 3
to firebird-support
No, no. He was reffering to the original problem in the reported issue:
"Windows 10 x64, FB3.0.10 x64. "

AlexPeshkoff

unread,
Aug 4, 2022, 6:28:57 AMAug 4
to firebird-support
To answer I need not example but real command line that was used in your test.


Tomasz Dubiel

unread,
Aug 4, 2022, 6:34:06 AMAug 4
to firebird-support
Taken from the script:
For backup:
"%GbakPath%" -B -T -service localhost/3050:service_mgr "%BazyPath%\%%~nF.%BazaExt%" "%KopiePath%\%FName%\%%~nF.gbk" -user %DbUser% -password %DbPass% -Y "%LogPath%\%%~nF-arch-%FName%.backup"
previously without -service localhost/3050:service_mgr
For restore:
"%GbakPath%" -c -service localhost/3050:service_mgr -user %DbUser% -password %DbPass% "%KopiePath%\%FName%\%%~nF.gbk" "%RestorePath%\%%~nF.%BazaExt%" -Y "%LogPath%\%%~nF-arch-%FName%.restore"
previously without -service localhost/3050:service_mgr

Tomasz Dubiel

unread,
Aug 4, 2022, 6:37:48 AMAug 4
to firebird-support
That was checked on Windows Server 2019.

AlexPeshkoff

unread,
Aug 4, 2022, 6:45:46 AMAug 4
to firebird-support
When you talk about localhost:service_mgr - that certainly provides performance effect compared with localhost:dbname gbak. And, BTW, will never cause regression from https://github.com/FirebirdSQL/firebird/issues/7207. But in initial sample I do not see host name.

четверг, 4 августа 2022 г. в 13:37:48 UTC+3, tkdu...@gmail.com:

Tomasz Dubiel

unread,
Aug 4, 2022, 6:52:35 AMAug 4
to firebird...@googlegroups.com
I'm not familiar with the mentioned issue. It just looks quite interesting to me that a simple gbak command with only required parameters can perform even 2 times slower than with using secret switch, which officially is intended for other goals.

--
You received this message because you are subscribed to the Google Groups "firebird-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebird-suppo...@googlegroups.com.

Mark Rotteveel

unread,
Aug 4, 2022, 6:55:48 AMAug 4
to firebird...@googlegroups.com
On 04-08-2022 12:52, Tomasz Dubiel wrote:
> I'm not familiar with the mentioned issue. It just looks quite
> interesting to me that a simple gbak command with only required
> parameters can perform even 2 times slower than with using secret
> switch, which officially is intended for other goals.

What secret switch are you talking about?

Mark
--
Mark Rotteveel

Tomasz Dubiel

unread,
Aug 4, 2022, 6:56:18 AMAug 4
to firebird-support
" But in initial sample I do not see host name." - yeah, I forgot about that. Without localhost:... gbak needed an exclusive access to the database.

Tomasz Dubiel

unread,
Aug 4, 2022, 6:58:04 AMAug 4
to firebird-support
-SE
-SE[RVICE] <servicename>

This switch causes gbak to backup a remote database via the service manager. This causes the backup file to be created on the remote server, so the path format and filename must be valid on the remote server. The servicename is currently always the text service_mgr.


According to that, there is no need to use this switch when doing local backup.

Mark Rotteveel

unread,
Aug 4, 2022, 7:02:12 AMAug 4
to firebird...@googlegroups.com
On 04-08-2022 12:58, Tomasz Dubiel wrote:
> -SE
> https://firebirdsql.org/file/documentation/html/en/firebirddocs/gbak/firebird-gbak.html
> -SE[RVICE] <servicename>
>
> This switch causes gbak to backup a remote database via the service
> manager. This causes the backup file to be created on the remote server,
> so the path format and filename must be valid on the remote server. The
> servicename is currently always the text service_mgr.
>
>
> According to that, there is no need to use this switch when doing local
> backup.

It is documented, so it is not a "secret". And the documentation you
link and quote explicitly says in the note below the text you quote
_"You can use this option to connect to a locally hosted database as
well. If you do, taking a backup using this option can run quicker than
accessing the database directly. See the section below on speeding up
backups."_ (and similar in the restore section).

Mark
--
Mark Rotteveel

Tomasz Dubiel

unread,
Aug 4, 2022, 7:06:10 AMAug 4
to firebird-support
Yeah, but still, the main reason of existence of this switch is to backup remote databases. Couldn't that be simply added to gbak command, that when we backup locally, this option is used automatically?
All I mean it's quite illogical.

Mark Rotteveel

unread,
Aug 4, 2022, 7:15:28 AMAug 4
to firebird...@googlegroups.com
On 04-08-2022 13:06, Tomasz Dubiel wrote:
> Yeah, but still, the main reason of existence of this switch is to
> backup remote databases. Couldn't that be simply added to gbak command,
> that when we backup locally, this option is used automatically?
> All I mean it's quite illogical.

Maybe. On the other hand, it would complicate things for use cases where
there is no server running (i.e. embedded), or were Firebird is running
on a different port than the default, or where you have multiple
Firebird servers installed.

In the current setup, gbak will work for all cases. With your suggestion
you complicate matters for embedded, or you might accidentally install
through the wrong Firebird server (causing the database to be restored
with the wrong ODS, etc).

You will also need to specify a password, while gbak without using a
service can backup and restore with only a user name.

Mark
--
Mark Rotteveel

Tomasz Dubiel

unread,
Aug 4, 2022, 7:26:45 AMAug 4
to firebird-support
Mark, I'm not a programmer, my thought was a shortcut. In other words: in local gbak use the same code as when using gbak locally with this switch, which is responsible for this very, very improved performance. You don't need to run all the code contained with that option.

Alex Peshkoff

unread,
Aug 4, 2022, 9:02:28 AMAug 4
to firebird...@googlegroups.com
On 8/4/22 14:26, Tomasz Dubiel wrote:
> Mark, I'm not a programmer, my thought was a shortcut. In other words:
> in local gbak use the same code as when using gbak locally with this
> switch, which is responsible for this very, very improved performance.
> You don't need to run all the code contained with that option.

Tomasz, may be you will be surprised but there is a way to improve
backup/restore performance in a case of remote access too. gbak utility
would not help with that but using fbsvcmgr one can backup/restore
databases located on remote host with DB copy on local host. And
performance grow is even more significant - in WAN case 10x is quite
possible. May be you will ask - why not use that mode always? The answer
is that will break degrade of ODS version - here gbak of old version
attaching to new version server is important condition for success. Also
in FB4 there is an improvement making restore over the wire (i.e. to
host:db target) run with the same speed as when using services. Backup
will be accelerated a bit later.


Tomasz Dubiel

unread,
Aug 4, 2022, 9:08:07 AMAug 4
to firebird-support
" Also in FB4 there is an improvement making restore over the wire (i.e. to
host:db target) run with the same speed as when using services. Backup
will be accelerated a bit later."
That's what I wanted to hear :-). Why not to make gbak faster if you can do it. If in FB 4.0 there is no difference on Windows with gbak speed, with -se and without it, that's a sufficient solution.

Ivan Petroff

unread,
Aug 4, 2022, 9:24:01 AMAug 4
to firebird...@googlegroups.com
When trying to execute 'isql. Exe - u sysdba security. DB' got error mentioned above. But with build 4.0.0.1433-0_win32 it works OK. New build have only icu63 libraries, but older build have ICU52 too. When I copied icu63 libraries to newer build expression executed without error. 


вс, 17 июл. 2022 г., 14:14 Tomasz Dubiel <tkdu...@gmail.com>:
--
You received this message because you are subscribed to the Google Groups "firebird-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebird-suppo...@googlegroups.com.

Mark Rotteveel

unread,
Aug 4, 2022, 10:01:12 AMAug 4
to firebird...@googlegroups.com
Moderator notice: Please don't start a new discussion/topic in an
existing thread. Instead, create a new thread (by sending/posting a new
message instead of replying to an existing thread)

Mark - moderator

On 04-08-2022 15:23, Ivan Petroff wrote:
> When trying to execute 'isql. Exe - u sysdba security. DB' got error
> mentioned above. But with build 4.0.0.1433-0_win32 it works OK. New
> build have only icu63 libraries, but older build have ICU52 too. When I
> copied icu63 libraries to newer build expression executed without error.
>
>
> вс, 17 июл. 2022 г., 14:14 Tomasz Dubiel <tkdu...@gmail.com
> <mailto:tkdu...@gmail.com>>:
>
> Hello.
> In https://github.com/FirebirdSQL/firebird/issues/7207
> <https://github.com/FirebirdSQL/firebird/issues/7207>
> Alex Peshkoff wrote:
>
> -service switch.png
> Well, IBSurgeon claims there is speed advantage using this switch:
> 41. Use switch -se for gbak Use switch –se to increase gbak backup
> and/or restore speed up to 20%, for example gbak -b -g -se
> service_mgr c:\db\data.fdb e:\backup\data.fbk
>
> I confirmed that on our Windows server customer (without -g switch)
> with latest stable Firebird 3.0.10. Task run from Task Scheduler
> with high priority makes gbk archive of 26 GB database in 1 hour.
> Restore then was taking too long. 6 hours was not enough.
> After that, I changed gbak command to use -service
> localhost/3050:service_mgr, for backup and restore as well. Results?
> Gbk file was created in half an hour and the database was restored
> in 2 hours.
> It seems there is really some advantage of using this switch.
>
> --
> You received this message because you are subscribed to the Google
> Groups "firebird-support" group.
> To unsubscribe from this group and stop receiving emails from it,
> send an email to firebird-suppo...@googlegroups.com
> <mailto:firebird-suppo...@googlegroups.com>.
> <https://groups.google.com/d/msgid/firebird-support/3562bbe1-b360-42a0-af3e-4e7beaa9c7een%40googlegroups.com?utm_medium=email&utm_source=footer>.
>
> --
> You received this message because you are subscribed to the Google
> Groups "firebird-support" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to firebird-suppo...@googlegroups.com
> <mailto:firebird-suppo...@googlegroups.com>.
> To view this discussion on the web, visit
> https://groups.google.com/d/msgid/firebird-support/CAK%2BUfK%2BSfT_yyuRUcMbsaXXZ_mFP45yqnYQ-Otr12qgX2mWj_w%40mail.gmail.com
> <https://groups.google.com/d/msgid/firebird-support/CAK%2BUfK%2BSfT_yyuRUcMbsaXXZ_mFP45yqnYQ-Otr12qgX2mWj_w%40mail.gmail.com?utm_medium=email&utm_source=footer>.


--
Mark Rotteveel
Reply all
Reply to author
Forward
0 new messages