Académique Documents
Professionnel Documents
Culture Documents
Results
Lab Configuration
A view is created
for each tenant Custom fields
Test
• Retrieve a random page of records from a
random tenant view
9 Extension Fields
Analysis
• With more tenants and rows in the
database, as the number of
concurrent users increases, the
retrieval of randomized rows causes
memory pressure and consequently
I/O activity due to paging.
No relevant Memory
I/O Activity pressure
&
I/O Activity
25 concurrent
users
Measuring the effect of adding fields
Increasing the number of
fields impacts on the
overall throughput an
order of magnitude
25 concurrent
users
Test
• Retrieve rows filtered by a random field
value from a random tenant view
SELECT * FROM entity_tenant(x)
WHERE field(n) = ‘value’
How Does it Scale?
GetOne
(filteri
The behavior remains
ng) similar
GetAll
(no
filtering)
Conclusions
• Filtering by a value in the extension
table has little effect on the overall
performance
• It’s expected an increase of the
processor usage due to the row
filtering. This becomes evident in the
0 fields scenario
Extension Table – View
( using PIVOT )
Current query
PIVOT query
To keep in mind
• Indexes help!
– Clustered Index on “tenant id and record
id”
– Clustered Index on “record id and
extension id”
Extension Table
INSERT
OPERATIONS
Test
• Get Entity Schema from
TenantMetaDataStore DB (retrieves
entity fields definition)
• Insert Shared Data in TenantDataStore
DB
• Insert Custom Data in TenantDataStore
DB
The effect on Tx/sec and CPU usage
Relevan
t for
inserts
5 extension
fields Data Log
File File
Conclusions
• At 500,000 rows (100 tenants)
– Throughput increases with the number of
concurrent users. Resources remain in
acceptable levels.
• At 15,000,000 rows (3000 tenants)
– Minimal gain in throughput due to memory
pressure and consequently intensive I/O
activity (page file).
• Next Steps: Analyze how to improve
metadata retrieval
• Analysis hints:
– “Writes” use sequential I/O for log files, “Reads” involve
Fixed Columns
Response time is
not affected by
concurrency
Analysis
• Fixed Columns approach
(analogous to 0 extension fields)
scales better than extension
table
– Extension table is CPU intensive when
adding fields (98% vs. 35%)
• When adding concurrent users, we
gain throughput while response time
is not affected
• Memory remains the same
Bottom Line
• Developing multi-tenant
architectures requires stressing the
database to detect the glass ceiling
of customers you can handle in a
single instance. This involves:
– Developing unit and load tests for
each scenario
– Generating a massive set of
simulated data
– Deploying the tests in a rig and
Introducing the Multi-tenant
Database Performance Test
Guide