sqlschool.gr logo

articles

Articles of SQLschool.gr Team

When Min and Max Memory have the same value things are getting worse

Antonios Chatzipavlis
Sunday 20 June 2021

Το memory management αλλά και οι ρυθμίσεις για αυτό είναι από το περισσότερο σχολιασμένο θέμα στο SQL Server. Παρόλα αυτά όμως συνεχίζω να βλέπω στους διάφορους SQL Server που επισκέπτομαι ρυθμίσεις που κάνουν τα πράγματα χειρότερα από το να έχει αφήσει κάποιος τα defaults (που και αυτό δεν είναι σωστό).

Δεν προτίθεμαι να κάνω αναλυτική αναφορά για τις σωστές ρυθμίσεις στο άρθρο αυτό καθώς έχω αναφερθεί σε αυτά σε αρκετά άρθρα και videos στο SQLschool.gr, αλλά υπάρχει και το συγκεκριμένο άρθρο στο documentation.

Αυτό που θα επαναλάβω είναι ο απλούστερος γενικός κανόνας που χρησιμοποιούμε όλοι σαν πρώτη επιλογή και οποίος ορίζει

Note

Το max server memory σαν την διαφορά της φυσικής μνήμης αφαιρώντας 4GB ή το 10% αυτής (κρατάμε όποιο είναι το μεγαλύτερο) για το OS, και το min server memory να είναι το 40% της παραπάνω διαφοράς.

Φυσικά θα πρέπει να επισημάνω ότι αυτά πάντα αλλάζουν καθώς οι απαιτήσεις αλλάζουν και είναι υποχρέωση ενός DBA να παρακολουθεί την μνήμη του SQL Server και ανάλογα να πράττει.

Αυτό που όμως δεν πρέπει να γίνεται είναι αυτά τα δύο να έχουν την ίδια τιμή. Δεν ξέρω για ποιο λόγο κάποιοι το κάνουν αυτό αλλά αν το κάνουν θα πρέπει να το διορθώσουν καθώς αυτό κάνει τα πράγματα χειρότερα και αυτό ξεκάθαρα αναφέρεται στο παραπάνω άρθρο στο documentation.

If the same value is specified for both min server memory and max server memory, then once the memory allocated to the SQL Server Database Engine reaches that value, the SQL Server Database Engine stops dynamically freeing and acquiring memory for the buffer pool.

Official Microsoft documentation

Στην ουσία καταργείται η δυναμική συμπεριφορά διαχείρισης μνήμης που κάνει o SQL Server και την οποία την θέλουμε.

Note

Επίσης αν είναι ενεργοποιημένο το Lock Page in Memory θα έχουμε memory starvation και το non-bpool θα γίνεται paged ενώ αν δεν είναι το SQL Server working set θα γίνεται paged.

Αν έχετε απορίες για τι είναι τα non-bpool και working sets στο παραπάνω άρθρο θα βρείτε τις απαντήσεις.


Antonios Chatzipavlis

Antonios Chatzipavlis

Antonios Chatzipavlis

Antonios Chatzipavlis is a highly experienced Data Solutions Consultant and Trainer. He has been working in the IT industry since 1988, holding various roles such as senior developer, IT Manager, Data & AI Solutions Architect and Consultant.

Since 1995, Antonios has focused on modern technologies and software development tools, primarily by Microsoft. He has specialized in Data & AI since 2000, with expertise in Microsoft Data Platform (SQL Server, Azure SQL Databases, Azure Synapse Analytics, Microsoft Fabric, Power BI, AI) and Databricks.

Antonios is also a Microsoft Certified Trainer (MCT) for over 25 years, has been recognized as a Microsoft Most Valuable Professional (MVP) in Data Platform since 2010 and he is in the Data Expert 40 Powerlist 2024 by Boussias. He is the co-founder and visionary behind XLYTiCA, a company dedicated to Data & AI solutions.

Episode

Task Flows in Microsoft Fabric

image

More Episodes...

Tip

Get Certified: Become a Fabric Data Engineer

More Tips...

Become a member

If you want to receive updates from us become a member to our community.

Connect

Explore

Learn

sqlschool.gr © 2010-2025 All rights reserved

This site uses cookies for operational and analytics purposes only. By continuing to browse this site, you agree to their use.