Использование MongoDB как основной метабазы в UGC-сервисах
-
Upload
yandex -
Category
Technology
-
view
1.109 -
download
0
description
Transcript of Использование MongoDB как основной метабазы в UGC-сервисах
1
2
3
Mongodb, UGC project
- billions objects; - terabytes of data MongoDB; - high Disk I/O; - big size Indexes - balancing & connections to DB; - troubleshooting mongodb;
4
Yandex.Disk is a service for storing and sharing files that also provides access to files from any device connected to the internet.> 19M Users> 10M file uploads per day
SDK – http://api.yandex.ru/disk/The Yandex.Disk SDK is intended for applications that work with the files of Yandex.Disk users or store their own files and settings on Yandex.Disk.
5
~6,4 billion objects:
6
~6 Tb filesize:
7
~1.5 Tb IndexSize;
8
> 6 billion operations every day;
9
- over 50000 chunks
10
Notes:
- write global lock to DB; - no transactions; - single threaded chunk moving job; - 20000 connections limit to mongod/mongos; - Mongos unable to work in RO mode; - no connection-pool
11
12
13
14
15
DBA at work:
16
Usual RS:
Secondary
Secondary
Secondaryhidden
Primary
ReplicaSet:
UPUP
UP
UP
UP delay
17
Clean hidden and Startup:
Secondary
Secondary
Secondaryhidden
Primary
ReplicaSet:
Startup
UP
UP
UP
18
Recover Secondary:
Secondary
Secondary
Secondaryhidden
Primary
ReplicaSet:
DOWN
DOWN
UP
UP
rsync
19
Chunk-defrag RS:
Secondary
Secondary
Secondaryhidden
Primary
ReplicaSet:
UPUP
UP
Defrag UP
Defrag UP delay
20
Recover Secondary:
Secondary Secondary
Secondaryhidden
Primary
ReplicaSet:
DOWN
DOWN
UP
Defrag UP
rsync
21
Usual RS:
Secondary
Secondary
Secondaryhidden
Primary
ReplicaSet:
UPUP
UP defrag
UP defrag
UP defrag
22
Disk I/O:
- ext4 - raid0 и raid10 - mount options - dirty pages - SSD
23
Disk I/O:
24
Monitoring:
- db.serverStatus() - rs-indexes-consistency - indexes-miss-ratio - backgroundFlushing - heap_usage_bytes - connections - replication
25
mongostat --discover:
26
Collections qps:
27
Balancing:
- tags- sh.getBalancerState()- moveChunk
28
Mongos:
29
Mongos drop tcp cfg:
drop tcp
30
Mongos drop tcp shard:
drop tcp
31
Mongos fast fix:
drop tcp
-j REJECT --reject-with tcp-reset
32
Keepalived config:
33
Mongos RS down — ALL DOWN:
34
Summary:1) SERVER-70082) SERVER-90413) SERVER-1240