This document discusses various MySQL consulting issues including:
1) Locality of reference and how data storage and retrieval patterns impact performance. Two examples of datasets with non-sequential access patterns are described.
2) The commit_demo.pl script which can test transaction performance on different storage configurations. Graphs of runtime vs transactions/commit are shown.
3) An overview of InnoDB status variables and what they indicate about the InnoDB buffer pool, logs, pages, rows and other areas. RAM disks are also discussed as a solution for temporary tables that exceed in-memory limits.
Caches are used in many layers of applications that we develop today, holding data inside or outside of your runtime environment, or even distributed across multiple platforms in data fabrics. However, considerable performance gains can often be realized by configuring the deployment platform/environment and coding your application to take advantage of the properties of CPU caches.
In this talk, we will explore what CPU caches are, how they work and how to measure your JVM-based application data usage to utilize them for maximum efficiency. We will discuss the future of CPU caches in a many-core world, as well as advancements that will soon arrive such as HP's Memristor.
Caches are used in many layers of applications that we develop today, holding data inside or outside of your runtime environment, or even distributed across multiple platforms in data fabrics. However, considerable performance gains can often be realized by configuring the deployment platform/environment and coding your application to take advantage of the properties of CPU caches.
In this talk, we will explore what CPU caches are, how they work and how to measure your JVM-based application data usage to utilize them for maximum efficiency. We will discuss the future of CPU caches in a many-core world, as well as advancements that will soon arrive such as HP's Memristor.
pipelining is the concept of decomposing the sequential process into number of small stages in which each stage execute individual parts of instruction life cycle inside the processor.
Some key value stores using log-structureZhichao Liang
This slides presents three key-value stores using log-structure, includes Riak, RethinkDB, LevelDB. BTW, i state that RethinkDB employs append-only B-tree and that is an estimate made by combining guessing wih reasoning!
Introduction to TokuDB v7.5 and Read Free ReplicationTim Callaghan
TokuDB v7.5 introduced Read Free Replication, allowing MySQL slaves to run with virtually no read IO. This presentation discusses how Fractal Tree indexes work, what they enable in TokuDB, and they allow TokuDB to uniquely offer this replication innovation.
Ceph: Open Source Storage Software Optimizations on Intel® Architecture for C...Odinot Stanislas
Après la petite intro sur le stockage distribué et la description de Ceph, Jian Zhang réalise dans cette présentation quelques benchmarks intéressants : tests séquentiels, tests random et surtout comparaison des résultats avant et après optimisations. Les paramètres de configuration touchés et optimisations (Large page numbers, Omap data sur un disque séparé, ...) apportent au minimum 2x de perf en plus.
MyRocks is an open source LSM based MySQL database, created by Facebook. This slides introduce MyRocks overview and how we deployed at Facebook, as of 2017.
In this session, we'll discuss architectural, design and tuning best practices for building rock solid and scalable Alfresco Solutions. We'll cover the typical use cases for highly scalable Alfresco solutions, like massive injection and high concurrency, also introducing 3.3 and 3.4 Transfer / Replication services for building complex high availability enterprise architectures.
Slides for a talk.
Talk abstract:
In the dark of the night, if you listen carefully enough, you can hear databases cry. But why? As developers, we rarely consider what happens under the hood of widely used abstractions such as databases. As a consequence, we rarely think about the performance of databases. This is especially true to less widespread, but often very useful NoSQL databases.
In this talk we will take a close look at NoSQL database performance, peek under the hood of the most frequently used features to see how they affect performance and discuss performance issues and bottlenecks inherent to all databases.
Ceph is unstable, vSAN got extremely poor performance. Data center need real high end distributed storage to replace traditional disk array support mission critical applications. PhegData X here raise up to answer...
Scalable and High available Distributed File System Metadata Service Using gR...Alluxio, Inc.
Alluxio Community Office Hour
Apr 7, 2020
For more Alluxio events: https://www.alluxio.io/events/
Speaker: Bin Fan
Alluxio (alluxio.io) is an open-source data orchestration system that provides a single namespace federating multiple external distributed storage systems. It is critical for Alluxio to be able to store and serve the metadata of all files and directories from all mounted external storage both at scale and at speed.
This talk shares our design, implementation, and optimization of Alluxio metadata service (master node) to address the scalability challenges. Particularly, we will focus on how to apply and combine techniques including tiered metadata storage (based on off-heap KV store RocksDB), fine-grained file system inode tree locking scheme, embedded state-replicate machine (based on RAFT), exploration and performance tuning in the correct RPC frameworks (thrift vs gRPC) and etc. As a result of the combined above techniques, Alluxio 2.0 is able to store at least 1 billion files with a significantly reduced memory requirement, serving 3000 workers and 30000 clients concurrently.
In this Office Hour, we will go over how to:
- Metadata storage challenges
- How to combine different open source technologies as building blocks
- The design, implementation, and optimization of Alluxio metadata service
MariaDB/MySQL pitfalls - And how to come out again...FromDual GmbH
During the last conferences the audience was asking for more war stories than just new features.
In this presentation we have a look at the most often seen problems as a MariaDB/MySQL consultant in field.
MariaDB / MySQL tripping hazard and how to get out again?FromDual GmbH
MySQL is NOT MariaDB, KISS, MyISAM Table Locking, big ibdata1, Noisy Neighbours, No BLOBs in a RDBMS, Disk full!, Locking, Crash, Out of Memory, Oom, Restart, Crash with Stacktrace, Tables without a Primary Key, Server has gone away! NUMA, Slave Lag, Sending data, Too many connections, Simple Query Tuning, Galera Cluster, Progress bar
In this presentation we discuss the New Features of MariaDB 10.4. First we give a short overview of the MariaDB Branches and Forks. Then we talk about the announced IPO. Technically we cover topics like Authentication, Accounts, InnoDB, Optimizer improvements, Application-Time Period Tables the new Backup Stage Galera 4 and other changes...
MariaDB 10.4 became General Available (GA = ready for production) this summer. So it is time to look at the new Features in MariaDB 10.4. After a short intro about history we look for the reason of broad usage of MariaDB nowadays. Most important improvements where in User Authentication, InnoDB improvements, and Optimizer enhancements. A completely New Feature is Application-Time Period Tables. Backup got a new Locking behaviour so LVM snapshots are possible and officially supported now. And last but not least MariaDB 10.4 comes with Galera 4.
MariaDB 10.2 New Features for Developers, Administrators and DevOps. Window Functions, Common Table Expressions, Check Constraints, GeoJSON, GIS, JSON, Oracle compatibility and MariaDB Connectors
Der Datenbank-Backup ist gemacht - was nun?FromDual GmbH
* Datenbank-Backup – welcher Zweck?
* Tauglichkeit des Backup, Verifikation
* Echtdaten vollständig nutzen
* Dem Datenschutz genügen
* Material für die Entwicklung
* Automatisierung
Weltweite Produktionsdatenverwaltung mit MySQL-ReplikationFromDual GmbH
Weltweite Produktionsdatenverwaltung mit MySQL
* Ausgangslage
* Probleme die sich stellen
* Wer darf welche Daten kriegen?
* Wie werden Daten verteilt?
* Produktionsdaten zurück?
* MySQL multi-Source Replikation
* Bertriebsverantwortung
* Hochverfügbarkeit
* Sensitive Daten
* Wer darf welche Daten sehen?
* MySQL Row Filterung
* Nachträgliche Forderungen
MySQL Performance Tuning für Oracle-DBA'sFromDual GmbH
MySQL Performance Tuning
* Was ist Performance?
* Was kostet Performance?
* Tuning Massnahmen
* MySQL Konfiguration
* Wo schauen?
* Langsame Abfragen finden
* Optimiere das Query!
* Monitoring
Reading MySQL fingerprints
Every MySQL Database has its typical fingerprints. They can be seen with SHOW GLOBAL STATUS;
How you interprete them you will find in this presentation.
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...SOFTTECHHUB
The choice of an operating system plays a pivotal role in shaping our computing experience. For decades, Microsoft's Windows has dominated the market, offering a familiar and widely adopted platform for personal and professional use. However, as technological advancements continue to push the boundaries of innovation, alternative operating systems have emerged, challenging the status quo and offering users a fresh perspective on computing.
One such alternative that has garnered significant attention and acclaim is Nitrux Linux 3.5.0, a sleek, powerful, and user-friendly Linux distribution that promises to redefine the way we interact with our devices. With its focus on performance, security, and customization, Nitrux Linux presents a compelling case for those seeking to break free from the constraints of proprietary software and embrace the freedom and flexibility of open-source computing.
Epistemic Interaction - tuning interfaces to provide information for AI supportAlan Dix
Paper presented at SYNERGY workshop at AVI 2024, Genoa, Italy. 3rd June 2024
https://alandix.com/academic/papers/synergy2024-epistemic/
As machine learning integrates deeper into human-computer interactions, the concept of epistemic interaction emerges, aiming to refine these interactions to enhance system adaptability. This approach encourages minor, intentional adjustments in user behaviour to enrich the data available for system learning. This paper introduces epistemic interaction within the context of human-system communication, illustrating how deliberate interaction design can improve system understanding and adaptation. Through concrete examples, we demonstrate the potential of epistemic interaction to significantly advance human-computer interaction by leveraging intuitive human communication strategies to inform system design and functionality, offering a novel pathway for enriching user-system engagements.
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf91mobiles
91mobiles recently conducted a Smart TV Buyer Insights Survey in which we asked over 3,000 respondents about the TV they own, aspects they look at on a new TV, and their TV buying preferences.
A tale of scale & speed: How the US Navy is enabling software delivery from l...sonjaschweigert1
Rapid and secure feature delivery is a goal across every application team and every branch of the DoD. The Navy’s DevSecOps platform, Party Barge, has achieved:
- Reduction in onboarding time from 5 weeks to 1 day
- Improved developer experience and productivity through actionable findings and reduction of false positives
- Maintenance of superior security standards and inherent policy enforcement with Authorization to Operate (ATO)
Development teams can ship efficiently and ensure applications are cyber ready for Navy Authorizing Officials (AOs). In this webinar, Sigma Defense and Anchore will give attendees a look behind the scenes and demo secure pipeline automation and security artifacts that speed up application ATO and time to production.
We will cover:
- How to remove silos in DevSecOps
- How to build efficient development pipeline roles and component templates
- How to deliver security artifacts that matter for ATO’s (SBOMs, vulnerability reports, and policy evidence)
- How to streamline operations with automated policy checks on container images
Enhancing Performance with Globus and the Science DMZGlobus
ESnet has led the way in helping national facilities—and many other institutions in the research community—configure Science DMZs and troubleshoot network issues to maximize data transfer performance. In this talk we will present a summary of approaches and tips for getting the most out of your network infrastructure using Globus Connect Server.
The Art of the Pitch: WordPress Relationships and SalesLaura Byrne
Clients don’t know what they don’t know. What web solutions are right for them? How does WordPress come into the picture? How do you make sure you understand scope and timeline? What do you do if sometime changes?
All these questions and more will be explored as we talk about matching clients’ needs with what your agency offers without pulling teeth or pulling your hair out. Practical tips, and strategies for successful relationship building that leads to closing the deal.
In his public lecture, Christian Timmerer provides insights into the fascinating history of video streaming, starting from its humble beginnings before YouTube to the groundbreaking technologies that now dominate platforms like Netflix and ORF ON. Timmerer also presents provocative contributions of his own that have significantly influenced the industry. He concludes by looking at future challenges and invites the audience to join in a discussion.
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfPaige Cruz
Monitoring and observability aren’t traditionally found in software curriculums and many of us cobble this knowledge together from whatever vendor or ecosystem we were first introduced to and whatever is a part of your current company’s observability stack.
While the dev and ops silo continues to crumble….many organizations still relegate monitoring & observability as the purview of ops, infra and SRE teams. This is a mistake - achieving a highly observable system requires collaboration up and down the stack.
I, a former op, would like to extend an invitation to all application developers to join the observability party will share these foundational concepts to build on:
Removing Uninteresting Bytes in Software FuzzingAftab Hussain
Imagine a world where software fuzzing, the process of mutating bytes in test seeds to uncover hidden and erroneous program behaviors, becomes faster and more effective. A lot depends on the initial seeds, which can significantly dictate the trajectory of a fuzzing campaign, particularly in terms of how long it takes to uncover interesting behaviour in your code. We introduce DIAR, a technique designed to speedup fuzzing campaigns by pinpointing and eliminating those uninteresting bytes in the seeds. Picture this: instead of wasting valuable resources on meaningless mutations in large, bloated seeds, DIAR removes the unnecessary bytes, streamlining the entire process.
In this work, we equipped AFL, a popular fuzzer, with DIAR and examined two critical Linux libraries -- Libxml's xmllint, a tool for parsing xml documents, and Binutil's readelf, an essential debugging and security analysis command-line tool used to display detailed information about ELF (Executable and Linkable Format). Our preliminary results show that AFL+DIAR does not only discover new paths more quickly but also achieves higher coverage overall. This work thus showcases how starting with lean and optimized seeds can lead to faster, more comprehensive fuzzing campaigns -- and DIAR helps you find such seeds.
- These are slides of the talk given at IEEE International Conference on Software Testing Verification and Validation Workshop, ICSTW 2022.
PHP Frameworks: I want to break free (IPC Berlin 2024)Ralf Eggert
In this presentation, we examine the challenges and limitations of relying too heavily on PHP frameworks in web development. We discuss the history of PHP and its frameworks to understand how this dependence has evolved. The focus will be on providing concrete tips and strategies to reduce reliance on these frameworks, based on real-world examples and practical considerations. The goal is to equip developers with the skills and knowledge to create more flexible and future-proof web applications. We'll explore the importance of maintaining autonomy in a rapidly changing tech landscape and how to make informed decisions in PHP development.
This talk is aimed at encouraging a more independent approach to using PHP frameworks, moving towards a more flexible and future-proof approach to PHP development.
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex ProofsAlex Pruden
This paper presents Reef, a system for generating publicly verifiable succinct non-interactive zero-knowledge proofs that a committed document matches or does not match a regular expression. We describe applications such as proving the strength of passwords, the provenance of email despite redactions, the validity of oblivious DNS queries, and the existence of mutations in DNA. Reef supports the Perl Compatible Regular Expression syntax, including wildcards, alternation, ranges, capture groups, Kleene star, negations, and lookarounds. Reef introduces a new type of automata, Skipping Alternating Finite Automata (SAFA), that skips irrelevant parts of a document when producing proofs without undermining soundness, and instantiates SAFA with a lookup argument. Our experimental evaluation confirms that Reef can generate proofs for documents with 32M characters; the proofs are small and cheap to verify (under a second).
Paper: https://eprint.iacr.org/2023/1886
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
Locality of (p)reference
1. Locality of (p)reference
Some thoughts about MySQL consulting issues
Oli Sennhauser
Senior Consultant
osennhauser@mysql.com
Copyright 2007 MySQL AB The World’s Most Popular Open Source Database 1
2. ToC
• Locality of (p)reference
• commit_demo.pl (performance test/numbers)
• InnoDB information (discussion)
• RAM disk
• MySQL variables (discussion)
• MyISAM log
• MySQL Visual Explain
Copyright 2007 MySQL AB The World’s Most Popular Open Source Database 2
3. Locality of (p)reference
• In theory: We should not care how data are
stored internally.
• In practice: It is sometimes good to know!
• Why?
• 2 examples from the last 9 months:
– wind mills
– vehicle tracking for parcel delivery
Copyright 2007 MySQL AB The World’s Most Popular Open Source Database 3
4. Example 1
• Several 100 wind mills
• 50 measured values per
wind mill
• Every 5-15 minutes
• Up to 10 years
• Dozens of GB of data
• Record size up to 2k!
• Search pattern: Give me
value x from wind mill
#13 in this time range!
Copyright 2007 MySQL AB The World’s Most Popular Open Source Database 4
5. Example 2
• Several 100 vehicles
• 24 h/d
• Every 2 min position
• Status/position per
vehicle, later per
parcel!!!
• Dozens of GB of data
• Record size 400 bytes
• Search pattern: Give
me all positions of
vehicle #13 from the
last 24 hours.
Copyright 2007 MySQL AB The World’s Most Popular Open Source Database 5
6. Locality of Reference
• These 2 examples have one behaviour in
common:
• Delivery of data is completely different than
search pattern.
– Usually data are delivered sorted by time and also
(more or less) retrieved by time.
– In this cases time has a secondary influence!
• But what happens???
Copyright 2007 MySQL AB The World’s Most Popular Open Source Database 6
7. Locality of Reference
• Block size is 16k/4k
• PK is AUTO_INCREMENT
• Synthecial PK are sometimes dangerous!
Copyright 2007 MySQL AB The World’s Most Popular Open Source Database 7
8. Locality of Reference
• What to do???
➔ PK on (vehicle_id, ts) for example or
➔ PK on (windmill_id, data, ts)
➔ Can be up to 100 times more efficient (not
necessarily faster)
• What about MyISAM?
• What about Falcon? (Mail from Ann can be
provided).
Copyright 2007 MySQL AB The World’s Most Popular Open Source Database 8
9. commit_demo.pl
• Little ugly script to test your I/O system:
http://www.shinguz.ch/MySQL/consulting_tools.html
• What it does:
INSERT -> COMMIT -> INSERT -> COMMIT -> ...
• The idea behind it
• How to call:
./commit_demo.pl u root c
./commit_demo.pl u root i <n>
./commit_demo.pl u root c
• Does NOT work with 6.0 :-(
• Lit: http://www.shinguz.ch/MySQL/transaction_performance.pdf
Copyright 2007 MySQL AB The World’s Most Popular Open Source Database 9
10. commit_demo.pl
40
35
30
run time [s]
25
normal
20 bin_log
sync_binlog
MyISAM
15
Backup
Theory
10
5
0
1 2 4 8 16 32 64 128 256
INSERT/COMMIT
Copyright 2007 MySQL AB The World’s Most Popular Open Source Database 10
12. commit_demo.pl
Time trx trx theorie Comment
[s] [ms/trx] [trx/s] [ms/trx]
12.3 1.2 833 8.3 Laptop, with good disk cache
27.2 2.7 370 2.5 SAN with up to 2000 I/O per second
41.0 4.1 244 4.0 Baseline for the following test
42.2 4.2 238 4.0 With DRBD, 2.5% slower
157.0 15.7 64 4.0 with XFS, badly configured?
86.4 8.6 116 8.0 With binary logging
565.0 56.5 18 8.0 sync_binlog=1!!!
Copyright 2007 MySQL AB The World’s Most Popular Open Source Database 12
13. InnoDB information (discussion)
• SHOW GLOBAL STATUS LIKE 'InnoDB%';
• SHOW ENGINE INNODB STATUSG
• OK. But what does it mean to me?
• Let's start with a rough architecture picture:
Copyright 2007 MySQL AB The World’s Most Popular Open Source Database 13
14. InnoDB architecture mysqld
secondary index buffer
data pages
index pages
adaptive hash idx
undo records
buffer pool
• SHOW STATUS; lock info table
trx log buffer
Innodb_buffer_pool_%
Innodb_data_%
Innodb_dblwr_%
Innodb_log_%
Innodb_os_log_%
Innodb_pages_%
Innodb_row_lock_%
async
OS file cache
sync
Innodb_rows_%
• SHOW INNODB STATUS; system table space: ibdata1
ib_logfile1
undo
SEMAPHORES double write area dd
TRANSACTIONS
ib_logfile2
FILE I/O
INSERT BUFFER AND tables/indexes
ADAPTIVE HASH INDEX
ib_logfilen
LOG
BUFFER POOL AND MEMORY table table space table table space table table space
ROW OPERATIONS
Copyright 2007 MySQL AB The World’s Most Popular Open Source Database 14
15. Innodb_buffer_pool%
Innodb_buffer_pool_pages_dirty
+ Innodb_buffer_pool_pages_clean BUFFER POOL AND MEMORY
Innodb_buffer_pool_pages_data Total memory allocated 18415432;
+ Innodb_buffer_pool_pages_free in additional pool allocated 859008
+ Innodb_buffer_pool_pages_misc Dictionary memory allocated 20888
Buffer pool size 512
= Innodb_buffer_pool_pages_total Free buffers 493
============================== Database pages 19
Modified db pages 0
Innodb_buffer_pool_pages_flushed Pending reads 0
Innodb_buffer_pool_pages_latched Pending writes: LRU 0,
flush list 0,
Innodb_buffer_pool_read_ahead_rnd single page 0
Innodb_buffer_pool_read_ahead_seq Pages read 19,
created 0,
Innodb_buffer_pool_read_requests written 0
Innodb_buffer_pool_reads 0.32 reads/s,
Innodb_buffer_pool_write_requests 0.00 creates/s,
0.00 writes/s
Innodb_buffer_pool_wait_free Buffer pool hit rate 754 / 1000
Copyright 2007 MySQL AB The World’s Most Popular Open Source Database 15
16. Innodb_data%
Innodb_data_fsyncs
Innodb_data_pending_fsyncs
Innodb_data_pending_reads
Innodb_data_pending_writes
???
Innodb_data_read
Innodb_data_reads
Innodb_data_writes
Innodb_data_written
Copyright 2007 MySQL AB The World’s Most Popular Open Source Database 16
17. Innodb_dblwr%
Innodb_dblwr_pages_written
???
Innodb_dblwr_writes
Copyright 2007 MySQL AB The World’s Most Popular Open Source Database 17
18. Innodb_[os_]log%
LOG
Log sequence number 0 46409
Log flushed up to 0 46409
Last checkpoint at 0 46409
Innodb_log_waits
0 pending log writes,
Innodb_log_write_requests
0 pending chkp writes
Innodb_log_writes
8 log i/o's done,
0.14 log i/o's/second
Innodb_os_log_fsyncs
Innodb_os_log_pending_fsyncs
Pending normal aio reads: 0,
Innodb_os_log_pending_writes
aio writes: 0,
Innodb_os_log_written
ibuf aio reads: 0,
log i/o's: 0,
sync i/o's: 0
Pending flushes (fsync) log: 0;
buffer pool: 0
Copyright 2007 MySQL AB The World’s Most Popular Open Source Database 18
19. Innodb_pages%
Innodb_page_size
Innodb_pages_created
???
Innodb_pages_read
Innodb_pages_written
Copyright 2007 MySQL AB The World’s Most Popular Open Source Database 19
20. Innodb_row_lock%
Innodb_row_lock_current_waits
Innodb_row_lock_time_max
Innodb_row_lock_time_avg ???
* Innodb_row_lock_waits
= Innodb_row_lock_time
Copyright 2007 MySQL AB The World’s Most Popular Open Source Database 20
21. Innodb_rows%
ROW OPERATIONS
0 queries inside InnoDB,
0 queries in queue
1 read views open inside InnoDB
Main thread process no. 7924,
Innodb_rows_deleted id 3004103568,
Innodb_rows_inserted state: waiting for server activity
Innodb_rows_read Number of rows inserted 0,
Innodb_rows_updated updated 0,
deleted 0,
read 0
0.00 inserts/s,
0.00 updates/s,
0.00 deletes/s,
0.00 reads/s
Copyright 2007 MySQL AB The World’s Most Popular Open Source Database 21
22. SEMAPHORES
SEMAPHORES
OS WAIT ARRAY INFO:
reservation count 2,
signal count 2
Mutex spin waits 0,
???
rounds 0,
OS waits 0
RWshared spins 4,
OS waits 2;
RWexcl spins 1,
OS waits 0
Copyright 2007 MySQL AB The World’s Most Popular Open Source Database 22
23. TRANSACTIONS
TRANSACTIONS
Trx id counter 0 1280
Purge done for trx's n:o < 0 0
undo n:o < 0 0
History list length 0
Total number of lock structs
in row lock hash table 0
???
LIST OF TRANSACTIONS
FOR EACH SESSION:
TRANSACTION 0 0, not started,
process no 7924,
OS thread id 3032894352
MySQL thread id 2,
query id 4 localhost root
show engine innodb status
Copyright 2007 MySQL AB The World’s Most Popular Open Source Database 23
24. FILE I/O
FILE I/O
I/O thread 0 state:
waiting for i/o request
(insert buffer thread)
I/O thread 1 state:
waiting for i/o request
(log thread)
I/O thread 2 state:
waiting for i/o request
(read thread)
I/O thread 3 state:
??? waiting for i/o request
(write thread)
Pending normal aio reads: 0,
aio writes: 0,
ibuf aio reads: 0, log i/o's: 0,
sync i/o's: 0
Pending flushes (fsync) log: 0;
buffer pool: 0
25 OS file reads, 3 OS file writes,
3 OS fsyncs
0.42 reads/s, 100433 avg bytes/read,
0.05 writes/s, 0.05 fsyncs/s
Copyright 2007 MySQL AB The World’s Most Popular Open Source Database 24
25. INSERT BUFFER AND ADAPTIVE HASH INDEX
INSERT BUFFER AND
ADAPTIVE HASH INDEX
Ibuf: size 1,
free list len 0,
seg size 2,
0 inserts,
??? 0 merged recs,
0 merges
Hash table size 34679,
used cells 0,
node heap has 0 buffer(s)
0.00 hash searches/s,
0.31 nonhash searches/s
Copyright 2007 MySQL AB The World’s Most Popular Open Source Database 25
26. RAM disks (I)
• ORDER BY, GROUP BY, DISTINCT --> temp tables
– bigger than:
tmp_table_size = 32M
max_heap_table_size = 16M
– BLOB/TEXT
• Will be written into:
tmpdir = /tmp/
• Can be seen in:
Created_tmp_disk_tables 0
Created_tmp_tables 20
Copyright 2007 MySQL AB The World’s Most Popular Open Source Database 26
27. RAM disk (II)
• Both counters are increased!
• Solutions?
– Change your statement/requirements
– Optimize your Query
– Reduce size of result set
– Avoid BLOB/TEXT
• And if you cannot?
--> Use a RAM disk!
Copyright 2007 MySQL AB The World’s Most Popular Open Source Database 27
28. RAM disk (III)
• RAM disk is a disk in RAM :-) --> So you need
much RAM (8 Gbyte on 32-bit systems?)!
• Can use your SWAP (we do not want that)!
• More info:
/usr/src/linux/Documentation/filesystems
# cat /proc/filesystems
# mount tmpfs t tmpfs /mnt o size=100m
# mount
• Bug in 5.0.4x!!! :-(
Copyright 2007 MySQL AB The World’s Most Popular Open Source Database 28
29. MySQL variables (discussion)
• Customers have very often misconfigured my.cnf
• My postulate: use the DEFAULT and adapt 3
things:
– key_buffer_size
– innodb_buffer_pool_size
– innodb_log_file_size
• That's it! Other changes only after detailed tests!
• What is you opinion?
Copyright 2007 MySQL AB The World’s Most Popular Open Source Database 29
30. MyISAM log
• There is a log for MyISAM!
I did not know that! :-(
• enable in my.cnf
logisam = myisam.log
• cat myisam.log: :-(
+�./mysql/host.MYI+�
+�+�+�./mysql/user.MYI+�
+�+�+�./mysql/db.MYI+�
+�+�+�+�+�+�+�+�+�+�+�+�!./mysql/time_zone_leap_second.MYI+�
+�+�+�▒./mysql/time_zone_name.MYI+�
+�+�+�./mysql/time_zone.MYI+�
+�%./mysql/time_zone_transition_type.MYI
+� ./mysql/time_zone_transition.MYI+�
+�+�+�+�+�+�+�./mysql/tables_priv.MYI+�
+�+�+�▒./mysql/columns_priv.MYI+�
Copyright 2007 MySQL AB The World’s Most Popular Open Source Database 30
31. MyISAM log
• myisamlog myisam.log
Commands Used count Errors Recover errors
open 15 0 0
write 8 0 0
update 1 0 0
close 8 0 0
extra 93 0 0
Total 125 0 0
• myisamlog -? --> help
• myisamlog -vvv
• myisamlog -i
User time 0.00, System time 0.00
Maximum resident set size 0, Integral resident set size 0
Nonphysical pagefaults 519, Physical pagefaults 0, Swaps 0
Blocks in 0 out 0, Messages in 0 out 0, Signals 0
Voluntary context switches 1, Involuntary context switches 8
Copyright 2007 MySQL AB The World’s Most Popular Open Source Database 31
32. MySQL visual explain
• http://mysqltoolkit.sourceforge.net/
EXPLAIN
SELECT i.number, l.answer
FROM poll_item i
JOIN poll_item_l l ON (l.poll_id = i.poll_id
AND l.number = i.number)
WHERE i.poll_id = '4'
AND l.language_id = '2'
ORDER BY i.number ASC;
+++++++++++
| id | select | tab | type | pos_keys | key | k_len | ref | rows | Extra |
+++++++++++
| 1 | SIMPLE | i | ref | PRIMARY | PRIMARY | 2 | const | 5 | Using where; Using index |
| 1 | SIMPLE | l | eq_ref | PRIMARY | PRIMARY | 5 | const,... | 1 | Using where |
+++++++++++
Copyright 2007 MySQL AB The World’s Most Popular Open Source Database 32
33. MySQL visual explain
• http://mysqltoolkit.sourceforge.net/
./mysqlvisualexplain test.exp
JOIN
+ Filter with WHERE
| + Bookmark lookup
| + Table
| | table l
| | possible_keys PRIMARY
| + Unique index lookup
| key l>PRIMARY
| possible_keys PRIMARY
| key_len 5
| ref const,topodb.i.number,const
| rows 1
+ Filter with WHERE
+ Index lookup
key i>PRIMARY
possible_keys PRIMARY
key_len 2
ref const
rows 5
Copyright 2007 MySQL AB The World’s Most Popular Open Source Database 33