ich betreibe ne flirtsite. Da Besucherzahlen immer weiter stiegen reichte, der Server nicht mehr aus. Das lag hauptsächlich am Apache. Dieser lastete den Server stark aus.
Nach dem Serverumzug ist nun auf dem neuen System der Apache nicht mehr derjenige Dienst der am meisten CPU-Last frisst:
AMD Opteron 1218 Dual Core
4 GB DDR2-667 RAM
Dafür aber der Mysql-Server (htop):
MySQL-Dienst: ca 20% - 30% CPU Auslastung
Apache-Dienst ca. 5%
Zu meinem System:
Debian Etch, Apache2.2, Mysql-Server5.0
Hier meine my.cnf
Code: Alles auswählen
[client]
character_set = utf8
default-character-set = utf8
port = 3306
socket = /var/run/mysqld/mysqld.sock
# This was formally known as [safe_mysqld]. Both versions are currently parsed.
[mysqld_safe]
socket = /var/run/mysqld/mysqld.sock
nice = 0
[mysqld]
#
# * Basic Settings
#
character-set-server = utf8
default-character-set = utf8
init-connect='SET NAMES utf8'
user = mysql
pid-file = /var/run/mysqld/mysqld.pid
socket = /var/run/mysqld/mysqld.sock
port = 3306
basedir = /usr
datadir = /var/lib/mysql
tmpdir = /tmp
language = /usr/share/mysql/english
skip-external-locking
# old_passwords = 1
key_buffer = 128M
max_allowed_packet = 16M
thread_stack = 128K
thread_cache_size = 32
#max_connections = 100
table_cache = 512
thread_concurrency = 2
connect_timeout = 10
interactive_timeout = 100
wait_timeout = 15
#
# * Query Cache Configuration
#
query_cache_limit = 1M
query_cache_size = 32M
query_cache_type = 1
#
# * Logging and Replication
#
# Here you can see queries with especially long duration
log_slow_queries = /var/log/mysql/mysql-slow.log
long_query_time = 2
skip-bdb
[mysqldump]
quick
quote-names
max_allowed_packet = 16M
[mysql]
#no-auto-rehash # faster start of mysql but no tab completition
[isamchk]
key_buffer = 64M
sort_buffer = 64M
read_buffer = 16M
write_buffer = 16M
!includedir /etc/mysql/conf.d/