-
-
Notifications
You must be signed in to change notification settings - Fork 205
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Firebird.conf DefaultDbCachePages better description #7630
base: master
Are you sure you want to change the base?
Firebird.conf DefaultDbCachePages better description #7630
Conversation
Hi. As many times on firebird group is question about DefaultDbCachePages, i have written probably better description. Users ask why my server use so low memory even if i setup big value in config. They do not know how this cache work and that firebird.conf setting can be overrided by different one. Please fill free to fix it as i am not native English
fix typo
builds/install/misc/firebird.conf
Outdated
# Per-database configurable. This value can be overrided by databases.conf or | ||
# directly in database file by issuing command: | ||
# gfix -b[uffers] BUFFERS | ||
# Priority of setings is: direcly in database, databases.conf, firebird.conf. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Priority of settings is: directly in database, databases.conf, firebird.conf.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see here one typo direcly
should be directly
# Priority of settings is: directly in database, databases.conf, firebird.conf. | ||
# The SuperServer default value is 2048 pages for each database and the classic | ||
# value is 256 pages per client connection per database. | ||
# As this value means maximum number of pages cached, at start server use minimal RAM. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Engine allocates all buffers at the attachment. It's true both for SuperServer and for ClassicServer. Therefore, SuperServer allocates all buffers at the first connection. ClassicServer allocates buffers for every attachment and this number depends on number of attachments.
I think suggested description is not complete as well and doesn't sole original question.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@romansimakov
I did not observe such thing like SuperServer allocation of all buffers. I start server, connect to database and server still use low RAM. Only if i select from multiple tables it increase RAM usage. But i still use FB3. Maybe was some changes in recent version of FB?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@romansimakov I did not observe such thing like SuperServer allocation of all buffers. I start server, connect to database and server still use low RAM. Only if i select from multiple tables it increase RAM usage. But i still use FB3. Maybe was some changes in recent version of FB?
What's your OS and how do you see? I'm afraid OS just doesn't allocate asked memory phisically and leaves it as virtually allocated. When engine addresses a memory page maps on phisical memory and from that time OS account it as used by the process.
For example, on my Ubuntu I can see the following for 2048 cache on SuperServer:
- Just after server start
roman:bin$ grep Vm /proc/`pidof rdbserver`/status
VmPeak: 470764 kB
VmSize: 405680 kB
VmHWM: 42504 kB
VmRSS: 42504 kB
VmData: 58240 kB
- After connect to a big (80GB) database:
roman:bin$ grep Vm /proc/pidof rdbserver
/status
VmPeak: 1384600 kB
VmSize: 1319452 kB
VmHWM: 72432 kB
VmRSS: 72432 kB
VmData: 632884 kB
- After select from a big table:
roman:bin$ grep Vm /proc/pidof rdbserver
/status
VmPeak: 1384600 kB
VmSize: 1319068 kB
VmHWM: 103860 kB
VmRSS: 103860 kB
VmData: 632500 kB
- After disconnect
roman:bin$ grep Vm /proc/pidof rdbserver
/status
VmPeak: 1384600 kB
VmSize: 764724 kB
VmHWM: 103860 kB
VmRSS: 40868 kB
VmData: 90628 kB
Note how VmRSS and VmSize change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I.e. it's controlled not by the Engine but by OS
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Get a difference between virtual memory and physical memory. When you allocate memory, virtual memory counter is increased. When you access that allocated memory, physical memory counter is increased. So Firebird allocates (read: reserves in virtual memory) the whole page cache at startup, but its usage (physical memory) will grow only when pages are read into the cache.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suppose that talking about Phisical Memory usage is more interesting for people which read config values description and what they observe after FB start. But my text was only proposition of description, fill free to extend that info of Virtual Memory preservation and any other info which help to understand that parameter.
Hi. As many times on Firebird group is question about DefaultDbCachePages, i have written probably better description. Users ask why my server use so low memory even if i setup big value in config. They do not know how this cache work and that firebird.conf setting can be overrided by different one.
Please fill free to fix it as i am not native English