-
Notifications
You must be signed in to change notification settings - Fork 1
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
Improve MySql performance #396
Comments
even after #397 it seems there is a lot of disk writes |
MySQL tuner now recommends
Variables to adjust: |
Investigate why the db is 40G:
|
The job-table is no longer part of the db and a replica has been set up. Current size
Query SELECT
table_schema as `Database`,
table_name AS `Table`,
round(((data_length + index_length) / 1024 / 1024), 2) `Size in MB`
FROM information_schema.TABLES
ORDER BY (data_length + index_length) DESC; |
In addition the number of disk writes is much smaller than the reads now. |
Testing #576 |
restarting the db server now... Some data: |
This could look better now, before we investigate in detail let's also update the version as there were some CVEs happened. https://mariadb.com/kb/en/upgrading-from-mariadb-10-6-to-mariadb-10-11/ |
The update worked well on staging:
|
root@1f379e8b6369:/# perl mysqltuner.pl --user root --pass
>> MySQLTuner 2.6.0
* Jean-Marie Renouard <[email protected]>
* Major Hayden <[email protected]>
>> Bug reports, feature requests, and downloads at http://mysqltuner.pl/
>> Run with '--help' for additional options and output filtering
[--] Skipped version check for MySQLTuner script
[OK] Logged in using credentials passed on the command line
[OK] Operating on 64-bit architecture
-------- Storage Engine Statistics -----------------------------------------------------------------
[--] Status: +Aria +CSV +InnoDB +MEMORY +MRG_MyISAM +MyISAM +PERFORMANCE_SCHEMA +SEQUENCE
[--] Data in MyISAM tables: 2.0K (Tables: 2)
[--] Data in InnoDB tables: 272.7G (Tables: 243)
[--] Data in Aria tables: 32.0K (Tables: 1)
[!!] Total fragmented tables: 1
[OK] Currently running supported MySQL version 10.11.9-MariaDB-ubu2204
-------- Log file Recommendations ------------------------------------------------------------------
[!!] Log file doesn't exist
-------- Analysis Performance Metrics --------------------------------------------------------------
[--] innodb_stats_on_metadata: OFF
[OK] No stat updates during querying INFORMATION_SCHEMA.
-------- Views Metrics -----------------------------------------------------------------------------
-------- Triggers Metrics --------------------------------------------------------------------------
-------- Routines Metrics --------------------------------------------------------------------------
-------- Security Recommendations ------------------------------------------------------------------
[OK] There are no anonymous accounts for any database users
[OK] All database users have passwords assigned
-------- CVE Security Recommendations --------------------------------------------------------------
[OK] NO SECURITY CVE FOUND FOR YOUR VERSION
-------- Performance Metrics -----------------------------------------------------------------------
[--] Up for: 3d 13h 35m 2s (165M q [537.851 qps], 5M conn, TX: 858G, RX: 42G)
[--] Reads / Writes: 99% / 1%
[--] Binary logging is disabled
[--] Physical Memory : 125.8G
[--] Max MySQL memory : 25.9G
[--] Other process memory: 0B
[--] Total buffers: 20.2G global + 5.7M per thread (1000 max threads)
[--] Performance_schema Max memory usage: 149M
[--] Galera GCache Max memory usage: 0B
[OK] Maximum reached memory usage: 20.9G (16.60% of installed RAM)
[OK] Maximum possible memory usage: 25.9G (20.58% of installed RAM)
[OK] Overall possible memory usage with other process is compatible with memory available
[OK] Slow queries: 0% (169K/165M)
[OK] Highest usage of available connections: 10% (100/1000)
[OK] Aborted connections: 0.00% (6/5109563)
[OK] Query cache is disabled by default due to mutex contention on multiprocessor machines.
[OK] Sorts requiring temporary tables: 0% (48 temp sorts / 2M sorts)
[OK] No joins without indexes
[OK] Temporary tables created on disk: 3% (51K on disk / 1M total)
[OK] Thread cache hit rate: 99% (100 created / 5M connections)
[OK] Table cache hit rate: 99% (268M hits / 268M requests)
[!!] table_definition_cache (400) is less than number of tables (537)
[OK] Open file limit used: 0% (63/33K)
[OK] Table locks acquired immediately: 100% (148K immediate / 148K locks)
-------- Performance schema ------------------------------------------------------------------------
[--] Performance_schema is activated.
[--] Memory used by Performance_schema: 150.0M
[--] Sys schema is installed.
-------- ThreadPool Metrics ------------------------------------------------------------------------
[--] ThreadPool stat is disabled.
-------- MyISAM Metrics ----------------------------------------------------------------------------
[!!] Consider migrating 2 following tables to InnoDB:
[--] * InnoDB migration request for my_wiki.searchindex Table: ALTER TABLE my_wiki.searchindex ENGINE=InnoDB;
[--] * InnoDB migration request for wiki_swmath.searchindex Table: ALTER TABLE wiki_swmath.searchindex ENGINE=InnoDB;
[--] General MyIsam metrics:
[--] +-- Total MyISAM Tables : 2
[--] +-- Total MyISAM indexes : 2.0K
[--] +-- KB Size :24.0M
[--] +-- KB Used Size :4.5M
[--] +-- KB used :18.7%
[--] +-- Read KB hit rate: 0% (0 cached / 0 reads)
[--] +-- Write KB hit rate: 0% (0 cached / 0 writes)
[!!] Key buffer used: 18.7% (4.5M used / 24.0M cache)
[OK] Key buffer size / total MyISAM indexes: 24.0M/2.0K
-------- InnoDB Metrics ----------------------------------------------------------------------------
[--] InnoDB is enabled.
[OK] InnoDB File per table is activated
[OK] InnoDB Buffer Pool size ( 20.0G ) under limit for 64 bits architecture: (17179869184.0G )
[!!] InnoDB buffer pool / data size: 20.0G / 272.7G
[!!] Ratio InnoDB log file size / InnoDB Buffer pool size (0.15625%): 32.0M * 1 / 20.0G should be equal to 25%
[--] Number of InnoDB Buffer Pool Chunk: 64 for 1 Buffer Pool Instance(s)
[OK] Innodb_buffer_pool_size aligned with Innodb_buffer_pool_chunk_size & Innodb_buffer_pool_instances
[OK] InnoDB Read buffer efficiency: 100.00% (2203911027564 hits / 2203999549502 total)
[OK] InnoDB Write Log efficiency: 93.83% (14424327 hits / 15372419 total)
[OK] InnoDB log waits: 0.00% (0 waits / 948092 writes)
-------- Aria Metrics ------------------------------------------------------------------------------
[--] Aria Storage Engine is enabled.
[OK] Aria pagecache size / total Aria indexes: 128.0M/2.6M
[OK] Aria pagecache hit rate: 96.5% (17B cached / 620M reads)
-------- TokuDB Metrics ----------------------------------------------------------------------------
[--] TokuDB is disabled.
-------- XtraDB Metrics ----------------------------------------------------------------------------
[--] XtraDB is disabled.
-------- Galera Metrics ----------------------------------------------------------------------------
[--] Galera is disabled.
-------- Replication Metrics -----------------------------------------------------------------------
[--] Galera Synchronous replication: NO
[--] This server is acting as master for 1 server(s).
[--] Binlog format: MIXED
[--] XA support enabled: ON
[--] Semi synchronous replication Master: OFF
[--] Semi synchronous replication Slave: OFF
[!!] This replication slave is not running but seems to be configured.
-------- Recommendations ---------------------------------------------------------------------------
General recommendations:
Run ALTER TABLE ... FORCE or OPTIMIZE TABLE to defragment tables for better performance
ALTER TABLE `my_wiki`.`l10n_cache` FORCE; -- can free 27928 MiB
Total freed space after defragmentation: 27928 MiB
MyISAM engine is deprecated, consider migrating to InnoDB
Be careful, increasing innodb_log_file_size / innodb_log_files_in_group means higher crash recovery mean time
Variables to adjust:
table_definition_cache (400) > 537 or -1 (autosizing if supported)
key_buffer_size (~ 4M)
innodb_buffer_pool_size (>= 272.7G) if possible.
innodb_log_file_size should be (=5G) if possible, so InnoDB total log file size equals 25% of buffer pool size. |
Even if no imports are running queries like
generate a lot of load as the pagelink table is very large |
I renamed the link tables, which solved it for now. |
Current table sizes
|
MySql seems to be a performance bottleneck for the data ingest process.
mysqltuner suggests:
Performance schema should be activated for better diagnostics
Consider installing Sys schema from https://github.com/FromDual/mariadb-sys for MariaDB
MyISAM engine is deprecated, consider migrating to InnoDB
Be careful, increasing innodb_log_file_size / innodb_log_files_in_group means higher crash recovery mean time
Variables to adjust:
query_cache_size (> 64M)
sort_buffer_size (> 4M)
read_rnd_buffer_size (> 1M)
performance_schema=ON
key_buffer_size (~ 24M)
innodb_buffer_pool_size (>= 44.9G) if possible.
innodb_log_file_size should be (=32M) if possible, so InnoDB total log file size equals 25% of buffer pool size.
r
The text was updated successfully, but these errors were encountered: