lääängere Wartezeit auf Antwort vom SQL Server

vampsm

Member
Hallo an alle,
gleiches Thema / Problem wie alle anderen.....

beim Aufruf eines Web-Projektes dauert es ca. 4-5 Sekunden bis der SQL-Server reagiert ist nicht so lang, aber es nervt doch schon ein bisschen und wenn man andere Seiten sieht....:eek:

Mein Server scheint auch nur beim ersten Zugriff diese Denkpause zu haben :confused:

hier mal ein Projekt was schon Online ist.
http://www.smo-tec.de

Hintergrund

Ist ein V-Server (noch der kleinste bei Strato) aber derzeit sind noch nicht so viele Zugriffe, sodass der RAM eigentlich reicht ->> werde demnächst einen größeren nehmen.

Suse 11.1 Plesk und Webmin zur Verwaltung (Webmin kann richtig viel :rolleyes:)

derzeit 27 DB davon bleiben 12 aktiv in Benutzung, und 10 Projekte


Habe die Daten als PDF angehängt

meine my.conf habe ich so angepasst: (die aktiven Einstellungen)
Code:
# The MySQL server
[mysqld]
set-variable=local-infile=0
port = 3306
socket = /var/lib/mysql/mysql.sock
skip-locking
------------------ hier sind Änderungen von mir
key_buffer = 4M
max_allowed_packet = 2M
table_cache = 5M
sort_buffer_size = 512K
net_buffer_length = 8K
read_buffer_size = 512K
read_rnd_buffer_size = 512K
myisam_sort_buffer_size = 4M
query_cache_size = 20M
join_buffer_size = 2M
tmp_table_size = 32M
max_heap_table_size = 32M
thread_cache_size = 4
key_buffer_size = 15M
max_connections = 30
long_query_time = 2
low_priority_updates = 1
log_slow_queries=/var/log/mysqld.slow.log - die LOG wird nicht angelegt ????
------------------ hier sind Änderungen von mir
server-id = 1
[mysqldump]
quick
max_allowed_packet = 16M
[isamchk]
key_buffer = 20M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M
[myisamchk]
key_buffer = 20M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M
[mysqlhotcopy]
interactive-timeout
[mysqld_multi]
mysqld = /usr/bin/mysqld_safe
mysqladmin = /usr/bin/mysqladmin
log = /var/log/mysqld_multi.log

Die server-tunning.conf habe ich so angepasst (die wichtigsten und aktiven Einstellungen)
Code:
<IfModule prefork.c>
StartServers 2
MinSpareServers 2
MaxSpareServers 10
ServerLimit 150
MaxClients 150
MaxRequestsPerChild 10000
</IfModule>
# worker MPM
<IfModule worker.c>
StartServers 3
MinSpareThreads 25
MaxSpareThreads 75
ThreadLimit 64
MaxClients 150
ThreadsPerChild 25
MaxRequestsPerChild 10000
</IfModule>
KeepAlive On
MaxKeepAliveRequests 300 ------------------ hier sind Änderungen von mir
KeepAliveTimeout 5 ------------------ hier sind Änderungen von mir

free sagt
Code:
            total       used       free     shared    buffers     cached
Mem:       1048576     324772     723804          0          0          0
-/+ buffers/cache:     324772     723804
Swap:            0          0          0

./tuning-primer.sh sagt:
Code:
Uptime = 2 days 3 hrs 17 min 40 sec
Avg. qps = 2
Total Questions = 479048
Threads Connected = 1
Server has been running for over 48hrs.
It should be safe to follow these recommendations
SLOW QUERIES
The slow query log is enabled.
Current long_query_time = 2 sec.
You have 2 out of 479069 that take longer than 2 sec. to complete
Your long_query_time seems to be fine
BINARY UPDATE LOG
The binary update log is NOT enabled.
You will not be able to do point in time recovery
WORKER THREADS
Current thread_cache_size = 4
Current threads_cached = 3
Current threads_per_sec = 0
Historic threads_per_sec = 0
Your thread_cache_size is fine
MAX CONNECTIONS
Current max_connections = 30
Current threads_connected = 1
Historic max_used_connections = 12
The number of used connections is 40% of the configured maximum.
Your max_connections variable seems to be fine.
No InnoDB Support Enabled!
MEMORY USAGE
Max Memory Ever Allocated : 89 M
Configured Max Per-thread Buffers : 110 M
Configured Max Global Buffers : 45 M
Configured Max Memory Limit : 155 M
Physical Memory : 1.00 G
Max memory limit seem to be within acceptable norms
KEY BUFFER
Current MyISAM index space = 10 M
Current key_buffer_size = 15 M
Key cache miss rate is 1 : 47
Key buffer free ratio = 82 %
Your key_buffer_size seems to be fine
QUERY CACHE
Query cache is enabled
Current query_cache_size = 20 M
Current query_cache_used = 16 M
Current query_cache_limit = 1 M
Current Query cache Memory fill ratio = 81.28 %
Current query_cache_min_res_unit = 4 K
However, 13147 queries have been removed from the query cache due to lack of memory
Perhaps you should raise query_cache_size
MySQL won't cache query results that are larger than query_cache_limit in size
SORT OPERATIONS
Current sort_buffer_size = 512 K
Current read_rnd_buffer_size = 512 K
Sort buffer seems to be fine
JOINS
Current join_buffer_size = 2.00 M
You have had 1683 queries where a join could not use an index properly
You should enable "log-queries-not-using-indexes"
Then look for non indexed joins in the slow query log.
If you are unable to optimize your queries you may want to increase your
join_buffer_size to accommodate larger joins in one pass.
Note! This script will still suggest raising the join_buffer_size when
ANY joins not using indexes are found.
OPEN FILES LIMIT
Current open_files_limit = 65535 files
The open_files_limit should typically be set to at least 2x-3x
that of table_cache if you have heavy MyISAM usage.
Your open_files_limit value seems to be fine
TABLE CACHE
Current table_cache value = 32747 tables
You have a total of 3381 tables
You have 4293 open tables.
The table_cache value seems to be fine
TEMP TABLES
Current max_heap_table_size = 32 M
Current tmp_table_size = 32 M
Of 25810 temp tables, 41% were created on disk
Perhaps you should increase your tmp_table_size and/or max_heap_table_size
to reduce the number of disk-based temporary tables
Note! BLOB and TEXT columns are not allow in memory tables.
If you are using these columns raising these values might not impact your
ratio of on disk temp tables.
TABLE SCANS
Current read_buffer_size = 512 K
Current table scan ratio = 106 : 1
read_buffer_size seems to be fine
TABLE LOCKING
Current Lock Wait ratio = 0 : 479255
Your table locking seems to be fine

Und ./mysqltuner.pl sagt
Code:
-------- General Statistics --------------------------------------------------
[--] Skipped version check for MySQLTuner script
[OK] Currently running supported MySQL version 5.0.67-log
[OK] Operating on 32-bit architecture with less than 2GB RAM
-------- Storage Engine Statistics -------------------------------------------
[--] Status: -Archive -BDB -Federated -InnoDB -ISAM -NDBCluster
[--] Data in MyISAM tables: 12M (Tables: 3357)
[--] Data in MEMORY tables: 0B (Tables: 7)
[!!] Total fragmented tables: 44
-------- Performance Metrics -------------------------------------------------
[--] Up for: 2d 3h 21m 45s (479K q [2.593 qps], 9K conn, TX: 397M, RX: 65M)
[--] Reads / Writes: 76% / 24%
[--] Total buffers: 77.0M global + 3.7M per thread (30 max threads)
[OK] Maximum possible memory usage: 187.6M (18% of installed RAM)
[OK] Slow queries: 0% (2/479K)
[OK] Highest usage of available connections: 40% (12/30)
[OK] Key buffer size / total MyISAM indexes: 15.0M/10.8M
[OK] Key buffer hit rate: 97.9% (623K cached / 12K reads)
[OK] Query cache efficiency: 67.0% (235K cached / 351K selects)
[!!] Query cache prunes per day: 6143
[OK] Sorts requiring temporary tables: 0% (0 temp sorts / 10K sorts)
[!!] Joins performed without indexes: 1684
[!!] Temporary tables created on disk: 41% (18K on disk / 43K total)
[OK] Thread cache hit rate: 99% (47 created / 9K connections)
[!!] Table cache hit rate: 19% (4K open / 22K opened)
[OK] Open file limit used: 11% (7K/65K)
[OK] Table locks acquired immediately: 100% (182K immediate / 182K locks)
[!!] Connections aborted: 7%
-------- Recommendations -----------------------------------------------------
General recommendations:
Run OPTIMIZE TABLE to defragment tables for better performance
Adjust your join queries to always utilize indexes
When making adjustments, make tmp_table_size/max_heap_table_size equal
Reduce your SELECT DISTINCT queries without LIMIT clauses
Increase table_cache gradually to avoid file descriptor limits
Your applications are not closing MySQL connections properly
Variables to adjust:
query_cache_size (> 20M)
join_buffer_size (> 2.0M, or always use indexes with joins)
tmp_table_size (> 32M)
max_heap_table_size (> 32M)
table_cache (> 32747)


Welche werte muß ich effektiv anpassen um die Fehler-Meldungen / Hinweise in den Tuning Tools zu beseitigen??

Ist die Verzögerung beim Zugriff eine Einstellung-Sache oder Server-Leistung??

Und was muß ich noch tun damit diese log_slow_queries LOG angelegt wird und die Funktion überhaupt geht ???

Mit MYSQL Dumper mache ich täglich ein Backup und Optimierung der DB


DANKE an alle ;)
 

Attachments

Last edited by a moderator:
Hallo an alle,
beim Aufruf eines Web-Projektes dauert es ca. 4-5 Sekunden bis der SQL-Server reagiert ist nicht so lang, aber es nervt doch schon ein bisschen und wenn man andere Seiten sieht....:eek:

Du solltest nicht bei mySQL, sondern eher bei php/apache suchen.
 
Ja aber eine reine HTML Seite ist flotttt

Ja, aber eine reine HTML-Seite connected auch nicht auf die Datenbank. Ist die Verbindung persistent? Wenns am mySQL-Tuning liegen würde, wäre es ja "im Betrieb" auch langsam. Sind die Tabellen OK? Indizes korrekt und vernünftig gesetzt? Schonmal Abfragen mit Explain angeschaut?
 
Bei den Strato V-Servern kannste dich auf den Kopf stellen, sie bleiben einfach sterbenslangsam. Jedes kleinste Hosting-Paket ist da schneller - wirklich.
 
Die Maschine hat doch da nichts mit STRATO in dem SINN zu tun....

Hatte zuvor ein WEBHOST Paket von Strato -> die sind wirklich langsam (da die DB von anderen Servern geholt werden --- hat man mir gesagt.....)


Die Maschine ist sonst auch schnell erreichbar MAIL SSH Plesk Webmin ein Webmailer was auch immer... nur die DB Anwendungen zicken.
 
@vampsm:
Dieser Thread hat ca. 30-40 Follower (wie es neudeutsch so heißt).
Davon haben 10 das erste PDF angeklickt aber nur noch 3 das (wichtigere) tuning-primer-Protokoll.
Ich habe z.B. gar nichts davon angeklickt.
Evtl. liegt es einfach am Format, dass hier niemand konstruktive Vorschläge macht.

huschi.
 
beim Aufruf eines Web-Projektes dauert es ca. 4-5 Sekunden bis der SQL-Server reagiert
Blöde Frage: Wie hast Du das gemessen?
Oder genauer: Wie hast Du ausgeschlossen dass der Apache bzw. PHP nicht die Verzögerung auslösen?

huschi.
 
Kann man den Apache Server messen / prüfen?


EDIT

kann ich dazu "http://servername/server-status/" nehmen ?

und muß ich das so in der httpd.conf einbauen?

Code:
LoadModule status_module modules/mod_status.so
#
# ...
#

<IfModule mod_status.c>
ExtendedStatus On

<Location /server-status>
    SetHandler server-status
    Order deny,allow
    Deny from all
</Location>
</IfModule>

---------------------
hier vielleicht mal meine httpd.conf
Code:
#
# /etc/apache2/httpd.conf 
#
# This is the main Apache server configuration file.  It contains the
# configuration directives that give the server its instructions.
# See <URL:http://httpd.apache.org/docs-2.2/> for detailed information about
# the directives.

# Based upon the default apache configuration file that ships with apache,
# which is based upon the NCSA server configuration files originally by Rob
# McCool. This file was knocked together by Peter Poeml <poeml+apache@suse.de>.

# If possible, avoid changes to this file. It does mainly contain Include
# statements and global settings that can/should be overridden in the
# configuration of your virtual hosts.

# Quickstart guide:
# http://www.opensuse.org/Apache_Howto_Quickstart


# Overview of include files, chronologically:
#
# httpd.conf
#  | 
#  |-- uid.conf  . . . . . . . . . . . . . .  UserID/GroupID to run under
#  |-- server-tuning.conf  . . . . . . . . .  sizing of the server (how many processes to start, ...)
#  |-- sysconfig.d/loadmodule.conf . . . . .  [*] load these modules
#  |-- listen.conf . . . . . . . . . . . . .  IP adresses / ports to listen on
#  |-- mod_log_config.conf . . . . . . . . .  define logging formats
#  |-- sysconfig.d/global.conf . . . . . . .  [*] server-wide general settings
#  |-- mod_status.conf . . . . . . . . . . .  restrict access to mod_status (server monitoring)
#  |-- mod_info.conf . . . . . . . . . . . .  restrict access to mod_info
#  |-- mod_usertrack.conf  . . . . . . . . .  defaults for cookie-based user tracking
#  |-- mod_autoindex-defaults.conf . . . . .  defaults for displaying of server-generated directory listings
#  |-- mod_mime-defaults.conf  . . . . . . .  defaults for mod_mime configuration
#  |-- errors.conf . . . . . . . . . . . . .  customize error responses
#  |-- ssl-global.conf . . . . . . . . . . .  SSL conf that applies to default server _and all_ virtual hosts
#  |
#  |-- default-server.conf . . . . . . . . .  set up the default server that replies to non-virtual-host requests
#  |    |--mod_userdir.conf  . . . . . . . .  enable UserDir (if mod_userdir is loaded)
#  |    `--conf.d/apache2-manual?conf  . . .  add the docs ('?' = if installed)
#  |
#  |-- sysconfig.d/include.conf  . . . . . .  [*] your include files 
#  |                                             (for each file to be included here, put its name 
#  |                                              into APACHE_INCLUDE_* in /etc/sysconfig/apache2)
#  |
#  `-- vhosts.d/ . . . . . . . . . . . . . .  for each virtual host, place one file here
#       `-- *.conf . . . . . . . . . . . . .     (*.conf is automatically included)
#
#
# Files marked [*] are created from sysconfig upon server restart: instead of
# these files, you edit /etc/sysconfig/apache2



#  Filesystem layout:
#
# /etc/apache2/
#  |-- charset.conv  . . . . . . . . . . . .  for mod_auth_ldap
#  |-- conf.d/
#  |   |-- apache2-manual.conf . . . . . . .  conf that comes with apache2-doc
#  |   |-- mod_php4.conf . . . . . . . . . .  (example) conf that comes with apache2-mod_php4
#  |   `-- ... . . . . . . . . . . . . . . .  other configuration added by packages
#  |-- default-server.conf
#  |-- errors.conf
#  |-- httpd.conf  . . . . . . . . . . . . .  top level configuration file
#  |-- listen.conf
#  |-- magic
#  |-- mime.types -> ../mime.types
#  |-- mod_autoindex-defaults.conf
#  |-- mod_info.conf
#  |-- mod_log_config.conf
#  |-- mod_mime-defaults.conf
#  |-- mod_perl-startup.pl
#  |-- mod_status.conf
#  |-- mod_userdir.conf
#  |-- mod_usertrack.conf
#  |-- server-tuning.conf
#  |-- ssl-global.conf
#  |-- ssl.crl/  . . . . . . . . . . . . . .  PEM-encoded X.509 Certificate Revocation Lists (CRL)
#  |-- ssl.crt/  . . . . . . . . . . . . . .  PEM-encoded X.509 Certificates
#  |-- ssl.csr/  . . . . . . . . . . . . . .  PEM-encoded X.509 Certificate Signing Requests
#  |-- ssl.key/  . . . . . . . . . . . . . .  PEM-encoded RSA Private Keys
#  |-- ssl.prm/  . . . . . . . . . . . . . .  public DSA Parameter Files
#  |-- sysconfig.d/  . . . . . . . . . . . .  files that are created from /etc/sysconfig/apache2
#  |   |-- global.conf
#  |   |-- include.conf
#  |   `-- loadmodule.conf
#  |-- uid.conf
#  `-- vhosts.d/ . . . . . . . . . . . . . .  put your virtual host configuration (*.conf) here
#      |-- vhost-ssl.template
#      `-- vhost.template



### Global Environment ######################################################
#
# The directives in this section affect the overall operation of Apache,
# such as the number of concurrent requests.

# run under this user/group id
Include /etc/apache2/uid.conf

# - how many server processes to start (server pool regulation)
# - usage of KeepAlive
Include /etc/apache2/server-tuning.conf

# ErrorLog: The location of the error log file.
# If you do not specify an ErrorLog directive within a <VirtualHost>
# container, error messages relating to that virtual host will be
# logged here.  If you *do* define an error logfile for a <VirtualHost>
# container, that host's errors will be logged there and not here.
ErrorLog /var/log/apache2/error_log

# generated from APACHE_MODULES in /etc/sysconfig/apache2
Include /etc/apache2/sysconfig.d/loadmodule.conf

# IP addresses / ports to listen on
Include /etc/apache2/listen.conf

# predefined logging formats
Include /etc/apache2/mod_log_config.conf

# generated from global settings in /etc/sysconfig/apache2
Include /etc/apache2/sysconfig.d/global.conf

# optional mod_status, mod_info
Include /etc/apache2/mod_status.conf
Include /etc/apache2/mod_info.conf

# optional cookie-based user tracking
# read the documentation before using it!!
Include /etc/apache2/mod_usertrack.conf

# configuration of server-generated directory listings
Include /etc/apache2/mod_autoindex-defaults.conf

# associate MIME types with filename extensions
TypesConfig /etc/apache2/mime.types
DefaultType text/plain
Include /etc/apache2/mod_mime-defaults.conf

# set up (customizable) error responses
Include /etc/apache2/errors.conf

# global (server-wide) SSL configuration, that is not specific to 
# any virtual host
Include /etc/apache2/ssl-global.conf

# forbid access to the entire filesystem by default
<Directory />
    Options None
    AllowOverride None
    Order deny,allow
    Deny from all
</Directory>

# use .htaccess files for overriding,
AccessFileName .htaccess
# and never show them
<Files ~ "^\.ht">
    Order allow,deny
    Deny from all
</Files>

# List of resources to look for when the client requests a directory
DirectoryIndex index.html index.html.var index.shtml index.cfm index.php index.htm

### 'Main' server configuration #############################################
#
# The directives in this section set up the values used by the 'main'
# server, which responds to any requests that aren't handled by a
# <VirtualHost> definition.  These values also provide defaults for
# any <VirtualHost> containers you may define later in the file.
#
# All of these directives may appear inside <VirtualHost> containers,
# in which case these default settings will be overridden for the
# virtual host being defined.
#
Include /etc/apache2/default-server.conf


# Another way to include your own files
#
# The file below is generated from /etc/sysconfig/apache2,
# include arbitrary files as named in APACHE_CONF_INCLUDE_FILES and
# APACHE_CONF_INCLUDE_DIRS
Include /etc/apache2/sysconfig.d/include.conf


### Virtual server configuration ############################################
#
# VirtualHost: If you want to maintain multiple domains/hostnames on your
# machine you can setup VirtualHost containers for them. Most configurations
# use only name-based virtual hosts so the server doesn't need to worry about
# IP addresses. This is indicated by the asterisks in the directives below.
#
# Please see the documentation at
# <URL:http://httpd.apache.org/docs-2.2/vhosts/>
# for further details before you try to setup virtual hosts.
#
# You may use the command line option '-S' to verify your virtual host
# configuration.
#
Include /etc/apache2/vhosts.d/*.conf


# Note: instead of adding your own configuration here, consider 
#       adding it in your own file (/etc/apache2/httpd.conf.local)
#       putting its name into APACHE_CONF_INCLUDE_FILES in 
#       /etc/sysconfig/apache2 -- this will make system updates 
#       easier :) 
AddOutputFilter INCLUDES .shtml
AddType text/html .shtml
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
 
Last edited by a moderator:
Kann man den Apache Server messe / prüfen?

Ich würde folgende Sachen prüfen:

- Ist php als Modul oder als fastcgi eingebunden?

Falls ja:

- Ist in der php.ini mysql.allow_persistent = On gesetzt und die mysql.max_persistent und mysql.max_links genügend groß gesetzt?

Falls nein: Machen!

Der Server geht vor allem bei gleichzeitigen Requests in die Knie, drum würd ich da mal abchecken. Probier das ganze mit Apachebench mal zu messen:

Code:
ab -n 20 -c 2 http://www.smo-tec.de/

Da wird Dir schlecht. Und ich glaube nicht, dass das was mit SQL-Anfragen zu tun hat, wenn Du den parameter -i angibst holt er nur die Header und auch da ist die Kiste sehr langsam - da wird aber kein sql ausgeführt.
 
Meine php.ini MYSQL Bereich sieht so aus

Code:
[MySQL]

mysql.allow_persistent = Off
mysql.max_persistent = -1
mysql.max_links = -1
mysql.default_port =
mysql.default_socket =
mysql.default_host =
mysql.default_user =
mysql.default_password =
mysql.connect_timeout = 60
mysql.trace_mode = Off
Habe mal "mysql.allow_persistent" auf ON gesetzt und Apache neu gestartet -> KEINE Änderung

Der ab läuft nicht muß ich Apachebench erst installieren?
 
Last edited by a moderator:
OHHHH

ich habe jetzt auch mal MYSQL Server restart durchgeführt und siehe DA es scheint flotter zu sein

Hat also mysql.allow_persistent = On doch was gebracht

SUPER ich danke dir "webstoney" erst mal....
 
Last edited by a moderator:
mit ab2 geht der BENCH

ab2 -n 20 -c 2 http://www.smo-tec.de/

Server Software: Apache/2.2.10
Server Hostname: www.smo-tec.de
Server Port: 80

Document Path: /
Document Length: 81791 bytes

Concurrency Level: 2
Time taken for tests: 33.495 seconds
Complete requests: 20
Failed requests: 19
(Connect: 0, Receive: 0, Length: 19, Exceptions: 0)
Write errors: 0
Total transferred: 1642957 bytes
HTML transferred: 1635237 bytes
Requests per second: 0.60 [#/sec] (mean)
Time per request: 3349.520 [ms] (mean)
Time per request: 1674.760 [ms] (mean, across all concurrent requests)
Transfer rate: 47.90 [Kbytes/sec] received

Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.1 0 0
Processing: 1392 3300 7109.4 1720 33495
Waiting: 0 3179 7144.4 1696 33483
Total: 1392 3300 7109.4 1720 33495

Percentage of the requests served within a certain time (ms)
50% 1720
66% 1826
75% 1849
80% 1888
90% 2101
95% 33495
98% 33495
99% 33495
100% 33495 (longest request)

mit -i

ab2 -i -n 20 -c 2 http://www.smo-tec.de/

Server Software: Apache/2.2.10
Server Hostname: www.smo-tec.de
Server Port: 80

Document Path: /
Document Length: 0 bytes

Concurrency Level: 2
Time taken for tests: 30.084 seconds
Complete requests: 20
Failed requests: 0
Write errors: 0
Total transferred: 7720 bytes
HTML transferred: 0 bytes
Requests per second: 0.66 [#/sec] (mean)
Time per request: 3008.449 [ms] (mean)
Time per request: 1504.224 [ms] (mean, across all concurrent requests)
Transfer rate: 0.25 [Kbytes/sec] received

Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.0 0 0
Processing: 1206 2988 6382.0 1554 30084
Waiting: 1206 2987 6382.0 1554 30084
Total: 1206 2988 6382.0 1554 30084

Percentage of the requests served within a certain time (ms)
50% 1554
66% 1694
75% 1819
80% 1914
90% 1997
95% 30084
98% 30084
99% 30084
100% 30084 (longest request)

was kann ich aus dem Ergebnis entnehmen ?

Güldener Henkel, oder kann/sollte man was ändern? :confused:
 
Selbst wenn nur die Header abgerufen werden, ist kein Request besser als 1.2 Sekunden gewesen. Und die Hälfte der Requests waren langsamer als 1.5 Sekunden.

Im Prinzip brauchst du ein Profiling der Anwendung, damit du sehen kannst, wo die Zeit vergeht. In selbstgeschriebenen PHP-Anwendungen könnte man z.B.einfach an verschiedenen Stellen die Script-Laufzeit als HTML-Kommentar ausgeben, damit man eingrenzen kann, wo die Zeit bleibt.

Wenn du der Meinung bist, daß MySQL das Problem ist, dann würde ich das slow query log aktivieren und die long_query_time runtersetzten. Im Moment siehst du nur die Abfragen, die länger als 4 Sekunden laufen und das sieht erstmal gut aus (5 Stück). Also vielleicht mit einer Sekunde anfangen und schauen, ob da Abfragen bemängelt werden. Ob du an den Abfragen was tun kannst, steht dann auf einem anderen Blatt.
 
<Moderation>
Da sich das aktuelle Thema ziemlich weit vom MySQL-Tuning entfernt hat, habe ich dazu einen neuen Thread aufgemacht.
</Moderation>

huschi.
 
beim Aufruf eines Web-Projektes dauert es ca. 4-5 Sekunden bis der SQL-Server reagiert

Code:
Current table_cache value = 32747 tables
You have a total of 3381 tables
You have 4293 open tables
hast du SAP/R3 nach PHP/MySQL portiert?
Das wird nicht schneller ;-)

SCNR
 
Güldener Henkel, oder kann/sollte man was ändern?

Zuerst mal ein paar einfache Seiten erstellen:

- eine PHP-Seite die nur phpinfo() ausgibt - wie schnell ist die?

- eine PHP-Seite die auf die Datenbank connected - wie schnell ist die?

- eine Seite die eine einfache Abfrage durchführt - wie schnell ist die?

Ach ja, damit Dein slow-query-log benutzt wird, musst Du die Datei erstellen und den mysql-User als Eigentümer setzen

Code:
touch /var/log/mysqld.slow.log
chown mysql /var/log/mysqld.slow.log

mysql neu starten
 
Last edited by a moderator:
Hallo webstoney

mysqld.log hat folgende Fehlermeldungen bzw. Hinweise

-[Warning] option 'table_cache': unsigned value 5242880 adjusted to 524288
-[Warning] Changed limits: max_open_files: 65535 max_connections:30 table_cache: 32747
"dann kommt noch eine Notiz das ready und die Version mit dem PORT"

1. Meldung
table_cache hatte ich auf 5M -> geändert laut Meldung 524288 (sind das B? 0.5 MB so wenig )
----> die erste Fehlermeldung ist nach Neustart nicht mehr vorhanden (es wird schneller :):))

2.Meldung
max_open_files habe ich noch gar nicht in der my.conf ---> anlegen?
max_connections steht auf 30
table_cache: 32747 ---> das beisst sich doch mit der ersten Meldung?


und die mysqld.slow.log habe ich angelegt und hat auch folgenden Inhalt:

enthält die MYSQL Version port und Unix socket Path
und ich nehme an, der Anfang der Liste für Fehler:
"Time" "Id Command" "Argument"


sonst zum Glück nichts weiter auch nach mehrmaligem Starten von Projekten :)
EDIT
vielleicht sollte ich nochmal erwähnen das ich in der my.conf folgende Einstellungen sind zu slow....
long_query_time = 1 (vorher auf 2)
low_priority_updates = 1



eine PHP-Seite die nur phpinfo() ausgibt - wie schnell ist die?
der Aufruf dauert ein paar Millisekunden :)


eine PHP-Seite die auf die Datenbank connected - wie schnell ist die?
der Aufruf eines XTC Shop dauert cd 3 Sekunden bis die erste Reaktion erfolgt ----> ist aber schon wesentlich schneller geworden :D

#######################################
von peter86


hast du SAP/R3 nach PHP/MySQL portiert?

---> ich weiß nicht was du damit meinst


ABER ES WIRD AUF JEDEN FALL BESSER DANKE JUNGS
 
Last edited by a moderator:
1. Meldung
table_cache hatte ich auf 5M -> geändert laut Meldung 524288 (sind das B? 0.5 MB so wenig )

Das sind keine Bytes, das ist die Anzahl der Tabellen die gleichzeitig offen gehalten werden können. Du hast über 3000 Tabellen in der Datenbank bei 12MB Speicherplatz. Das sind 4kB/Tabelle, meist nicht, dass da irgendetwas schief läuft bzw. faul ist?
----> die erste Fehlermeldung ist nach Neustart nicht mehr vorhanden (es wird schneller :):))

Nicht wirklich, nur marginal.

2.Meldung
max_open_files habe ich noch gar nicht in der my.conf ---> anlegen?
max_connections steht auf 30
table_cache: 32747 ---> das beisst sich doch mit der ersten Meldung?

Der hatte mit 32K schon gepasst.

und die mysqld.slow.log habe ich angelegt und hat auch folgenden Inhalt:

enthält die MYSQL Version port und Unix socket Path
und ich nehme an, der Anfang der Liste für Fehler:
"Time" "Id Command" "Argument"

Kein SQL-Statement drin?

der Aufruf dauert ein paar Millisekunden :)
der Aufruf eines XTC Shop dauert cd 3 Sekunden bis die erste Reaktion erfolgt ----> ist aber schon wesentlich schneller geworden :D

Hier dauert er zwischen 3,5 und 4 Sekunden, das ist immer noch viel zu lang.
 
Back
Top