Re: Mysql Server Optimierung INNODB



Matthias Blohm <m.blohm-nimmsweg-@xxxxxxxxxx> wrote:

wir haben ein Problem mit einem Mysql-Server 4.1 und einer sehr großen Datenbank mit mehreren
millionen Datensätzen.

Groß?

Der Server läuft auf einem Linux Suse SLES9 und allen Service-Packs.
Der Server ist ein Intel DualCore mit 12GB Ram und das Filesystem ist ein ReiserFS mit
angeschlossenenem RAID5. Netzwerk Gigabit natürlich auch.

Schön viel RAM. Wie groß ist denn nun die Datenbank?

Rasier-FS hat diesen Namen nicht zu Unrecht. Und RAID-5 wird für
Datenbanken nicht so oft verwendet weil es schlechte Schreib-
Performance hat.

Das Problem ist folgendes:
Manchmal wenn der Server einige einfache SELECTs mache soll läuft der bei hohem Load von max. 2.00.

2 ist keine hohe Load. 100 wäre hoch.

Dann läuft das SELECT 10minuten oder mehr, welches normaler Weise 16 Sekunden dauern sollte.

Was sagt EXPLAIN?

Alle anderen bekommen in der Zeit ein Timeout wenn diese ein Update auf die Tabelle machen wollen.

Klingt nicht nach InnoDB. Sicher daß das keine MyISAM-Tabelle ist?

Unsere Frage ist natürlich nun, WARUM passiert das und welche Optimierungen kann man durchführen
machen, damit das nicht mehr auftritt.

hier die my.cnf:
....
key_buffer = 1M

Falls du MyISAM-Tabellen hast, ist das natürlich ein Killer.

innodb_data_file_path = ibdata1:150G

Ein Tablespace fester Größe bietet keinen Vorteil gegenüber
auto-growing.

innodb_buffer_pool_size = 8000M
innodb_additional_mem_pool_size = 8M
innodb_log_file_size = 512M
innodb_log_buffer_size = 8M

Das sieht so weit gut aus.

=====================================
070725 15:32:00 INNODB MONITOR OUTPUT
=====================================
Per second averages calculated from the last 41 seconds
----------
SEMAPHORES
----------
OS WAIT ARRAY INFO: reservation count 98062, signal count 98040
Mutex spin waits 634080, rounds 678716, OS waits 8040
RW-shared spins 177963, OS waits 88873; RW-excl spins 713, OS waits 430
------------
TRANSACTIONS
------------
Trx id counter 0 89633355
Purge done for trx's n:o < 0 89631095 undo n:o < 0 0
History list length 84
Total number of lock structs in row lock hash table 44
LIST OF TRANSACTIONS FOR EACH SESSION:
<...skip...>


--------
FILE I/O
--------
....
0.12 reads/s, 16384 avg bytes/read, 5.95 writes/s, 4.07 fsyncs/s

---
LOG
---
....
10173 log i/o's done, 1.98 log i/o's/second

----------------------
BUFFER POOL AND MEMORY
----------------------
Total memory allocated 9174291714; in additional pool allocated 8388608
Buffer pool size 512000
Free buffers 0
Database pages 509978
Modified db pages 49867
Pending reads 0
Pending writes: LRU 0, flush list 0, single page 0
Pages read 5241454, created 337976, written 360513
0.12 reads/s, 120.61 creates/s, 118.73 writes/s
Buffer pool hit rate 1000 / 1000

--------------
ROW OPERATIONS
--------------
1 queries inside InnoDB, 0 queries in queue
Main thread process no. 1062, id 1088448864, state: sleeping
Number of rows inserted 47593898, updated 5883, deleted 0, read 533664675
20473.87 inserts/s, 0.00 updates/s, 0.00 deletes/s, 2.95 reads/s

Das sieht schreibintensiv aus (INSERT: 20.000 rows/s ?)
120 pages/s schreiben übersetzt sich zu ca. 2MB/s.
Das ist ordentlich, aber nicht überwältigend. Immerhin
wird praktisch nicht gelesen, die 8GB RAM für den buffer
pool sind also gut angelegt.

Erst mal keine Auffälligkeiten. Es wäre interessant, den
InnoDB Status zu sehen, wenn die Problemquery läuft.

Zeig auch mal SHOW GLOBAL STATUS. Vielleicht ist da was zu
sehen. Query cache kannst du IMHO ausschalten. Du schreibst
ja praktisch nur.


XL
.



Relevant Pages

  • Re: Memory usage with many w3wp.exe processes
    ... For the moment we are moving forward with using only a single App Pool for ... customers in this configuration and use about 1.3 GB of RAM on each web ... we are using Windows Server 2003 Web Edition ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: 32-bit programs on Windows x64
    ... KERNEL address space which can be in the paged pool (which is not the same as the pageable ... conceivably care about) and the amount which can be in the non-paged pool (the limit ... pageable memory is all that matters in terms of user performance, ... if there is 8.0 GB of RAM on the system? ...
    (microsoft.public.vc.mfc)
  • Re: MS Access 2000/2002 bringing down asp site in 2003 Server
    ... running two gig RAM now. ... pool and both are still going down. ... > The beta hotfix does not seem to be published anywhere at microsoft.com. ...
    (microsoft.public.inetserver.iis)
  • Re: 32-bit programs on Windows x64
    ... if there is 8.0 GB of RAM on the system? ... each process gets a 4GB virtual memory space. ... the paged pool/nonpaged pool trade off ... pages can move between the paged pool ...
    (microsoft.public.vc.mfc)
  • Re: Texturing fails silently, objects are all white
    ... in 16-bit mode so multiplied by 2 to account for a back buffer, ... I would like where necessary to downsample, or output an error message ... >> couldn't find any way to detect failure. ... Should I used the default pool ...
    (microsoft.public.win32.programmer.directx.graphics)