Memory Usage in Firebird: Alexey Kovyazin Ibsurgeon
Memory Usage in Firebird: Alexey Kovyazin Ibsurgeon
FIREBIRD
Alexey Kovyazin
IBSurgeon
www.ib-aid.com
2
www.ibase.ru
www.ib-aid.com
20/05/2018 www.ib-aid.com
3
Agenda
Part 1: Understanding memory usage in Firebird
• Memory types in Windows and Linux
• How Firebird uses memory
• File cache and Firebird
Part 2: Tuning memory usage in Firebird database
• Firebird.conf parameters for memory tuning
• Optimal firebird parameters
20/05/2018 www.ib-aid.com
4
PART 1: UNDERSTANDING
MEMORY USAGE IN
FIREBIRD
20/05/2018 www.ib-aid.com
5
Memory, occupied
Paged memory by processes
20/05/2018 www.ib-aid.com
6
For Firebird
Core
firebird.exe,
fbserver.exe,
fb_inet_server.exe,
Paged memory /opt/bin/firebird,
/opt/bin/fb_inet_server
20/05/2018 www.ib-aid.com
7
Paged memory
Processes
Swap
File cache
Database file
8
RAM on Windows
• By default, Windows memory manager has
the following %% for memory types
• 50% paged memory
Use RAMMap to see the
• 41% file cache real memory
• 9% kernel consumption
RAMMap
20/05/2018 www.ib-aid.com
10
RAM on Linux
• Core – 10%
• Processes - on demand
• File cache – takes all available space
20/05/2018 www.ib-aid.com
11
20/05/2018 www.ib-aid.com
12
others.exe process
File cache
20/05/2018 www.ib-aid.com
13
5. Undo лог
• Depends on the number of changes in the frames of transactions
20/05/2018 www.ib-aid.com
14
20/05/2018 www.ib-aid.com
15
20/05/2018 www.ib-aid.com
16
Conclusions
• OS has specific default distribution between memory
types
• The goal of memory management is to fit into frames of
OS limits and memory use patterns
• In the second part we will consider how to tune Firebird
memory usage
20/05/2018 www.ib-aid.com
17
20/05/2018 www.ib-aid.com
18
others.exe process
File cache
20/05/2018 www.ib-aid.com
19
5. Undo log
• Depends on the number of changes in the frames of transactions
20/05/2018 www.ib-aid.com
20
20/05/2018 www.ib-aid.com
21
• Default values
• SuperServer 2.5: 2048 pages x 4096 byte = 8 Mb
• Classic/SuperClassic 2.5: 75 x 4096 = 0,29 Mb
20/05/2018 www.ib-aid.com
23
20/05/2018 www.ib-aid.com
24
20/05/2018 www.ib-aid.com
25
20/05/2018 www.ib-aid.com
26
20/05/2018 www.ib-aid.com
27
20/05/2018 www.ib-aid.com
28
20/05/2018 www.ib-aid.com
29
Lock table
• Lock table size
• Initial parameter is set in LockMemSize
• Default – 1Мб
• Automatically increased
• We recommend to set lock table size to the value
you can see after the day of work
20/05/2018 www.ib-aid.com
30
20/05/2018 www.ib-aid.com
32
20/05/2018 www.ib-aid.com
33
20/05/2018 www.ib-aid.com
34
20/05/2018 www.ib-aid.com
35
20/05/2018 www.ib-aid.com
36
20/05/2018 www.ib-aid.com
37
Thank you!
Contact us:
• https://www.ib-aid.com
• [email protected]
20/05/2018 www.ib-aid.com
38
20/05/2018 www.ib-aid.com