MySQL + RAM-größe

Alles, was MariaDB und MySQL betrifft, kann hier besprochen werden.

MySQL + RAM-größe

Postby TTP » 20. August 2007 22:14

kann mir jemand verraten, wie ich die max. Ramgröße von MySQL veränder ich find dazu nirgendswo Einstellungen.. (auch nicht bei Google, aber vielleicht bin ich zu blöde was zu finden)

Hab ne Datenbank mit über 16 Mio einträgen, aber egal was ich mache, die Datenbank frisst im MyISAM Format nicht mehr als 9,8 MB Ram...

Wenn ich eine MEMORY Datenbank anlege, dann sagt der mir auch relativ schnell "out of memory"...

Also wo kann man die einstellungen verändert? ^^
Place
ohne Apachefriends wär ich in meiner Entwicklung weiter zurück ;)
User avatar
TTP
 
Posts: 310
Joined: 30. August 2003 19:38
Location: Wolfsburg

Postby matt1234 » 22. August 2007 12:05

Auf was hastn keybuffersize (shell > key_buffer_size) eingestellt? Siehste wenn nicht default gesetzt ist in der my.ini von mysql oder über phpmyadmin falls installiert.
matt1234
 
Posts: 25
Joined: 12. March 2007 14:11

Postby TTP » 22. August 2007 14:58

ich hab das problem gelöst, hab einfach n setup von mysql.com genommen.. jetzt hat die DB mehr Ram...

buffer_size hat die xampp standart einstellung...

wie sollt ich das denn einstellen, damit das gut läuft und mysql nicht 10 MB sonder ca. 700 benutzt?
Place
ohne Apachefriends wär ich in meiner Entwicklung weiter zurück ;)
User avatar
TTP
 
Posts: 310
Joined: 30. August 2003 19:38
Location: Wolfsburg

Postby TTP » 22. August 2007 15:12

Meine MySQL Laufzeitinformationen sagen folgendes:

Handler_read_rnd 5.095
Handler_read_rnd_next 1.588 M
Created_tmp_disk_tables 130
Key_reads 770 k
Key_writes 720 k
Opened_tables 403
Table_locks_waited 1

das sind alle werte die bei mir Rot sind, wie kann ich das Optimieren?
muss dazu sagen es sind 9 Tabellen Gesamt 7.149.938 Einträge MyISAM latin1_swedish_ci 932,5 MiB Größe 0 Bytes Überhand

EDIT: Lief ja alles ganuz schnell als es nur so 2-3 Millionen Einträge waren, aber UPDATES dauer zur Zeit ehwig und da ändert sich städig irgendwas...
Ich mach Updates auch nur anhand der Tabellen ID und auch nur für jede Tabelle einzeln und trotzdem schafft die Datenbank nur 1-5 Updates pro Sekunde. Zu Anfang waren es 180 pro Sekunde :(
Last edited by TTP on 22. August 2007 15:16, edited 1 time in total.
Place
ohne Apachefriends wär ich in meiner Entwicklung weiter zurück ;)
User avatar
TTP
 
Posts: 310
Joined: 30. August 2003 19:38
Location: Wolfsburg

Postby matt1234 » 22. August 2007 15:13

na das kannste auch einfach in der my.ini my.cnf (von mysql) oder wie auch immer du sie genannt hast einstellen.

In your my.cnf file, under the [mysql.server] configuration section (or the [mysqld] section prior to MySQL 5.1), place the following:

key_buffer_size=128M
kannste natürlich anpassen
matt1234
 
Posts: 25
Joined: 12. March 2007 14:11

Postby matt1234 » 22. August 2007 15:14

TTP wrote:Meine MySQL Laufzeitinformationen sagen folgendes:

Handler_read_rnd 5.095
Handler_read_rnd_next 1.588 M
Created_tmp_disk_tables 130
Key_reads 770 k
Key_writes 720 k
Opened_tables 403
Table_locks_waited 1

das sind alle werte die bei mir Rot sind, wie kann ich das Optimieren?
muss dazu sagen es sind 9 Tabellen Gesamt 7.149.938 Einträge MyISAM latin1_swedish_ci 932,5 MiB Größe 0 Bytes Überhand


zu dem thema:

http://www.databasejournal.com/features/mysql/article.php/3367871

(langsamer server...)
matt1234
 
Posts: 25
Joined: 12. March 2007 14:11

Postby TTP » 22. August 2007 15:19

my.cnf hab ich gar nicht..(Benutz ja jetzt MySQL von einem neuen Setup) ich hab jetzt nur:

my-huge.ini
my-innodb-heavy4gb.ini
my-large.ini
my-medium.ini
my-small.ini
my-template.ini

wo find ich denn raus, welche benutzt wird?

Dein andern Link les ich gerad ^^
Place
ohne Apachefriends wär ich in meiner Entwicklung weiter zurück ;)
User avatar
TTP
 
Posts: 310
Joined: 30. August 2003 19:38
Location: Wolfsburg

Postby matt1234 » 22. August 2007 15:31

also wenn du das setup von mysql installiert hast, dann geh über start > programme > mysql > mysql server und starte den "MySQL Server Instance Config Wizard"

der legt dir dann automatisch ne my.ini in dein mysql verzeichnis (wo die restlichen beispiel inis liegen) an. die kannste dann editieren.
matt1234
 
Posts: 25
Joined: 12. March 2007 14:11

Postby TTP » 22. August 2007 16:41

Der Wizard geht bei mir nicht, öffnet sich nur ne Dosbox die sich auch gleich wieder schließt...
kP warum..

also hab ich jetzt wieder auf das Xampp-Mysql gewechselt und dort ein paar Einstellungen in der my.cnf gemacht, laut deinem Link..

Die Datenbank ist spürbar schneller (ca. 400%)
aber jetzt verbraucht MySQL Realen ram trotzdem nur 10 MB aber virtuellen Ram von ca. 300 MB...

kann man das auch irgendwie Einstellen, weil normalen Ram hab ich noch knappe 700 MB frei... oder regelt sowas mein Windows von selbst?
Place
ohne Apachefriends wär ich in meiner Entwicklung weiter zurück ;)
User avatar
TTP
 
Posts: 310
Joined: 30. August 2003 19:38
Location: Wolfsburg

Postby TTP » 22. August 2007 16:46

Der scheint auch nicht viel zu machen, mein Perfomance-Monitor zeigt mir an, das Ram-Auslastung und HDD-Auslastung bei unter 10% sind
CPU dagenen bei 100%
Das ist alles nur MySQL, da mein Programm nur >1% CPU zieht...

Das kann doch nicht nur an INSERT oder UPDATE Befehlen liegen oder?

NACHTRAG:
Ich mein bei 73 Mio geplanten Befehlen kein wunder, aber INSERTs schaft es 180 INSERT/s und bei UPDATE nur 1 bis 3 UPDATE/s

Weitere NACHTRAG:
Das löschen 2er nicht für die Updates benötigter Indezies hat mir auch noch eine Perfomancesteigerung gebracht..(falls das mal irgendjeman anderen Interessiert)
Ich leg die Indizies einfach nach den Updates wieder an, geht schneller als :)
Heißt in Zahlen bei Insert 180/s und bei Update 2 bis 12 /s

und ich hab die Größe der MEMORY Datenbanken erhöht und die ID-Tabelle in den Ram verschoben, das hat auch etwas perfomance gebracht :)

nochmal schönen Dank Matt
Place
ohne Apachefriends wär ich in meiner Entwicklung weiter zurück ;)
User avatar
TTP
 
Posts: 310
Joined: 30. August 2003 19:38
Location: Wolfsburg

Postby TTP » 22. August 2007 19:44

jetzt hab ich mich wohl zu früh gefreut..
Bei meinen Memory-Tables ist bei 16,0 MB Schluss und ich bekomm die Fehlermeldung "Full" obwohl ich 200 MB als Max eingestellt hab..

Hier meine Konfiguration:
Code: Select all
# Example MySQL config file for small systems.
#
# This is for a system with little memory (<= 64M) where MySQL is only used
# from time to time and it's important that the mysqld daemon
# doesn't use much resources.
#
# You can copy this file to
# /xampplite/mysql/bin/my.cnf to set global options,
# mysql-data-dir/my.cnf to set server-specific options (in this
# installation this directory is /xampplite/mysql/data) or
# ~/.my.cnf to set user-specific options.
#
# In this file, you can use all long options that a program supports.
# If you want to know which options a program supports, run the program
# with the "--help" option.

# The following options will be passed to all MySQL clients
[client]
# password       = your_password
port            = 3306
socket          = mysql

# Here follows entries for some specific programs

# The MySQL server
[mysqld]
basedir="D:/Eigene Dateien/Webserver/xampplite-win32-1.5.5/xampplite/mysql"
tmpdir="D:/Eigene Dateien/Webserver/xampplite-win32-1.5.5/xampplite/tmp"
datadir="D:/Eigene Dateien/Webserver/xampplite-win32-1.5.5/xampplite/mysql/data"

port            = 3306
socket          = mysql

old-passwords
character-set-server = latin1
collation-server = latin1_general_ci

skip-locking
key_buffer = 456M
max_allowed_packet = 4M
table_cache = 200M
sort_buffer_size = 1M
read_buffer_size = 1M
read_rnd_buffer_size = 1M
net_buffer_length = 16K
thread_stack = 512K

# Don't listen on a TCP/IP port at all. This can be a security enhancement,
# if all processes that need to connect to mysqld run on the same host.
# All interaction with mysqld must be made via Unix sockets or named pipes.
# Note that using this option without enabling named pipes on Windows
# (using the "enable-named-pipe" option) will render mysqld useless!
#
#skip-networking
server-id   = 1

# Uncomment the following if you want to log updates
#log-bin=/xampplite/mysql/data/mysql-bin

# Uncomment the following if you are NOT using BDB tables
skip-bdb

skip-innodb
# Uncomment the following if you are using InnoDB tables
#innodb_data_home_dir = /xampplite/mysql/data/
#innodb_data_file_path = ibdata1:10M:autoextend
#innodb_log_group_home_dir = /xampplite/mysql/data/
#innodb_log_arch_dir = /xampplite/mysql/data/
# You can set .._buffer_pool_size up to 50 - 80 %
# of RAM but beware of setting memory usage too high
#set-variable = innodb_buffer_pool_size=16M
#set-variable = innodb_additional_mem_pool_size=2M
# Set .._log_file_size to 25 % of buffer pool size
#set-variable = innodb_log_file_size=5M
#set-variable = innodb_log_buffer_size=8M
#innodb_flush_log_at_trx_commit=1
#set-variable = innodb_lock_wait_timeout=50

[mysqldump]
quick
max_allowed_packet=32M

[mysql]
no-auto-rehash
# Remove the next comment character if you are not familiar with SQL
#safe-updates

[isamchk]
key_buffer = 8M
sort_buffer_size = 8M

[myisamchk]
key_buffer = 8M
sort_buffer_size = 8M

[mysqlhotcopy]
interactive-timeout

[WinMySQLadmin]
Server="/xampplite/mysql/bin/mysqld.exe"
#user=root
#password=


Woran kann das liegen? Ram is noch mehr als genug frei...


Nachtrag:
Code: Select all
070822 21:20:38 [Warning] Changed limits: max_open_files: 2048  max_connections:
 100  table_cache: 969

steht in meinem Dos-Fenster...
woran liegt das?
Place
ohne Apachefriends wär ich in meiner Entwicklung weiter zurück ;)
User avatar
TTP
 
Posts: 310
Joined: 30. August 2003 19:38
Location: Wolfsburg


Return to MariaDB - MySQL

Who is online

Users browsing this forum: No registered users and 12 guests