ç§ã¯ããªã³ã©ã€ã³ã²ãŒã ãéçºããã²ãŒã äŒç€Ÿã§åããŠããŸãã çŸåšãç§ãã¡ã®ã²ãŒã ã¯ãã¹ãŠå€ãã®ãåžå ŽãïŒåœããšã«1ã€ã®ãåžå ŽãïŒã«åå²ãããŠãããåãåžå Žãã«ã¯ãç»é²æã«ãã¬ãŒã€ãŒãåæ£ãããïŒãŸããæã«ã¯èªåã§éžæã§ããïŒäžçããããŸãã åäžçã«ã¯ã1ã€ã®ããŒã¿ããŒã¹ãš1ã€ä»¥äžã®Web /ã¢ããªãµãŒããŒããããŸãã ãããã£ãŠãè² è·ã¯äžç/ãµãŒããŒéã§ã»ãŒåçã«åå²ããã³åæ£ããããã®çµæã1ã€ã®äžçã®ããã©ã€ã ãæéããšã«6K-8Kãã¬ãŒã€ãŒã®æ倧ãªã³ã©ã€ã³ïŒãããæ倧ã§ãã»ãšãã©ã®å Žåæ°åå°ãªãïŒãš200-300ã®ãªã¯ãšã¹ããååŸããŸãã
ãã¬ãŒã€ãŒãåžå Žãšäžçã«åå²ãããã®ãããªæ§é ã¯æ代é ãã«ãªãã€ã€ããããã¬ãŒã€ãŒã¯ã°ããŒãã«ãªãã®ãæ±ããŠããŸãã æåŸã®ã²ãŒã ã§ã¯ãåœããšã«äººãåããã®ããããŠã1ã€ãŸãã¯2ã€ã®åžå ŽïŒã¢ã¡ãªã«ãšãšãŒãããïŒã ããæ®ããŸããããããããã«å€ãã®äžçããããŸããã 次ã®ã¹ãããã¯ãæ°ããã¢ãŒããã¯ãã£ãåããã²ãŒã ã®éçºãšã 1ã€ã®ããŒã¿ããŒã¹ã§1ã€ã®äžçã®ãã¹ãŠã®ãã¬ã€ã€ãŒãçµ±åããããšã§ãã
ä»æ¥ãç§ãã¡ã®äººæ°ã²ãŒã ã®ãªã³ã©ã€ã³å šäœïŒäžåºŠã«5äžãã20äžäººã®ãŠãŒã¶ãŒïŒãæ°ããã¢ãŒããã¯ãã£ã§æ§ç¯ããã次ã®ã²ãŒã ããã¬ã€ããããã«ãéä¿¡ããããã©ããã確èªããã¿ã¹ã¯ã«ã€ããŠãå°ãã話ããããã£ãã®ã§ããã·ã¹ãã å šäœãç¹ã«ããŒã¿ããŒã¹ïŒ PostgreSQL 11 ïŒã¯ããã®ãããªè² è·ã«å®éã«èããããšãã§ãããããããã§ããªãå Žåã¯ãæ倧å€ãèŠã€ããŸãã çºçããåé¡ãšãéåžžã«å€ãã®ãŠãŒã¶ãŒããã¹ãããããã®æºåãããã»ã¹èªäœãããã³çµæã«ã€ããŠå°ã説æããŸãã
ã€ã³ãã
éå»ã«ã¯ã InnoGames GmbHã§ãåã²ãŒã ããŒã ã¯å¥œã¿ãè²ã«åãããŠã²ãŒã ãããžã§ã¯ããäœæããå€ãã®å ŽåãããŸããŸãªãã¯ãããžãŒãããã°ã©ãã³ã°èšèªãããŒã¿ããŒã¹ã䜿çšããŠããŸããã ããã«ãæ¯æããããã·ã¥éç¥ã®éä¿¡ãããŒã±ãã£ã³ã°ãªã©ãæ åœããå€ãã®å€éšã·ã¹ãã ããããŸãã ãããã®ã·ã¹ãã ã䜿çšããããã«ãéçºè ã¯ç¬èªã®ã€ã³ã¿ãŒãã§ã€ã¹ãã§ããéãäœæããŸããã
çŸåšãã¢ãã€ã«ã²ãŒã ããžãã¹ã§ã¯å€é¡ã®ãéããããããã«å¿ããŠå€ãã®ç«¶äºããããŸãã ããã§ã¯ãããŒã±ãã£ã³ã°ã«è²»ãããåãã«ãšãã以äžã®éé¡ãããããåãæ»ãããšãéåžžã«éèŠã§ãããããã£ãŠããã¹ãŠã®ã²ãŒã äŒç€Ÿã¯ãåæã®æåŸ ãæºãããŠããªãå Žåãã¯ããŒãºããã¹ãã®æ®µéã§ãã²ãŒã ããã¯ããŒãºãããããšãéåžžã«å€ããããŸãã ãããã£ãŠã次ã®è»èŒªã®çºæã«æéãè²»ããããšã¯äžæ¡ç®ã§ããããããã¹ãŠã®å€éšã·ã¹ãã ãã¬ããªã±ãŒã·ã§ã³ãåããããŒã¿ããŒã¹ããã¹ãŠã®ãã¹ããã©ã¯ãã£ã¹ãšçµ±åããããã®ã¿ãŒã³ããŒãœãªã¥ãŒã·ã§ã³ãéçºè ã«æäŸããçµ±åãã©ãããã©ãŒã ãäœæããããšã決å®ãããŸããã éçºè ãå¿ èŠãšããã®ã¯ããã®äžã«è¯ãã²ãŒã ãéçºããŠã眮ããããšã§ãããã²ãŒã èªäœã«é¢ä¿ããªãéçºã«æéã浪費ããªãããšã§ãã
ãã®ãã©ãããã©ãŒã ã¯GameStarterãšåŒã°ããŸãïŒ
ã ããããã€ã³ãã«ã ä»åŸã®InnoGamesã²ãŒã ã¯ãã¹ãŠããã®ãã©ãããã©ãŒã äžã«æ§ç¯ãããŸãããã®ãã©ãããã©ãŒã ã«ã¯ããã¹ã¿ãŒãšã²ãŒã ã®2ã€ã®ããŒã¿ããŒã¹ããããŸãïŒPostgreSQL 11ïŒã ãã¹ã¿ãŒã¯ããã¬ãŒã€ãŒã«é¢ããåºæ¬æ å ±ïŒãã°ã€ã³ããã¹ã¯ãŒããªã©ïŒãä¿åããäž»ã«ã²ãŒã èªäœã®ãã°ã€ã³/ç»é²ã®ããã»ã¹ã§ã®ã¿åå ããŸãã ã²ãŒã -ã²ãŒã èªäœã®ããŒã¿ããŒã¹ãããã«å¿ããŠããã¹ãŠã®ã²ãŒã ããŒã¿ãšãšã³ãã£ãã£ãä¿åãããŸããããã¯ãããŒãå šäœãè¡ãããã²ãŒã ã®ã³ã¢ã§ãã
ãããã£ãŠããã®ãã¶ã€ã³å šäœããæã人æ°ã®ããã²ãŒã ã®æ倧ãªã³ã©ã€ã³ã«å¹æµããæœåšçãªãŠãŒã¶ãŒæ°ã«èãããããã©ãããšããçåãçããŸããã
ææŠãã
ã¿ã¹ã¯èªäœã¯æ¬¡ã®ãšããã§ãïŒã¬ããªã±ãŒã·ã§ã³ãæå¹ã«ãªã£ãŠããããŒã¿ããŒã¹ïŒPostgreSQL 11ïŒããæãè² è·ã®é«ãã²ãŒã ã§çŸåšæã£ãŠãããã¹ãŠã®è² è·ã«èããããšãã§ãããã©ããã確èªããPowerEdge M630ãã€ããŒãã€ã¶ãŒïŒHVïŒå šäœãèªç±ã«äœ¿ããŸãã
çŸæç¹ã§ã®ã¿ã¹ã¯ã¯ããã¹ããã©ã¯ãã£ã¹ãšç§ãã¡èªèº«ã®çµéšãèæ ®ããŠäœæããæ¢åã®ããŒã¿ããŒã¹æ§æã䜿çšããŠç¢ºèªããããšã ãã§ããããšãæ確ã«ããŸãã
ããŒã¿ããŒã¹ãããã«èšããšãããã€ãã®ç¹ãé€ããŠãã·ã¹ãã å šäœãããŸã衚瀺ãããŠããŸãã ãããããã®ç¹å®ã®ã²ãŒã ãããžã§ã¯ãã¯ãããã¿ã€ã段éã§ãããå°æ¥ãã²ãŒã ã¡ã«ãã¯ã¹ã®è€éåã«ãããããŒã¿ããŒã¹ãžã®ãªã¯ãšã¹ãã¯ããè€éã«ãªããè² è·èªäœãå€§å¹ ã«å¢å ãããã®æ§è³ªãå€ããå¯èœæ§ããããŸãã ãããé²ãã«ã¯ãå€ããå°ãªããéèŠãªãã€ã«ã¹ããŒã³ããšã«ãããžã§ã¯ããç¹°ãè¿ããã¹ãããå¿ èŠããããŸãã ãã®çš®ã®ãã¹ããæ°åäžäººã®ãŠãŒã¶ãŒã§å®è¡ããæ©èœãèªååããããšãããã®æ®µéã®äž»ãªã¿ã¹ã¯ã«ãªããŸããã
ãããã£ãŒã«
è² è·ãã¹ããšåæ§ã«ããã¹ãŠè² è·ãããã¡ã€ã«ããå§ãŸããŸãã
æœåšçãªå€CCU60ïŒCCUã¯ç¹å®ã®æéããã®å Žåã¯60åéã®æ倧ãŠãŒã¶ãŒæ°ïŒã¯250,000ãŠãŒã¶ãŒãšèŠãªãããŸãã 競äºåã®ããä»®æ³ãŠãŒã¶ãŒïŒVUïŒã®æ°ã¯CCU60ãããå°ãªããã¢ããªã¹ãã¯å®å šã«2ã€ã«åå²ã§ããããšã瀺åããŠããŸãã 150,000ã®ç«¶åVUãåãäžããŠåãå ¥ããŸãã
1ç§ãããã®ãªã¯ãšã¹ãã®ç·æ°ã¯ãããŒãããã1ã€ã®ã²ãŒã ããååŸãããŸããã
ãããã£ãŠãç®æšè² è·ã¯150,000 VUã§æ倧20,000ãªã¯ãšã¹ã/ç§ã§ãã
æ§é
ãã¹ã¿ã³ããã®ç¹åŸŽ
ååã®èšäºã§ãè² è·ãã¹ãã®ããã»ã¹å šäœã®èªååã«ã€ããŠæ¢ã«èª¬æããŸããã ããã«ãå°ãç¹°ãè¿ããŸãããããã€ãã®ãã€ã³ãã«ã€ããŠè©³ãã説æããŸãã
å³ã§ã¯ãéãåè§ããã€ããŒãã€ã¶ãŒïŒHVïŒã§ãããå€æ°ã®ãµãŒããŒïŒDell M620-M640ïŒã§æ§æãããã¯ã©ãŠãã§ãã åHVã§ãKVMãä»ããŠå€æ°ã®ä»®æ³ãã·ã³ïŒVMïŒãèµ·åãããŸãïŒweb / appããã³dbãæ··åšïŒã æ°ããVMãäœæãããšãé©åãªHVã®ãã©ã¡ãŒã¿ãŒã»ããã®ãã©ã³ã¹èª¿æŽãšæ€çŽ¢ãè¡ãããæåã«ã©ã®ãµãŒããŒã«æ¥ç¶ããããäžæã§ãã
ããŒã¿ããŒã¹ïŒã²ãŒã DBïŒïŒ
ããããdb1ã®ç®çã®ããã«ã M630ã«åºã¥ããŠå¥ã®HV targer_hypervisorãäºçŽããŸããã
targer_hypervisorã®ç°¡åãªç¹åŸŽïŒ
ãã«M_630
ã¢ãã«åïŒIntel®Xeon®CPU E5-2680 v3 @ 2.50GHz
CPUïŒsïŒïŒ48
ã³ã¢ãããã®ã¹ã¬ããïŒ2
ãœã±ãããããã®ã³ã¢ïŒ12
ãœã±ããïŒ2
RAMïŒ128 GB
Debian GNU / Linux 9ïŒã¹ãã¬ããïŒ
4.9.0-8-amd64ïŒ1 SMP Debian 4.9.130-2ïŒ2018-10-27ïŒ
詳现ä»æ§
Debian GNU / Linux 9ïŒã¹ãã¬ããïŒ
4.9.0-8-amd64ïŒ1 SMP Debian 4.9.130-2ïŒ2018-10-27ïŒ
lscpu
ã¢ãŒããã¯ãã£ïŒx86_64
CPU op-modeïŒsïŒïŒ32ãããã64ããã
ãã€ãé ïŒãªãã«ãšã³ãã£ã¢ã³
CPUïŒç§ïŒïŒ48
ãªã³ã©ã€ã³CPUïŒsïŒãªã¹ãïŒ0-47
ã³ã¢ãããã®ã¹ã¬ããïŒ2
ãœã±ãããããã®ã³ã¢ïŒ12
ãœã±ããïŒ2
NUMAããŒãïŒ2
ãã³ããŒIDïŒGenuineIntel
CPUãã¡ããªãŒïŒ6
ã¢ãã«ïŒ63
ã¢ãã«åïŒIntel®Xeon®CPU E5-2680 v3 @ 2.50GHz
ã¹ãããã³ã°ïŒ2
CPU MHzïŒ1309.356
CPUæ倧MHzïŒ3300.0000
CPUæå°MHzïŒ1200.0000
BogoMIPSïŒ4988.42
ä»®æ³åïŒVT-x
L1dãã£ãã·ã¥ïŒ32K
L1iãã£ãã·ã¥ïŒ32K
L2ãã£ãã·ã¥ïŒ256K
L3ãã£ãã·ã¥ïŒ30720K
NUMA node0 CPUïŒsïŒïŒ0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42 44.46
NUMA node1 CPUïŒsïŒïŒ1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43 ã45.47
ãã©ã°ïŒfpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lpcpqpqpcpc bpcpc bpcpc bpcpc bpcpc bppc bppc SMX EST TM2 SSSE3 SDBG FMA cx16 xtpr PDCM PCID DCA sse4_1 sse4_2 x2apicã«MOVBE POPCNT tsc_deadline_timer AES xsave AVX f16c rdrand lahf_lm ABM EPB invpcid_single SSBD IBRS ibpb stibpã«ã€ã¶ãŒtpr_shadow vnmi flexpriority EPT VPID fsgsbase tsc_adjust BMI1 AVX2 SMEP bmi2 ERMS invpcid CQM xsaveopt cqm_llc cqm_occup_llc dtherm IDA arat pln pts flush_l1d
/ usr / bin / qemu-system-x86_64 --version
QEMUãšãã¥ã¬ãŒã¿ãŒããŒãžã§ã³2.8.1ïŒDebian 1ïŒ2.8 + dfsg-6 + deb9u5ïŒ
Copyright©2003-2016 Fabrice Bellardããã³QEMUãããžã§ã¯ãéçºè
4.9.0-8-amd64ïŒ1 SMP Debian 4.9.130-2ïŒ2018-10-27ïŒ
lscpu
ã¢ãŒããã¯ãã£ïŒx86_64
CPU op-modeïŒsïŒïŒ32ãããã64ããã
ãã€ãé ïŒãªãã«ãšã³ãã£ã¢ã³
CPUïŒç§ïŒïŒ48
ãªã³ã©ã€ã³CPUïŒsïŒãªã¹ãïŒ0-47
ã³ã¢ãããã®ã¹ã¬ããïŒ2
ãœã±ãããããã®ã³ã¢ïŒ12
ãœã±ããïŒ2
NUMAããŒãïŒ2
ãã³ããŒIDïŒGenuineIntel
CPUãã¡ããªãŒïŒ6
ã¢ãã«ïŒ63
ã¢ãã«åïŒIntel®Xeon®CPU E5-2680 v3 @ 2.50GHz
ã¹ãããã³ã°ïŒ2
CPU MHzïŒ1309.356
CPUæ倧MHzïŒ3300.0000
CPUæå°MHzïŒ1200.0000
BogoMIPSïŒ4988.42
ä»®æ³åïŒVT-x
L1dãã£ãã·ã¥ïŒ32K
L1iãã£ãã·ã¥ïŒ32K
L2ãã£ãã·ã¥ïŒ256K
L3ãã£ãã·ã¥ïŒ30720K
NUMA node0 CPUïŒsïŒïŒ0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42 44.46
NUMA node1 CPUïŒsïŒïŒ1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43 ã45.47
ãã©ã°ïŒfpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lpcpqpqpcpc bpcpc bpcpc bpcpc bpcpc bppc bppc SMX EST TM2 SSSE3 SDBG FMA cx16 xtpr PDCM PCID DCA sse4_1 sse4_2 x2apicã«MOVBE POPCNT tsc_deadline_timer AES xsave AVX f16c rdrand lahf_lm ABM EPB invpcid_single SSBD IBRS ibpb stibpã«ã€ã¶ãŒtpr_shadow vnmi flexpriority EPT VPID fsgsbase tsc_adjust BMI1 AVX2 SMEP bmi2 ERMS invpcid CQM xsaveopt cqm_llc cqm_occup_llc dtherm IDA arat pln pts flush_l1d
/ usr / bin / qemu-system-x86_64 --version
QEMUãšãã¥ã¬ãŒã¿ãŒããŒãžã§ã³2.8.1ïŒDebian 1ïŒ2.8 + dfsg-6 + deb9u5ïŒ
Copyright©2003-2016 Fabrice Bellardããã³QEMUãããžã§ã¯ãéçºè
db1ã®ç°¡åãªç¹åŸŽïŒ
ã¢ãŒããã¯ãã£ïŒx86_64
CPUïŒsïŒïŒ48
RAMïŒ64 GB
4.9.0-8-amd64ïŒ1 SMP Debian 4.9.144-3.1ïŒ2019-02-19ïŒx86_64 GNU / Linux
Debian GNU / Linux 9ïŒã¹ãã¬ããïŒ
psqlïŒPostgreSQLïŒ11.2ïŒDebian 11.2-1.pgdg90 + 1ïŒ
ããã€ãã®èª¬æä»ãã®PostgreSQLèšå®
seq_page_cost = 1.0
random_page_cost = 1.1ïŒSSDããããŸã
ã/etc/postgresql/11/main/extension.confããå«ãã
log_line_prefix = 'ïŒ t [ïŒ p-ïŒ l]ïŒ qïŒ u @ïŒ h'
log_checkpoints = on
log_lock_waits = on
log_statement = ddl
log_min_duration_statement = 100
log_temp_files = 0
autovacuum_max_workers = 5
autovacuum_naptime = 10s
autovacuum_vacuum_cost_delay = 20ms
vacuum_cost_limit = 2000
maintenance_work_mem = 128MB
synchronous_commit = off
checkpoint_timeout = 30å
listen_addresses = '*'
work_mem = 32MB
effective_cache_size = 26214MBïŒå©çšå¯èœãªã¡ã¢ãªã®50ïŒ
shared_buffers = 16384MBïŒäœ¿çšå¯èœãªã¡ã¢ãªã®25ïŒ
max_wal_size = 15GB
min_wal_size = 80MB
wal_level = hot_standby
max_wal_senders = 10
wal_compression = on
archive_mode = on
archive_command = '/ bin / true'
archive_timeout = 1800
hot_standby = on
wal_log_hints = on
hot_standby_feedback = on
random_page_cost = 1.1ïŒSSDããããŸã
ã/etc/postgresql/11/main/extension.confããå«ãã
log_line_prefix = 'ïŒ t [ïŒ p-ïŒ l]ïŒ qïŒ u @ïŒ h'
log_checkpoints = on
log_lock_waits = on
log_statement = ddl
log_min_duration_statement = 100
log_temp_files = 0
autovacuum_max_workers = 5
autovacuum_naptime = 10s
autovacuum_vacuum_cost_delay = 20ms
vacuum_cost_limit = 2000
maintenance_work_mem = 128MB
synchronous_commit = off
checkpoint_timeout = 30å
listen_addresses = '*'
work_mem = 32MB
effective_cache_size = 26214MBïŒå©çšå¯èœãªã¡ã¢ãªã®50ïŒ
shared_buffers = 16384MBïŒäœ¿çšå¯èœãªã¡ã¢ãªã®25ïŒ
max_wal_size = 15GB
min_wal_size = 80MB
wal_level = hot_standby
max_wal_senders = 10
wal_compression = on
archive_mode = on
archive_command = '/ bin / true'
archive_timeout = 1800
hot_standby = on
wal_log_hints = on
hot_standby_feedback = on
hot_standby_feedbackã¯ããã©ã«ãã§ãªãã«ãªã£ãŠããããªã³ã«ããŸãããããã¹ããæåãããã«ã¯ãªãã«ããå¿ èŠããããŸããã çç±ã¯åŸã§èª¬æããŸãã
ããŒã¿ããŒã¹ã®äž»èŠãªã¢ã¯ãã£ãããŒãã«ïŒconstructionãproductionãgame_entityãbuildingãcore_inventory_player_resourceãsurvivorïŒã«ã¯ãbashã¹ã¯ãªããã䜿çšããŠããŒã¿ïŒçŽ80GBïŒãäºåã«å ¥åãããŠããŸãã
db-fill-script.sh
#!/bin/bash --clean TRUNCATE TABLE production CASCADE; TRUNCATE TABLE construction CASCADE; TRUNCATE TABLE building CASCADE; TRUNCATE TABLE grid CASCADE; TRUNCATE TABLE core_inventory_player_resource CASCADE; TRUNCATE TABLE survivor CASCADE; TRUNCATE TABLE city CASCADE; TRUNCATE TABLE game_entity CASCADE; TRUNCATE TABLE player CASCADE; TRUNCATE TABLE core_player CASCADE; TRUNCATE TABLE core_client_device CASCADE; --core_client_device INSERT INTO core_client_device (id, creation_date, modification_date, device_model, device_name, locale, platform, user_agent, os_type, os_version, network_type, device_type) SELECT (1000000000+generate_series(0,999999)) AS id, now(), now(), 'device model', 'device name', 'en_DK', 'ios', 'ios user agent', 'android', '8.1', 'wlan', 'browser'; --core_player INSERT INTO core_player (id, guest, name, nickname, premium_points, soft_deleted, session_id, tracking_device_data_id) SELECT (1000000000+generate_series(0,999999)) AS id, true, 'guest0000000000000000000', null, 100, false, '00000000-0000-0000-0000-000000000000', (1000000000+generate_series(0,999999)) ; --player INSERT INTO player (id, creation_date, modification_date, core_player_id) SELECT (1000000000+generate_series(0,999999)) , now(), now(), (1000000000+generate_series(0,999999)) ; --city INSERT INTO game_entity (id, type, creation_date, modification_date) SELECT (1000000000+generate_series(0,999999)) , 'city', now(), now(); INSERT INTO city (id, game_design, player_id) SELECT (1000000000+generate_series(0,999999)) , 'city.default', (1000000000+generate_series(0,999999)) ; --survivor INSERT INTO game_entity (id, type, creation_date, modification_date) SELECT (1001000000+generate_series(0,999999)) , 'survivor', now(), now(); INSERT INTO survivor (id, game_design, owning_entity_id, type) SELECT (1001000000+generate_series(0,999999)) , 'survivor.prod_1', (1000000000+generate_series(0,999999)) , 'survivor'; --core_inventory_player_resource INSERT INTO core_inventory_player_resource (id, creation_date, modification_date, amount, player_id, resource_key) SELECT (1000000000+generate_series(0,1999999)) , NOW(), NOW(), 1000, (1000000000+generate_series(0,1999999)/2) , CONCAT('resource_', (1000000000+generate_series(0,1999999)) % 2); --grid DROP INDEX grid_area_idx; INSERT INTO grid (id, creation_date, modification_date, area, city_id) SELECT (1000000000+generate_series(0,19999999)) , NOW(), NOW(), BOX '0,0,4,4', (1000000000+generate_series(0,19999999)/20) ; create index on grid using gist (area box_ops); --building INSERT INTO game_entity (id, type, creation_date, modification_date) SELECT (1002000000+generate_series(0,99999999)) , 'building', now(), now(); INSERT INTO building (id, game_design, owning_entity_id, x, y, rotation, type) SELECT (1002000000+generate_series(0,99999999)) , 'building.building_prod_1', (1000000000+generate_series(0,99999999)/100) , 0, 0, 'DEGREES_0', 'building'; --construction INSERT INTO construction (id, creation_date, modification_date, definition, entity_id, start) SELECT (1000000000+generate_series(0,1999999)) , NOW(), NOW(), 'construction.building_prod_1-construction', (1002000000+generate_series(0,1999999)*50) , NOW(); --production INSERT INTO production (id, creation_date, modification_date, active, definition, entity_id, start_time) SELECT (1000000000+generate_series(0,49999999)) , NOW(), NOW(), true, 'production.building_prod_1_production_1', (1002000000+generate_series(0,49999999)*2) , NOW();
è€è£œïŒ
SELECT * FROM pg_stat_replication; pid | usesysid | usename | application_name | client_addr | client_hostname | client_port | backend_start | backend_xmin | state | sent_lsn | write_lsn | flush_lsn | replay_lsn | write_lag | flush_lag | replay_lag | sync_priority | sync_state -----+----------+---------+---------------------+--------------+---------------------+-------------+-------------------------------+--------------+-----------+------------+------------+------------+------------+-----------------+-----------------+-----------------+---------------+------------ 759 | 17035 | repmgr | xl1db2 | xxxx | xl1db2 | 51142 | 2019-01-27 08:56:44.581758+00 | | streaming | 18/424A9F0 | 18/424A9F0 | 18/424A9F0 | 18/424A9F0 | 00:00:00.000393 | 00:00:00.001159 | 00:00:00.001313 | 0 | async 977 | 17035 | repmgr | xl1db3 |xxxxx | xl1db3 | 42888 | 2019-01-27 08:57:03.232969+00 | | streaming | 18/424A9F0 | 18/424A9F0 | 18/424A9F0 | 18/424A9F0 | 00:00:00.000373 | 00:00:00.000798 | 00:00:00.000919 | 0 | async
ã¢ããªã±ãŒã·ã§ã³ãµãŒããŒ
次ã«ãããŸããŸãªæ§æãšå®¹éã®çç£æ§ã®é«ãHVïŒprod_hypervisorsïŒã§ã15åã®ã¢ããªãµãŒããŒïŒ8ã³ã¢ã4GBïŒãèµ·åãããŸããã äž»ã«èšããããšã¯ãopenjdk 11.0.1 2018-10-16ãæ¥ã hikari ïŒhikari.maximum-pool-sizeïŒ50ïŒãä»ããããŒã¿ããŒã¹ãšã®çžäºäœçšã§ã
ã¹ãã¬ã¹ãã¹ãç°å¢
è² è·ãã¹ãç°å¢å šäœã¯ã1ã€ã®ã¡ã€ã³ãµãŒããŒadmin.loadtestãšè€æ°ã®generatorN.loadtestãµãŒããŒã§æ§æãããŠããŸãïŒãã®å Žåã¯14åãããŸããïŒã
generatorN.loadtest- ã裞ã®ãVM Debian Linux 9ãJava 8ãã€ã³ã¹ããŒã«æžã¿ã32ã«ãŒãã«/ 32ã®ã¬ã éèŠãªVMã®ããã©ãŒãã³ã¹ã誀ã£ãŠæ®ºããªãããã«ãéçç£çãªHVã«é 眮ãããŠããŸãã
admin.loadtest -Debian Linux 9 ä»®æ³ãã·ã³ ã16ã³ã¢/ 16ã®ã°ãJenkinsãJLTCãããã³ãã®ä»ã®éèŠã§ãªãè¿œå ãœãããŠã§ã¢ãåäœããŸãã
JLTC- jmeterè² è·ãã¹ãã»ã³ã¿ãŒ ã ãã¹ãã®èµ·åãšçµæã®åæãå¶åŸ¡ããã³èªååããPy / Djangoã®ã·ã¹ãã ã
ãã¹ãèµ·åã¹ããŒã
ãã¹ããå®è¡ããããã»ã¹ã¯æ¬¡ã®ããã«ãªããŸãã
- ãã¹ãã¯Jenkinsããéå§ãããŸãã å¿
èŠãªãžã§ããéžæããŠãããç®çã®ãã¹ããã©ã¡ãŒã¿ãŒãå
¥åããå¿
èŠããããŸãã
- DURATION-ãã¹ãæé
- RAMPUP- ããŠã©ãŒã ã¢ãããæé
- THREAD_COUNT_TOTAL-ä»®æ³ãŠãŒã¶ãŒïŒVUïŒãŸãã¯ã¹ã¬ããã®åžææ°
- TARGET_RESPONSE_TIMEã¯éèŠãªãã©ã¡ãŒã¿ãŒã§ããããã«ãããã·ã¹ãã å šäœãéè² è·ã«ãªããªãããã«ãåžæããå¿çæéãèšå®ããŸãããããã£ãŠããã¹ãã§ã¯ãã·ã¹ãã å šäœã®å¿çæéãæå®ãããæéãè¶ ããªãã¬ãã«ã§è² è·ãç¶æããŸãã
- æã¡äžã
- Jenkinsã¯Gitlabãããã¹ãèšç»ãè€è£œããJLTCã«éä¿¡ããŸãã
- JLTCã¯ããã¹ãèšç»ã§å°ãåäœããŸãïŒããšãã°ãCSVã·ã³ãã«ã©ã€ã¿ãŒãæ¿å ¥ããŸãïŒã
- JLTCã¯ãå¿ èŠãªæ°ã®VUïŒTHREAD_COUNT_TOTALïŒãå®è¡ããããã«å¿ èŠãªJmeterãµãŒããŒã®æ°ãèšç®ããŸãã
- JLTCã¯åloadgeneratorNãžã§ãã¬ãŒã¿ãŒã«æ¥ç¶ããjmeterãµãŒããŒãèµ·åããŸãã
ãã¹ãäžã«ã JMeterã¯ã©ã€ã¢ã³ãã¯çµæãå«ãCSVãã¡ã€ã«ãçæããŸãã ãã®ããããã¹ãäžã«ããŒã¿ã®éãšãã®ãã¡ã€ã«ã®ãµã€ãºã¯éæ¹ããªãããŒã¹ã§å¢å ãããã¹ãåŸã®åæã«ã¯äœ¿çšã§ããŸãã-Daemonã ïŒå®éšãšããŠïŒçºæããã ããªã³ã¶ãã©ã€ãã§è§£æãããŸãã
ãã¹ãèšç»
ãããããã¹ãèšç»ãããŠã³ããŒãã§ããŸãã
ç»é²/ãã°ã€ã³åŸããŠãŒã¶ãŒã¯ç¹å®ã®ã²ãŒã æ©èœã®ç¢ºçãæå®ããè€æ°ã®ã¹ã«ãŒãããã³ã³ãããŒã©ãŒã§æ§æãããåäœã¢ãžã¥ãŒã«ã§äœæ¥ããŸãã åã¹ã«ãŒãããã³ã³ãããŒã©ãŒã«ã¯ãæ©èœãå®è£ ãã察å¿ããã¢ãžã¥ãŒã«ãåç §ããã¢ãžã¥ãŒã«ã³ã³ãããŒã©ãŒããããŸãã
ãªããããã¯
ã¹ã¯ãªããã®éçºäžã«ãGroovyãæ倧éã«æŽ»çšããããšããŸããããJavaããã°ã©ãã®ãããã§ãèªåèªèº«ã«ããã€ãã®ããªãã¯ãçºèŠããŸããïŒèª°ãã«åœ¹ç«ã€ãããããŸããïŒã
- ãã¹ãèšç»ã®æåã®ã©ããã§é¢æ°ã宣èšãããããä»ã®ããªããã»ããµããã¹ãããã»ããµãããã³ãµã³ãã©ãŒã§äœ¿çšã§ããŸãã Groovyã®è¯ãïŒã¡ãœãããã¯ããŒãžã£ãŒã«å€ãã ïŒ
// - def sum(Integer x, Integer y) { return x + y } vars.putObject('sum', this.&sum) // closure. . // sampler` def sum= vars.getObject('sum'); println sum(2, 2);
- groovy.json.JsonSlurperã¯åªããé«éJSONããŒãµãŒã§ãã groovyãšãšãã«ãããŒã¿ããšã¬ã¬ã³ãã«è§£æããŠåŠçããããšãã§ããŸãã
import groovy.json.JsonSlurper def canBuild = vars.getObject(canBuild); // "" def content = jsonSlurper.parseText(response).content def buildings = content[0].buildings // // def constructableBuildingDefs = buildings .collect { k,v -> v } .grep{ it.definitions .grep { it2 -> it2['@type'] == 'type.googleapis.com/ConstructionDefinitionDTO'} .grep { it2 -> canBuild(it2) } // .size() > 0 } if (!constructableBuildingDefs) { return; } Collections.shuffle(constructableBuildingDefs) //
VU /ã¹ã¬ãã
Jenkinsãžã§ããæ§æãããšãã«ããŠãŒã¶ãŒãTHREAD_COUNT_TOTALãã©ã¡ãŒã¿ãŒã䜿çšããŠå¿ èŠãªæ°ã®VUãå ¥åãããšãäœããã®æ¹æ³ã§å¿ èŠãªæ°ã®JmeterãµãŒããŒãèµ·åãããããã®éã§æçµçãªæ°ã®VUãåé ããå¿ èŠããããŸãã ãã®éšåã¯ã controller / provisionãšåŒã°ããéšåã®JLTCã«ãããŸãã
åºæ¬çã«ãã¢ã«ãŽãªãºã ã¯æ¬¡ã®ãšããã§ãã
- å¿ èŠãªæ°ã®VU threads_numã200-300ã¹ã¬ããã«åå²ããé©åãªãµã€ãº-Xmsm -Xmxmã«åºã¥ããŠã1ã€ã®jmeter-server required_memory_for_jri ïŒJRI-Jmeter-serverã®ä»£ããã«Jmeterãªã¢ãŒãã€ã³ã¹ã¿ã³ã¹ãåŒã³åºããŸãïŒã«å¿ èŠãªã¡ã¢ãªå€ã決å®ããŸãã
- threads_numãšrequired_memory_for_jriãããjmeter-serverã®åèšæ°ïŒ target_amount_jriãšå¿ èŠãªã¡ã¢ãªã®åèšå€ïŒrequired_memory_totalãèŠã€ããŸãã
- ãã¹ãŠã®loadgeneratorNãžã§ãã¬ãŒã¿ãŒã1ã€ãã€ãœãŒããã䜿çšå¯èœãªã¡ã¢ãªã«åºã¥ããŠæ倧æ°ã®jmeterãµãŒããŒãéå§ããŸãã å®è¡äžã®current_amount_jriã€ã³ã¹ã¿ã³ã¹ã®æ°ãtarget_amount_jri ãšçãããªããŸã§ ã
- ïŒãžã§ãã¬ãŒã¿ãŒãšåèšã¡ã¢ãªãŒã®æ°ãååã§ãªãå Žåã¯ãæ°ãããã®ãããŒã«ã«è¿œå ããŸãïŒ
- åãžã§ãã¬ãŒã¿ãŒã«æ¥ç¶ãã netstatã䜿çšããŠãã¹ãŠã®ããžãŒããŒããèšæ¶ããå¿
èŠãªæ°ã®jmeterãµãŒããŒãã©ã³ãã ããŒãïŒç©ºããŠããããŒãïŒã§å®è¡ããŸãã
netstat_cmd= 'netstat -tulpn | grep LISTEN' stdin, stdout, stderr = ssh.exec_command(cmd1) used_ports = [] netstat_output = str(stdout.readlines()) ports = re.findall('\d+\.\d+\.\d+\.\d+\:(\d+)', netstat_output) ports_ipv6 = re.findall('\:\:\:(\d+)', netstat_output) p.wait() for port in ports: used_ports.append(int(port)) for port in ports_ipv6: used_ports.append(int(port)) ssh.close() for i in range(1, possible_jris_on_host + 1): port = int(random.randint(10000, 20000)) while port in used_ports: port = int(random.randint(10000, 20000)) # ... Jmeter-
- å®è¡äžã®ãã¹ãŠã®jmeter-serverããã©ãŒãããã¢ãã¬ã¹ã§äžåºŠã«åéããŸãïŒportãããšãã°generator13ïŒ15576ãgenerator9ïŒ14015ãgenerator11ïŒ19152ãgenerator14ïŒ12125ãgenerator2ïŒ17602
- çµæã®ãªã¹ããšthreads_per_hostã¯ããã¹ãã®éå§æã«JMeterã¯ã©ã€ã¢ã³ãã«éä¿¡ãããŸãã
REMOTE_TESTING_FLAG=" -R $REMOTE_HOSTS_STRING" java -jar -Xms7g -Xmx7g -Xss228k $JMETER_DIR/bin/ApacheJMeter.jar -Jserver.rmi.ssl.disable=true -n -t $TEST_PLAN -j $WORKSPACE/loadtest.log -GTHREAD_COUNT=$THREADS_PER_HOST $OTHER_VARS $REMOTE_TESTING_FLAG -Jjmeter.save.saveservice.default_delimiter=,
ç§ãã¡ã®å Žåããã¹ãã¯300ã®JmeterãµãŒããŒããããã500ã¹ã¬ããããåæã«è¡ãããJavaãã©ã¡ãŒã¿ãŒã䜿çšãã1ã€ã®JmeterãµãŒããŒã®èµ·å圢åŒã¯æ¬¡ã®ããã«ãªããŸããã
nohup java -server -Xms1200m -Xmx1200m -Xss228k -XX:+DisableExplicitGC -XX:+CMSClassUnloadingEnabled -XX:+UseCMSInitiatingOccupancyOnly -XX:CMSInitiatingOccupancyFraction=70 -XX:+ScavengeBeforeFullGC -XX:+CMSScavengeBeforeRemark -XX:+UseConcMarkSweepGC -XX:+CMSParallelRemarkEnabled -Djava.net.preferIPv6Addresses=true -Djava.net.preferIPv4Stack=false -jar "/tmp/jmeter-JwKse5nY/bin/ApacheJMeter.jar" -Jserver.rmi.ssl.disable=true "-Djava.rmi.server.hostname=generator12.loadtest.ig.local" -Duser.dir=/tmp/jmeter-JwKse5nY/bin/ -Dserver_port=13114 -s -Jpoll=49 > /dev/null 2>&1
50ms
ã¿ã¹ã¯ã¯ãããŒã¿ããŒã¹ãšã·ã¹ãã å šäœãã¯ãªãã£ã«ã«ãªç¶æ ã«éè² è·ã«ããã®ã§ã¯ãªããããŒã¿ããŒã¹ãã©ãã ãèããããããå€æããããšã§ãã éåžžã«å€ãã®JmeterãµãŒããŒã§ã¯ãäœããã®æ¹æ³ã§è² è·ãç¹å®ã®ã¬ãã«ã«ç¶æããã·ã¹ãã å šäœã匷å¶çµäºããå¿ èŠã¯ãããŸããã ãã¹ãã®éå§æã«æå®ãããTARGET_RESPONSE_TIMEãã©ã¡ãŒã¿ãŒããããæ åœããŸãã ã·ã¹ãã ã責任ãè² ãã¹ãæé©ãªå¿çæéã¯50ããªç§ã§ããããšã«åæããŸããã
JMeterã«ã¯ãããã©ã«ãã§ã¹ã«ãŒããããå¶åŸ¡ã§ããããŸããŸãªã¿ã€ããŒããããŸããããã®ã±ãŒã¹ã§ã¯ã©ãã§å ¥æã§ãããã¯ããããŸããã ãããã çŸåšã®ã·ã¹ãã å¿çæéã䜿çšããŠäœããæãä»ãããšãã§ããJSR223-TimerããããŸãã ã¿ã€ããŒèªäœã¯ã¡ã€ã³ã®Behaviorãããã¯ã«ãããŸãïŒ
// = 0 vars.put('samples', '20'); vars.putObject('respAvg', ${TARGET_RESPONSE_TIME}.0); vars.putObject('sleep', 0.0); // JSR223-Timer "" double sleep = vars.getObject('sleep'); double respAvg = vars.getObject('respAvg'); double previous = sleep; double target = ${TARGET_RESPONSE_TIME}; if (respAvg < target) { sleep /= 1.5; } if (respAvg > target) { sleep *= 1.1; } sleep = Math.max(10, sleep); // sleep = Math.min(20000, sleep); vars.putObject('sleep', sleep); return (int)sleep;
çµæã®åæïŒããŒã¢ã³ïŒ
Grafanaã®ã°ã©ãã«å ããŠããã¹ããéçŽããŠJLTCã§ãã¹ããæ¯èŒã§ããããã«ããå¿ èŠããããŸãã
ãã®ãããªãã¹ãã®1ã€ã¯1ç§ããã16kãã20kã®èŠæ±ãçæãã4æéã§æ°çŸGBã®ãµã€ãºã®CSVãã¡ã€ã«ãçæããããšã¯ç°¡åã«èšç®ã§ãããããæ¯åããŒã¿ã解æããããŒã¿ããŒã¹ã«éä¿¡ããŠã¡ã€ã³ãã¡ã€ã«ãæ¶å»ãããžã§ããèãåºãå¿ èŠããããŸããã
ã¢ã«ãŽãªãºã ã¯æ¬¡ã®ãšããã§ãã
- jmeter-clientã«ãã£ãŠçæãããCSVãã¡ã€ã«result.jtlããããŒã¿ãèªã¿åãããã¡ã€ã«ãèŠããŠã¯ãªãŒãã³ã°ããŸãïŒæ£ããã¯ãªãŒãã³ã°ããå¿
èŠããããŸããããããªããšã空ã®ãã¡ã€ã«ã¯åããµã€ãºã®åãFDã«ãªããŸãïŒã
with open(jmeter_results_file, 'r+') as f: rows = f.readlines() f.seek(0) f.truncate(0) f.writelines(rows[-1])
- èªã¿åãããŒã¿ãäžæãã¡ã€ã«temp_result.jtlã«æžã蟌ã¿ãŸãã
rows_num = len(rows) open(temp_result_filename, 'w').writelines(rows[0:rows_num]) # avoid last line
- ãã¡ã€ã«temp_result.jtlãèªã¿åããŸãã èªã¿åãããŒã¿ããæ°åã§ãé
åžããŸãã
for r in f.readlines(): row = r.split(',') if len(row[0]) == 13: ts_c = int(row[0]) dt_c = datetime.datetime.fromtimestamp(ts_c/1000) minutes_data.setdefault(dt_c.strftime('%Y_%m_%d_%H_%M'), []).append(r)
- minutes_dataããã®ååã®ããŒã¿ã¯ã to_parse /ãã©ã«ããŒå
ã®å¯Ÿå¿ãããã¡ã€ã«ã«æžã蟌ãŸããŸãã ïŒãããã£ãŠãçŸæç¹ã§ã¯ããã¹ãã®1åããšã«ç¬èªã®ããŒã¿ãã¡ã€ã«ããããéçŽäžã«åãã¡ã€ã«ã«ããŒã¿ãå
¥ã£ãé çªã¯é¢ä¿ãããŸããïŒïŒ
for key, value in minutes_data.iteritems(): # timestamp (key) temp_ts_file = os.path.join(temp_to_parse_path, key) open(temp_ts_file, 'a+').writelines(value)
- éäžã§ãto_parseãã©ã«ããŒå
ã®ãã¡ã€ã«ãåæãããããã®ããããã1å以å
ã«å€æŽãããªãã£ãå Žåããã®ãã¡ã€ã«ã¯ããŒã¿åæãéçŽãããã³JLTCããŒã¿ããŒã¹ãžã®éä¿¡ã®åè£ã«ãªããŸãã
for filename in os.listdir(temp_to_parse_path): data_file = os.path.join(temp_to_parse_path, filename) file_mod_time = os.stat(data_file).st_mtime last_time = (time.time() - file_mod_time) if last_time > 60: logger.info('[DAEMON] File {} was not modified since 1min, adding to parse list.'.format(data_file)) files_to_parse.append(data_file)
- ãã®ãããªãã¡ã€ã«ïŒ1ã€ãŸãã¯è€æ°ïŒãããå Žåã¯ã解æããããã¡ã€ã«ãparse_csv_dataé¢æ°ã«éä¿¡ããŸãïŒåãã¡ã€ã«ã䞊åã«å®è¡ããŸãïŒã
for f in files_to_parse: logger.info('[DAEMON THREAD] Parse {}.'.format(f)) t = threading.Thread( target=parse_csv_data, args=( f, jmeter_results_file_fields, test, data_resolution)) t.start() threads.append(t) for t in threads: t.join()
cron.då ã®ããŒã¢ã³èªäœã¯æ¯åéå§ãããŸãã
ããŒã¢ã³ã¯æ¯åcron.dã§éå§ããŸãã
* * * * * root sleep 21 && /usr/bin/python /var/lib/jltc/manage.py daemon
ãããã£ãŠãçµæãå«ããã¡ã€ã«ã¯æ³åãè¶ ãããµã€ãºã«èšããããšã¯ãããŸãããããã®å Žã§åæãããã¯ãªã¢ãããŸãã
çµæ
ã¢ããª
150,000ã®ä»®æ³ãã¬ãŒã€ãŒïŒ
ãã®ãã¹ãã§ã¯ãå¿çæéã50ããªç§ã«ãäžèŽãããããšãããããè² è·èªäœã¯16kã18kãªã¯ãšã¹ã/ cã®éã®é åã§çµ¶ãããžã£ã³ãããŸãã
ã¢ããªã±ãŒã·ã§ã³ãµãŒããŒïŒ15ã¢ããªïŒãèªã¿èŸŒã¿ãŸãã 2å°ã®ãµãŒããŒã¯ãäœéã®M620ã«ãäžéãã§ãã
ããŒã¿ããŒã¹ã®å¿çæéïŒã¢ããªãµãŒããŒã®å ŽåïŒïŒ
ããŒã¿ããŒã¹
db1ïŒVMïŒã®CPU䜿çšçïŒ
ãã€ããŒãã€ã¶ãŒã®CPU䜿çšçïŒ
ä»®æ³ãã·ã³ã«ã¯48åã®å®éã®ã³ã¢ããããšèããããŠãããããä»®æ³ãã·ã³ã®è² è·ã¯äœããªããŸããå®éããã€ããŒãã€ã¶ãŒã«ã¯24åã®ãã€ããŒã¹ã¬ããã£ã³ã°ã³ã¢ããããŸãã
æ倧ã§25äžä»¶ã®ã¯ãšãª/ç§ãããŒã¿ããŒã¹ã«éä¿¡ããã次ã®é ç®ã§æ§æãããŸãïŒ83ïŒ ã®éžæã3ïŒ -æ¿å ¥ã11.6ïŒ -æŽæ°ïŒ90ïŒ HOTïŒã1.6ïŒ ã®åé€ïŒïŒ
autovacuum_vacuum_scale_factor = 0.2ã®ããã©ã«ãå€ã§ã¯ã ãããã¿ãã«ã®æ°ããã¹ãã§éåžžã«æ¥éã«å¢å ãïŒããŒãã«ãµã€ãºã倧ãããªãïŒããã¹ãå šäœãæ°åå°ç¡ãã«ããçãããŒã¿ããŒã¹ããã©ãŒãã³ã¹ã®åé¡ãæ°åçºçããŸããã ãã®ãã©ã¡ãŒã¿ãŒautovacuum_vacuum_scale_factorã«å人çãªå€ãå²ãåœãŠãããšã§ãããã€ãã®ããŒãã«ã§ãã®æé·ãã調æŽãããå¿ èŠããããŸããã
ALTER TABLE ... SETïŒautovacuum_vacuum_scale_factor = ...ïŒ
ALTER TABLEæ§ç¯SETïŒautovacuum_vacuum_scale_factor = 0.10ïŒ;
ALTER TABLE production SETïŒautovacuum_vacuum_scale_factor = 0.01ïŒ;
ALTER TABLE game_entity SETïŒautovacuum_vacuum_scale_factor = 0.01ïŒ;
ALTER TABLE game_entity SETïŒautovacuum_analyze_scale_factor = 0.01ïŒ;
ALTER TABLE building SETïŒautovacuum_vacuum_scale_factor = 0.01ïŒ;
ALTER TABLE building SETïŒautovacuum_analyze_scale_factor = 0.01ïŒ;
ALTER TABLE core_inventory_player_resource SETïŒautovacuum_vacuum_scale_factor = 0.10ïŒ;
ALTER TABLE survivor SETïŒautovacuum_vacuum_scale_factor = 0.01ïŒ;
ALTER TABLE survivor SETïŒautovacuum_analyze_scale_factor = 0.01ïŒ;
ALTER TABLE production SETïŒautovacuum_vacuum_scale_factor = 0.01ïŒ;
ALTER TABLE game_entity SETïŒautovacuum_vacuum_scale_factor = 0.01ïŒ;
ALTER TABLE game_entity SETïŒautovacuum_analyze_scale_factor = 0.01ïŒ;
ALTER TABLE building SETïŒautovacuum_vacuum_scale_factor = 0.01ïŒ;
ALTER TABLE building SETïŒautovacuum_analyze_scale_factor = 0.01ïŒ;
ALTER TABLE core_inventory_player_resource SETïŒautovacuum_vacuum_scale_factor = 0.10ïŒ;
ALTER TABLE survivor SETïŒautovacuum_vacuum_scale_factor = 0.01ïŒ;
ALTER TABLE survivor SETïŒautovacuum_analyze_scale_factor = 0.01ïŒ;
çæ³çã«ã¯ãrows_fetchedã¯rows_returnedã«è¿ãã¯ãã§ãã幞ããªããšã«ã次ã®ããšã確èªããŸãã
hot_standby_feedback
åé¡ã¯hot_standby_feedbackãã©ã¡ãŒã¿ãŒã«ããã ã¹ã¿ã³ãã€ãµãŒããŒã«WALãã¡ã€ã«ããã®å€æŽãé©çšããæéããªãå Žåã ã¡ã€ã³ãµãŒããŒã®ããã©ãŒãã³ã¹ã«å€§ãã圱é¿ããå¯èœæ§ããããŸããã ããã¥ã¡ã³ãïŒhttps://postgrespro.ru/docs/postgrespro/11/runtime-config-replicationïŒã¯ãããããã¹ã¿ã³ãã€ãµãŒããŒãçŸåšå®è¡äžã®èŠæ±ã«ã€ããŠãã¹ã¿ãŒãŸãã¯äžäœã¹ã¬ãŒãã«éç¥ãããã©ããã決å®ããããšè¿°ã¹ãŠããŸããããã©ã«ãã§ã¯ãªãã«ãªã£ãŠããŸãããèšå®ã§ãªã³ã«ãªã£ãŠããŸãã 2ã€ã®ã¹ã¿ã³ãã€ãµãŒããŒããããããŒãäžã®ã¬ããªã±ãŒã·ã§ã³ã©ã°ããŒããšç°ãªãå ŽåïŒããŸããŸãªçç±ã«ããïŒãæ²ããçµæã«ã€ãªãããŸãããã®ãããªç¶æ³ã芳å¯ã§ãããã¹ãå šäœã®ã¯ã©ãã·ã¥ã«ã€ãªããå¯èœæ§ããããŸãã
ããã¯ãhot_standby_feedbackãæå¹ã«ãªã£ãŠããå Žåãã¬ããªã±ãŒã·ã§ã³ã®ç«¶åãé²ãããã«ã¹ã¿ã³ãã€ãµãŒããŒããã©ã³ã¶ã¯ã·ã§ã³IDã§é ããŠããå ŽåãVACUUMã¯ãããã¿ãã«ãåé€ããããªãããã§ãã 詳现ãªèšäºPostgreSQLã®hot_standby_feedbackãå®éã«è¡ãããš ïŒ
xl1_game=# VACUUM VERBOSE core_inventory_player_resource; INFO: vacuuming "public.core_inventory_player_resource" INFO: scanned index "core_inventory_player_resource_pkey" to remove 62869 row versions DETAIL: CPU: user: 1.37 s, system: 0.58 s, elapsed: 4.20 s âŠâŠâŠ... INFO: "core_inventory_player_resource": found 13682 removable, 7257082 nonremovable row versions in 71842 out of 650753 pages <b>DETAIL: 3427824 dead row versions cannot be removed yet, oldest xmin: 3810193429</b> There were 1920498 unused item pointers. Skipped 8 pages due to buffer pins, 520953 frozen pages. 0 pages are entirely empty. CPU: user: 4.55 s, system: 1.46 s, elapsed: 11.74 s.
ãã®ãããªå€æ°ã®ç¡å¹ãªã¿ãã«ã¯ãäžèšã®å³ã«ã€ãªãããŸãã hot_standby_feedbackããªã³ããã³ãªãã«ãã2ã€ã®ãã¹ãã次ã«ç€ºããŸãã
ãããŠãããã¯ãã¹ãäžã®ã¬ããªã±ãŒã·ã§ã³ã©ã°ã§ãããå°æ¥çã«ã¯äœããè¡ãå¿ èŠããããŸãã
ãããã«
幞ããªããšã«ïŒãŸãã¯èšäºã®å 容ã«ã€ããŠïŒãã®ãã¹ãã¯ãã²ãŒã ã®ãããã¿ã€ãã®ãã®æ®µéã§ããŠãŒã¶ãŒã®äžéšã«å¿ èŠãªè² è·ãå§åããå¯èœæ§ãéåžžã«é«ãããšã瀺ããŸãããããã¯ããããªããããã¿ã€ãäœæãšéçºã®ããã®éä¿¡å·ãåºãã®ã«ååã§ãã éçºã®åŸç¶ã®æ®µéã§ã¯ãåºæ¬çãªã«ãŒã«ïŒå®è¡ãããã¯ãšãªã®åçŽããç¶æããã€ã³ããã¯ã¹ãã€ã³ããã¯ã¹ãªãã®èªã¿åããªã©ãé²æ¢ããããïŒã«åŸãå¿ èŠããããŸããæãéèŠãªã®ã¯ãéçºã®éèŠãªå段éã§ãããžã§ã¯ãããã¹ãããŠåé¡ãèŠã€ããä¿®æ£ããããšã§ãããæ©ãããããšãã§ããŸãã ããããããã«ãç¹å®ã®åé¡ããã§ã«è§£æ±ºããã®ã§ãèšäºãæžããŸãã
çããã«å¹žéãïŒ
念ã®ãããGitHub ;ïŒ