Escolar Documentos
Profissional Documentos
Cultura Documentos
gutzait@pythian.com
mgutzait@gmail.com
www.pythian.com
Organiza
http://tinyurl.com/ComunidadWindows
Patrocinadores del SQL Saturday
Platinum Sponsor
Gold Sponsor
Bronze Sponsor
El perfecto SQL Server…
Niveles de las Mejores Practicas
Operating System
Instance
Database
DB code
Application
Versiones y patches - general
Ultima version
Ultimo patch
Ultimo firmware
Ultima version de drivers
Seguridad - general
No incluido…
Alta Disponibilidad y Disaster Recovery
No incluido…
Diseño de base de datos y código
No incluido…
Hardware, Red y OS
Servidor dedicado a SQL
Almacenamiento (Storage)
Red (Network)
Memoria
CPU
Antivirus!
Otros programas y aplicaciones
Almacenamiento
https://technet.microsoft.com/en-
us/library/dd758814(v=sql.100).aspx
Niveles de Raid
Raid 1+0 / Raid 5 / Raid 1
Alienación del disco y “block size”
64k NTFS block size
SSD, iSCSI, etc.
Pero….
Recomendaciones:
Diferentes vendedores y diferentes
practicas
Chequee el rendimiento:
<20ms /read 0.02 sec/read
<20ms /write 0.02 sec/write
Use DiskSpd (supersedente de
SQLIO) para chequear diferentes
cargas de trabajo (workloads)
Red (Network)
https://www.visualstudio.com/en-us/docs/work/reference/configure-
network-adapter-automatically-adjust-speed
Adaptadores de red (Network adapters) y “switch
ports” configurado a modo ”Full-duplex”
https://support.microsoft.com/en-us/help/2032911/you-may-encounter-
problems-when-installing-sql-server-on-a-domain-controller
“Domain Controller” separado
https://technet.microsoft.com/en-us/library/gg162709(v=WS.10).aspx
“TCP Chimney Offload” desactivada
Pasa el procesimiento del TCP trafico desde el CPU del
servidor al adaptador de la red
Pero…
TCP Chimney Offloading
This feature is not suitable for all applications.
Microsoft says (at http://technet.microsoft.com/en-
us/library/gg162709%28v=WS.10%29.aspx):
“Because of the overhead associated with moving TCP/IP
processing to the network adapter, TCP Chimney Offload
offers the most benefit to applications that have long-
lived connections and transfer large amounts of data.
Servers that perform database replication, function as file
servers, or perform backup functions are examples of
computers that may benefit when you enable TCP Chimney
Offload.”
Memoria
Lo mas – lo mejor para SQL Server
Dejar >2GB por OS y otros procesos
Asegurar que el paging file no esta utilizado
“Lock pages in memory” activado
System properties > Advanced setting
Memory usage: Seleccionar "Programs“
https://docs.microsoft.com/en-us/sql/relational-
databases/databases/database-instant-file-initialization
“Instant File Initialization” activado
Pero…
“Lock Pages in Memory”:
https://www.simple-talk.com/sql/database-
administration/great-sql-server-debates-
lock-pages-in-memory/
SQL Server 2005 sobre Windows Server 2003– YES
Nuevas versiones – NO
Especialmente NO con Machinas virtuales
Yo sigo esto:
0.5 por processor lógico y no mas de 8 archivos
Monitorizar contención de asignación en tempdb
https://blogs.msdn.microsoft.com/sqlserverstorageen
gine/2009/01/11/tempdb-monitoring-and-
troubleshooting-allocation-bottleneck/
Configuración de protocolos de red
Protocolos
Configuración de memoria
Min memory
Max memory
Efectos de Min y Max Server Memory -
https://technet.microsoft.com/en-
us/library/ms180797(v=sql.105).aspx
El buffer pool no suelta la asignación de memoria una vez
adquiriendo min server memory
Pero…
Min server memory
Casos donde se necesita elevar?
CPU & scheduling
Afinidad de CPU BOL:
"Most systems
obtain optimal
performance by
letting the
operating system
schedule the
threads among
the available
CPUs. “
Degree of parallelism
MAXDOP
Cost threshold for parallelism
Planes de mantenimiento
(Maintenance tasks)
Index defragmentation
Update statistics with FULLSCAN
Integrity Checks
Delete history from msdb
Recycle Errorlog
Trace Flags
http://sqlturbo.com/the-most-important-trace-
flags-for-sql-server/
1117
1118
834 – On computer systems with 64 or more CPU cores, causes SQL Server to use
Microsoft Windows large-page allocations for the memory that is allocated for the
buffer pool (https://blogs.technet.microsoft.com/sql_server_isv/2010/11/30/temenos-
t24-trace-flag-834-and-when-to-use-it/)
gutzait@pythian.com www.pythian.com
Michelle
Gutzait
https://twitter.com/
mgutzait