火鸟架构

发布于 2024-08-15 12:16:16 字数 210 浏览 4 评论 0 原文

  1. 如何判断现有 Firebird RDBMS 服务器(即经典服务器或超级服务器)安装/配置/运行哪个架构?

    如何
  2. 如何在两种模式之间切换?

  3. Firebird 的哪些版本(1.5、2.0、2.1)和架构(CS 或 SS)可以在多处理器服务器上使用?以及如何为多处理器服务器和多线程应用程序正确配置它们?

  1. How can I tell which architecture is installed/configured/running on an existing installation of Firebird RDBMS server (ie. Classic Server or Super-Server)?

  2. How can I switch between the two modes?

  3. Which versions (1.5, 2.0, 2.1) and architectures (CS or SS) of Firebird can be used on multi-processor servers? and how to configure them properly for multi-processor sever and multi-threaded application?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

稚气少女 2024-08-22 12:16:16

1 -- 要了解哪个架构正在运行,请打开任务管理器并查看正在运行的进程。 fb_inet_server.exe代表经典架构,fbserver.exe——超级服务器。

2 -- 关闭所有客户端连接。到达 Firebird\Bin 目录。执行指定的命令序列:

instsvc stop
instsvc remove

然后:

instsvc install -s -a   -- for Super Server

instsvc install -c -a   -- for Classic

之后:

instsvc start

3 -- Super Server 始终在单处理器或核心上运行,并且无法扩展。在SMP环境中使用经典架构。在后一种情况下,请勿指定超过 800-1000 的页面缓冲区。

请注意,经典服务器的性能取决于磁盘子系统的性能。
对于大型数据库,请使用具有内部高速缓存、电池和启用“写回”模式的 RAID 控制器。

1 -- To tell which architecture is running open Task Manager and look at running processes. fb_inet_server.exe stands for classic architecture, and fbserver.exe -- super server.

2 -- Close all client connections. Got to Firebird\Bin directory. Execute specified sequence of commands:

instsvc stop
instsvc remove

then either:

instsvc install -s -a   -- for Super Server

or

instsvc install -c -a   -- for Classic

after that:

instsvc start

3 -- Super Server always runs on single processor or core and can not scale. Use Classic architecture in SMP environment. In latter case dont specify page buffers more than 800-1000.

Be aware that performance of Classic Server depends on performance of disk subsystem.
For big databases use RAID controllers with internal cache memory, battery and "write back" mode enabled.

一枫情书 2024-08-22 12:16:16

几乎在所有情况下您都应该使用超级服务器。尽管超级服务器“仅”在一个 CPU 核心上运行,但它的速度基本上更快。其原因是数据库服务器负载。 它不渲染视频或计算小麦信息。它具有极高的 IO 负载。这意味着它从内存和驱动器读取和写入数据。经典和超经典服务器为每个连接创建缓存。这意味着 10 个不同的连接(例如 10 个客户端计算机)将拥有自己的缓存。假设他们正在使用相同的数据(客户、订单......)。问题是每个连接的缓存中都没有相关信息。因此每个连接都会从硬盘加载这些记录。这种行为会导致极高的驱动负载并减慢一切速度。超级服务器(版本将所有部分放在一起,超级服务器速度更快。而且我期待安装 firebird 3.0 版本,因为 firebird 3.0 超级服务器使用多个 CPU 并具有一个“共享”服务器缓存。

You should use the superserver in nearly every case. Although the superserver runs on "only" one CPU core, it's mostly faster. The reason for this is the DB server load. It's not rendering videos or calculating wheater information. It has an extreme high IO load. That means it reads and writes data from the memory and drives. The classic and superclassic server creates cache for every connection. That means that 10 different connections (for instance 10 client computers) will have their own cache. Let's say they are working with the same data (customers, oders...). The problem is that each connection does not have the relevant information in the cache. So every connection will load these records from the hard drive. This behavior causes an extrem high drive load and slows down everything. The superserver (version < FB 3.0) is just using one CPU core, but has one cache. So user 2,3..10 doesn't have to load the data from the drive because user 1 already loaded it into the server cache. Taking all pieces together the superserver is faster. And I'm looking forward to installing the firebird 3.0 release because the firebird 3.0 superserver uses multiple CPUs and has one "shared" server cache.

不语却知心 2024-08-22 12:16:16
  1. 您可以使用 isql 脚本rel="nofollow noreferrer">https://ib-aid.com/en/articles/how-to-define-firebird-architecture-with-sql-query/
​set list on;

set term ^;
--create or alter procedure sys_get_fb_arch (
--     a_connect_with_usr varchar(31) default 'SYSDBA'
--    ,a_connect_with_pwd varchar(31) default 'masterkey'
--) returns(
--    fb_arch varchar(50)
--) as

execute block returns( fb_arch varchar(50) )
as
    declare a_connect_with_usr varchar(31) default 'SYSDBA';
    declare a_connect_with_pwd varchar(31) default 'masterkey';
    declare cur_server_pid int;
    declare ext_server_pid int;
    declare att_protocol varchar(255);
    declare v_test_sttm varchar(255);
    declare v_fetches_beg bigint;
    declare v_fetches_end bigint;
begin
    
    -- Aux SP for detect FB architecture.
 
    select a.mon$server_pid, a.mon$remote_protocol
    from mon$attachments a
    where a.mon$attachment_id = current_connection
    into cur_server_pid, att_protocol;
 
    if ( att_protocol is null ) then
        fb_arch = 'Embedded';
    else if ( upper(current_user) = upper('SYSDBA')
              and rdb$get_context('SYSTEM','ENGINE_VERSION') NOT starting with '2.5'
              and exists(select * from mon$attachments a
                         where a.mon$remote_protocol is null
                               and upper(a.mon$user) in ( upper('Cache Writer'), upper('Garbage Collector'))
                        )
            ) then
        fb_arch = 'SuperServer';
    else
        begin
            v_test_sttm =
                'select a.mon$server_pid + 0*(select 1 from rdb$database)'
                ||' from mon$attachments a '
                ||' where a.mon$attachment_id = current_connection';
 
            select i.mon$page_fetches
            from mon$io_stats i
            where i.mon$stat_group = 0  -- db_level
            into v_fetches_beg;
        
            execute statement v_test_sttm
            on external
                 'localhost:' || rdb$get_context('SYSTEM', 'DB_NAME')
            as
                 user a_connect_with_usr
                 password a_connect_with_pwd
                 role left('R' || replace(uuid_to_char(gen_uuid()),'-',''),31)
            into ext_server_pid;
        
            in autonomous transaction do
            select i.mon$page_fetches
            from mon$io_stats i
            where i.mon$stat_group = 0  -- db_level
            into v_fetches_end;
        
            fb_arch = iif( cur_server_pid is distinct from ext_server_pid,
                           'Classic',
                           iif( v_fetches_beg is not distinct from v_fetches_end,
                                'SuperClassic',
                                'SuperServer'
                              )
                         );
        end
 
    fb_arch = trim(fb_arch) || ' ' || rdb$get_context('SYSTEM','ENGINE_VERSION');
 
    suspend;
 
end
 
^ -- sys_get_fb_arch
set term ;^

  1. You can use script for isql from https://ib-aid.com/en/articles/how-to-determine-firebird-architecture-with-sql-query/ :

​set list on;

set term ^;
--create or alter procedure sys_get_fb_arch (
--     a_connect_with_usr varchar(31) default 'SYSDBA'
--    ,a_connect_with_pwd varchar(31) default 'masterkey'
--) returns(
--    fb_arch varchar(50)
--) as

execute block returns( fb_arch varchar(50) )
as
    declare a_connect_with_usr varchar(31) default 'SYSDBA';
    declare a_connect_with_pwd varchar(31) default 'masterkey';
    declare cur_server_pid int;
    declare ext_server_pid int;
    declare att_protocol varchar(255);
    declare v_test_sttm varchar(255);
    declare v_fetches_beg bigint;
    declare v_fetches_end bigint;
begin
    
    -- Aux SP for detect FB architecture.
 
    select a.mon$server_pid, a.mon$remote_protocol
    from mon$attachments a
    where a.mon$attachment_id = current_connection
    into cur_server_pid, att_protocol;
 
    if ( att_protocol is null ) then
        fb_arch = 'Embedded';
    else if ( upper(current_user) = upper('SYSDBA')
              and rdb$get_context('SYSTEM','ENGINE_VERSION') NOT starting with '2.5'
              and exists(select * from mon$attachments a
                         where a.mon$remote_protocol is null
                               and upper(a.mon$user) in ( upper('Cache Writer'), upper('Garbage Collector'))
                        )
            ) then
        fb_arch = 'SuperServer';
    else
        begin
            v_test_sttm =
                'select a.mon$server_pid + 0*(select 1 from rdb$database)'
                ||' from mon$attachments a '
                ||' where a.mon$attachment_id = current_connection';
 
            select i.mon$page_fetches
            from mon$io_stats i
            where i.mon$stat_group = 0  -- db_level
            into v_fetches_beg;
        
            execute statement v_test_sttm
            on external
                 'localhost:' || rdb$get_context('SYSTEM', 'DB_NAME')
            as
                 user a_connect_with_usr
                 password a_connect_with_pwd
                 role left('R' || replace(uuid_to_char(gen_uuid()),'-',''),31)
            into ext_server_pid;
        
            in autonomous transaction do
            select i.mon$page_fetches
            from mon$io_stats i
            where i.mon$stat_group = 0  -- db_level
            into v_fetches_end;
        
            fb_arch = iif( cur_server_pid is distinct from ext_server_pid,
                           'Classic',
                           iif( v_fetches_beg is not distinct from v_fetches_end,
                                'SuperClassic',
                                'SuperServer'
                              )
                         );
        end
 
    fb_arch = trim(fb_arch) || ' ' || rdb$get_context('SYSTEM','ENGINE_VERSION');
 
    suspend;
 
end
 
^ -- sys_get_fb_arch
set term ;^

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文