{"id":3156,"date":"2014-10-01T22:40:27","date_gmt":"2014-10-01T22:40:27","guid":{"rendered":"http:\/\/www.deuzebranaweb.com.br\/?p=3156"},"modified":"2014-10-01T22:40:27","modified_gmt":"2014-10-01T22:40:27","slug":"configuracao-firebird-servidor-dedicado","status":"publish","type":"post","link":"https:\/\/blog.deuzebranaweb.com.br\/index.php\/2014\/10\/01\/configuracao-firebird-servidor-dedicado\/","title":{"rendered":"Configura\u00e7\u00e3o Firebird &#8211; Servidor Dedicado"},"content":{"rendered":"<div class=\"message\">\n<div class=\"wiki\">\n<p>Quando instalado em um servidor dedicado, com um bom processador e mem\u00f3ria, \u00e9 poss\u00edvel fazer algumas configura\u00e7\u00f5es no Firebird para melhorar o seu desempenho.<br \/>\nO arquivo se localiza na pasta (por padr\u00e3o) C:\/Program Files\/Firebird\/2.5\/firebird.conf, dentro dele h\u00e1 v\u00e1rias configura\u00e7\u00f5es com suas explica\u00e7\u00f5es, e vamos mostrar alguns exemplos de como configurar. Para isso, basta copiar as configura\u00e7\u00f5es abaixo dentro do arquivo (<em>firebird.conf<\/em>), dependendo das configura\u00e7\u00f5es da maquina:<\/p>\n<p><a name=\"Configura\u00e7\u00f5es\"><\/a><\/p>\n<h3>Configura\u00e7\u00f5es<\/h3>\n<ul>\n<li>Configura\u00e7\u00e3o para servidor com processador dual-core, e pelo menos 4GB mem\u00f3ria:\n<pre>DefaultDbCachePages = 4096\nFileSystemCacheThreshold = 67108864\nFileSystemCacheSize = 70\nCpuAffinityMask = 3<\/pre>\n<\/li>\n<\/ul>\n<ul>\n<li>Configura\u00e7\u00e3o para servidor com processador dual-core, e pelo menos 8GB mem\u00f3ria:\n<pre>DefaultDbCachePages = 8192\nFileSystemCacheThreshold = 134217728\nFileSystemCacheSize = 70\nCpuAffinityMask = 3<\/pre>\n<\/li>\n<\/ul>\n<ul>\n<li>Configura\u00e7\u00e3o para servidor com processador quad-core, e acima de 8GB mem\u00f3ria:\n<pre>DefaultDbCachePages = 16384\nFileSystemCacheThreshold = 268435456\nFileSystemCacheSize = 80\nCpuAffinityMask = 3<\/pre>\n<\/li>\n<\/ul>\n<p><a name=\"Banco-de-Dados\"><\/a><\/p>\n<h3>Banco de Dados<\/h3>\n<p>Ap\u00f3s feito as altera\u00e7\u00f5es no arquivo, reinicie o Firebird, e fa\u00e7a o processo de <strong>Backup<\/strong> e <strong>Restaurar<\/strong> do banco de dados definindo o campo <strong>Page Size<\/strong> igual ao que foi configurado na op\u00e7\u00e3o <strong>DefaultDbCachePages<\/strong> (a primeira da lista), conforme a imagem abaixo:<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/workdev.ddns.com.br:8080\/redmine\/attachments\/download\/1529\/firebird.png\" alt=\"\" \/><\/p>\n<p><a name=\"Aplica\u00e7\u00e3o\"><\/a><\/p>\n<h3>Aplica\u00e7\u00e3o<\/h3>\n<p>Na aplica\u00e7\u00e3o, \u00e9 preciso entrar na janela de <a class=\"wiki-page\" href=\"http:\/\/workdev.ddns.com.br:8080\/redmine\/projects\/framwork\/wiki\/FrameworkSetup\">configura\u00e7\u00e3o do banco de dados<\/a>, e definir o campo <strong>Pacotes<\/strong>, igual ao que foi configurado na op\u00e7\u00e3o <strong>DefaultDbCachePages<\/strong> (a primeira da lista), conforme a imagem abaixo:<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/workdev.ddns.com.br:8080\/redmine\/attachments\/download\/1530\/aplicacao.png\" alt=\"\" \/><\/p>\n<p><a name=\"Cuidado\"><\/a><\/p>\n<h3>Cuidado<\/h3>\n<p>Se as altera\u00e7\u00f5es comprometerem o desempenho do sistema, ou causarem perdas de conex\u00e3o ou lentid\u00e3o, desfa\u00e7a as mudan\u00e7as no arquivo de configura\u00e7\u00e3o e contate o suporte.<\/p>\n<p><a name=\"Entendendo-as-Mudan\u00e7as\"><\/a><\/p>\n<h3>Entendendo as Mudan\u00e7as<\/h3>\n<blockquote><p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br \/>\nNumber of cached database pages<\/p>\n<p>This sets the number of pages from any one database that can be held<br \/>\nin cache at once. If you increase this value, the engine will<br \/>\nallocate more pages to the cache for every database. By default, the<br \/>\nSuperServer allocates 2048 pages for each database and the classic<br \/>\nallocates 75 pages per client connection per database.<\/p>\n<p>Type: integer<\/p>\n<p>DefaultDbCachePages = 2048<\/p><\/blockquote>\n<ul>\n<li><strong>DefaultDbCachePages<\/strong> = 8192\n<ul>\n<li>Define o tamanho do arquivo de pagina\u00e7\u00e3o utilizado pelo cache da maquina, quanto maior o valor, maior a quantidade de dados que trafega em um mesmo processo simultaneo, resultando em pesquisas mais r\u00e1pidas.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<blockquote><p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br \/>\nFile system cache threshold<\/p>\n<p>The threshold value that determines whether Firebird will use file system<br \/>\ncache or not. File system caching is used if database cache size in pages<br \/>\n(configured explicitly in database header or via DefaultDbCachePages setting)<br \/>\nis less than FileSystemCacheThreshold value.<\/p>\n<p>To use file system cache always set FileSystemCacheThreshold to a large value.<br \/>\nTo bypass file system cache for all databases set FileSystemCacheThreshold to<br \/>\nzero.<\/p>\n<p>Type: integer, measured in database pages<\/p>\n<p>FileSystemCacheThreshold = 65536<\/p><\/blockquote>\n<ul>\n<li><strong>FileSystemCacheThreshold<\/strong> = 134217728\n<ul>\n<li>Esta op\u00e7\u00e3o define o tamanho do arquivo de cache que o firebird utiliza para salvar os arquivos da pagina\u00e7\u00e3o da configura\u00e7\u00e3o acima.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<blockquote><p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br \/>\nFile system cache size<\/p>\n<p>This setting controls the maximum amount of RAM used by Windows file system<br \/>\ncache on 64-bit Windows XP, Windows Server 2003 SP1 or later host. It has no<br \/>\neffect for Unix hosts in this release yet.<\/p>\n<p>Note that the lowest number presently supported is 10%, and the highest number<br \/>\nis 95%; numbers outside these limits will be set to the default of 30%.<\/p>\n<p>If the cache size has already been selected when the engine starts the host<br \/>\nsetting will not be changed. Thus you may need to reboot the host for the<br \/>\nchange of this setting to have effect.<\/p>\n<p>To leave host caching settings unchanged set this parameter to 0.<\/p>\n<p>Security note<br \/>\nTo adjust the setting engine needs SeIncreaseQuotaPrivilege right. Built-in<br \/>\nservice accounts and administrators have it by default. Installer grants this<br \/>\nright to Firebird service account. If the engine fails to adjust the cache<br \/>\nsize setting it will log warning message to the firebird.log and continue.<\/p>\n<p>Type: integer, measured in % of total physical RAM<\/p>\n<p>FileSystemCacheSize = 30<\/p><\/blockquote>\n<ul>\n<li><strong>FileSystemCacheSize<\/strong> = 80\n<ul>\n<li>Esta configura\u00e7\u00e3o define a porcentagem da memoria o firebird pode utilizar para o cache. N\u00e3o \u00e9 recomendado definir valores acima de 70 ou 80 se o servidor n\u00e3o for 100% dedicado ao banco de dados.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<blockquote><p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br \/>\nWhich CPUs should be used (Windows Only)<\/p>\n<p>In an SMP system, sets which processors can be used by the server.<br \/>\nThe value is taken from a bit map in which each bit represents a CPU.<br \/>\nThus, to use only the first processor, the value is 1. To use both<br \/>\nCPU 1 and CPU 2, the value is 3. To use CPU 2 and CPU 3, the value<br \/>\nis 6. The default value is 1.<\/p>\n<p>Type: integer<\/p>\n<p>CpuAffinityMask = 1<\/p><\/blockquote>\n<ul>\n<li><strong>CpuAffinityMask<\/strong> = 3\n<ul>\n<li>Esta configura\u00e7\u00e3o define quantos cores do processador o firebird pode utilizar para os processos. <strong>3<\/strong> para dual-core, <strong>10<\/strong> para quad-core, <strong>21<\/strong> para hexa-core. Definir apenas para os n\u00facleos reais, pois o firebird anterior a vers\u00e3o 3.0 n\u00e3o utiliza todos os n\u00facleos do processador.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/div>\n<div class=\"attachments\">\n<p><a class=\"icon icon-attachment\" href=\"http:\/\/workdev.ddns.com.br:8080\/redmine\/attachments\/download\/1529\/firebird.png\">firebird.png<\/a> <span class=\"size\">(7,906 KB)<\/span><\/p>\n<p><a class=\"icon icon-attachment\" href=\"http:\/\/workdev.ddns.com.br:8080\/redmine\/attachments\/download\/1530\/aplicacao.png\">aplicacao.png<\/a> <span class=\"size\">(10,155 KB)<\/span><\/p>\n<\/div>\n<\/div>\n<p>http:\/\/workdev.ddns.com.br:8080\/redmine\/boards\/11\/topics\/107<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Quando instalado em um servidor dedicado, com um bom processador e mem\u00f3ria, \u00e9 poss\u00edvel fazer algumas configura\u00e7\u00f5es no Firebird para melhorar o seu desempenho. O arquivo se localiza na pasta (por padr\u00e3o) C:\/Program Files\/Firebird\/2.5\/firebird.conf, dentro dele h\u00e1 v\u00e1rias configura\u00e7\u00f5es com suas explica\u00e7\u00f5es, e vamos mostrar&#8230;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_angie_page":false,"page_builder":"","footnotes":""},"categories":[22],"tags":[],"class_list":["post-3156","post","type-post","status-publish","format-standard","hentry","category-firebird"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/blog.deuzebranaweb.com.br\/index.php\/wp-json\/wp\/v2\/posts\/3156","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.deuzebranaweb.com.br\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.deuzebranaweb.com.br\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.deuzebranaweb.com.br\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.deuzebranaweb.com.br\/index.php\/wp-json\/wp\/v2\/comments?post=3156"}],"version-history":[{"count":0,"href":"https:\/\/blog.deuzebranaweb.com.br\/index.php\/wp-json\/wp\/v2\/posts\/3156\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.deuzebranaweb.com.br\/index.php\/wp-json\/wp\/v2\/media?parent=3156"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.deuzebranaweb.com.br\/index.php\/wp-json\/wp\/v2\/categories?post=3156"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.deuzebranaweb.com.br\/index.php\/wp-json\/wp\/v2\/tags?post=3156"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}