Seiten aufruf total langsam, apache?

TAiS46

Registered User
Hallo,

meine Seite wird irgendwie immer langsame.
ImageUp.de - image hosting - Bilder Upload

kann es an der httpd.conf liegen?
Falsche einstellungen oder so?
Denke das zu viele auf die Seite zugreifen.
da ich Plesk habe steht in meiner httpd.conf nichts drinne unter /etc/apache2/httpd.conf.

Was könnte ich tun?

Danke, Gruss Simon
 
wir brauchen ein
Code:
top
und ein
Code:
cat /proc/user_beancounters

httpd Einstellungen musst du in der
Code:
/etc/httpd/conf/httpd.conf
oder
Code:
/etc/apache2/server-tuning.conf
machen.

Apache + MySQL Performance Tuning
 
Last edited by a moderator:
Top:
Code:
top - 16:28:49 up 3 days, 20:10,  2 users,  load average: 1.25, 1.04, 0.86
Tasks: 340 total,   1 running, 339 sleeping,   0 stopped,   0 zombie
Cpu(s): 12.0% us,  1.9% sy,  0.0% ni, 37.4% id, 48.8% wa,  0.0% hi,  0.0% si
Mem:   3101856k total,  3098136k used,     3720k free,    41396k buffers
Swap:  8008392k total,    98972k used,  7909420k free,  2332472k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
 8119 mysql     15   0  153m  58m 4996 S 23.2  1.9 290:49.54 mysqld
14200 root      18   0  1536  512  368 D  1.0  0.0   0:00.78 find
15892 root      16   0  2008 1100  736 R  1.0  0.0   0:00.11 top
 3362 teamspea  15   0 80096 4588 1320 S  0.3  0.1   2:39.64 server_linux
 1893 www-data  15   0 23664 7712 3632 S  0.3  0.2   0:00.15 apache2
 3841 www-data  15   0 23556 7536 3520 S  0.3  0.2   0:00.12 apache2
 3845 www-data  16   0 25960 7716 3628 S  0.3  0.2   0:00.12 apache2
 5926 www-data  15   0 23556 7580 3560 S  0.3  0.2   0:00.15 apache2
 5989 www-data  15   0 23668 7628 3612 S  0.3  0.2   0:00.13 apache2
 9322 www-data  15   0 23556 7668 3612 S  0.3  0.2   0:00.08 apache2
15667 www-data  16   0 26008 8124 4068 S  0.3  0.3   0:00.02 apache2
    1 root      16   0  1504  512  452 S  0.0  0.0   0:00.55 init
32327 root      15   0  1560  536  440 S  0.0  0.0   0:05.76 syslogd
32337 bind      16   0 73956  38m 1792 S  0.0  1.3  12:31.34 named
32351 root      21   0  2828  700  544 S  0.0  0.0   0:00.00 couriertcpd
32353 root      24   0  2596  616  472 S  0.0  0.0   0:00.00 courierlogger
32362 root      18   0  2828  624  544 S  0.0  0.0   0:00.00 couriertcpd
32364 root      18   0  2596  616  472 S  0.0  0.0   0:00.00 courierlogger
32371 root      15   0  2828  628  548 S  0.0  0.0   0:00.09 couriertcpd
32373 root      15   0  2724  776  624 S  0.0  0.0   0:00.06 courierlogger
32381 root      21   0  2828  700  544 S  0.0  0.0   0:00.00 couriertcpd
32383 root      23   0  2592  612  472 S  0.0  0.0   0:00.00 courierlogger
32390 list      17   0  7792 3976  808 S  0.0  0.1   0:00.00 mailmanctl
32436 list      16   0  7592 5140 1984 S  0.0  0.2   0:00.66 python
32437 list      15   0  7512 5284 1984 S  0.0  0.2   0:00.69 python
32438 list      16   0  7620 5224 1984 S  0.0  0.2   0:00.58 python
32439 list      16   0  7508 5228 1984 S  0.0  0.2   0:00.59 python
32440 list      16   0  7600 5196 1984 S  0.0  0.2   0:00.65 python
32441 list      16   0  7652 5356 1984 S  0.0  0.2   0:00.66 python
32442 list      16   0  7508 5060 1984 S  0.0  0.2   0:00.62 python
32443 list      15   0  7508 5252 1984 S  0.0  0.2   0:00.20 python
32498 root      16   0 95812  41m  616 S  0.0  1.4   3:45.85 nscd
32550 qmails    15   0  1548  468  384 S  0.0  0.0   0:03.79 qmail-send
32552 root      16   0  2096  716  604 S  0.0  0.0   0:00.05 xinetd
32553 qmaill    15   0  1500  444  384 S  0.0  0.0   0:00.33 splogger
32554 root      15   0  1528  352  272 S  0.0  0.0   0:00.25 qmail-lspawn
32555 qmailr    16   0  1524  368  284 S  0.0  0.0   0:00.00 qmail-rspawn
32556 qmailq    15   0  1492  328  268 S  0.0  0.0   0:00.20 qmail-clean
32604 popuser   21   0 23344  19m 1984 S  0.0  0.6   0:00.46 spamd
32613 popuser   18   0 23344  18m  600 S  0.0  0.6   0:00.00 spamd
 1609 root      16   0 35512 4572 3068 S  0.0  0.1   0:00.03 httpsd
 1693 psaadm    15   0 43156  24m  16m S  0.0  0.8   0:12.48 httpsd


cat /proc/user_beancounters:
Code:
Version: 2.5
       uid  resource           held    maxheld    barrier      limit    failcnt
       104: kmemsize       45182207   45390973   59257582   65183340          0
            lockedpages           0          0       2893       2893          0
            privvmpages      402546     402607     619122     681034          0
            shmpages           6517       6517      61912      61912          0
            dummy                 0          0          0          0          0
            numproc             565        571       1446       1446          0
            physpages        123784     123808          0 2147483647          0
            vmguarpages           0          0     619122 2147483647          0
            oomguarpages     129480     129504     619122 2147483647          0
            numtcpsock          318        320       2000       2000          0
            numflock             11         11       1000       1100          0
            numpty                2          2        144        144          0
            numsiginfo            0          1       1024       1024          0
            tcpsndbuf      10713888   10931616   13829711   19752527       1483
            tcprcvbuf       1724212    1729248   13829711   19752527          0
            othersockbuf      39804      43184    6914855   12837671          0
            dgramrcvbuf           0       1212    6914855    6914855          0
            numothersock        395        407       1446       1446          0
            dcachesize            0          0   12938190   13326336          0
            numfile           10781      10894      23136      23136          0
            dummy                 0          0          0          0          0
            dummy                 0          0          0          0          0
            dummy                 0          0          0          0          0
            numiptent            14         14 2147483647 2147483647          0

Habe keine Ordner namens: /etc/httpd/conf/ oder eine Datei namens /etc/apache2/server-tuning.conf
 
Code:
48.8% wa
und mysqld hat 23% CPU load

Tuning-Primer.sh Script laufen lassen und zeig uns mal die /etc/my.cnf

Wieso hast du keine httpd.conf oder server-tuning.conf (Apache 2.x)?

Du solltest MySQL Variables optimieren und auch die httpd Einstellungen.
 
Last edited by a moderator:
Tuning-Primer.sh:

Code:
MySQL Version 4.1.11-Debian_4sarge7-log i386

Uptime = 0 days 0 hrs 7 min 41 sec
Avg. qps = 45
Total Questions = 21145
Threads Connected = 187

Warning: Server has not been running for at least 48hrs.
It may not be safe to use these recommendations

To find out more information on how each of these
runtime variables effects performance visit:
http://dev.mysql.com/doc/refman/4.1/en/server-system-variables.html

SLOW QUERIES
Current long_query_time = 5 sec.
You have 0 out of 21157 that take longer than 5 sec. to complete
The slow query log is enabled.
Your long_query_time seems to be fine

WORKER THREADS
Current thread_cache_size = 512
Current threads_cached = 6
Current threads_per_sec = 0
Historic threads_per_sec = 0
Your thread_cache_size is fine

MAX CONNECTIONS
Current max_connections = 500
Current threads_connected = 185
Historic max_used_connections = 190
The number of used connections is 38% of the configured maximum.
Your max_connections variable seems to be fine.

MEMORY USAGE
Max Memory Ever Allocated : 525 M
Configured Max Per-thread Buffers : 1 G
Configured Max Global Buffers : 26 M
Configured Max Memory Limit : 1 G
Total System Memory : 10.59 G
Max memory limit seem to be within acceptable norms

KEY BUFFER
Current MyISAM index space = 44 M
Current key_buffer_size = 8 M
Key cache miss rate is 1 : 56
Key buffer fill ratio = 27.00 %
Your key_buffer_size seems to be too high.
Perhaps you can use these resources elsewhere

QUERY CACHE
Query cache is enabled
Current query_cache_size = 16 M
Current query_cache_used = 21 K
Current query_cach_limit = 1 M
Current Query cache fill ratio = .13 %
Your query_cache_size seems to be too high.
Perhaps you can use these resources elsewhere
MySQL won't cache query results that are larger than query_cache_limit in size

SORT OPERATIONS
Current sort_buffer_size = 2 M
Current record/read_rnd_buffer_size = 256 K
Sort buffer seems to be fine

JOINS
Current join_buffer_size = 132.00 K
You have had 0 queries where a join could not use an index properly
Your joins seem to be using indexes properly

OPEN FILES LIMIT
Current open_files_limit = 2510 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 = 64 tables
You have a total of 404 tables
You have 64 open tables.
Current table_cache hit rate is 14%, while 100% of your table cache is in use
You should probably increase your table_cache

TEMP TABLES
Current max_heap_table_size = 16 M
Current tmp_table_size = 32 M
Of 1 temp tables, 0% were created on disk
Effective in-memory tmp_table_size is limited to max_heap_table_size.
Created disk tmp tables ratio seems fine

TABLE SCANS
Current read_buffer_size = 128 K
Current table scan ratio = 990 : 1
read_buffer_size seems to be fine

TABLE LOCKING
Current Lock Wait ratio = 1 : 70
You may benefit from selective use of InnoDB.
If you have long running SELECT's against MyISAM tables and perform
frequent updates consider setting 'low_priority_updates=1'

my.cnf

Code:
#
# The MySQL database server configuration file.
#
# You can copy this to one of:
# - "/etc/mysql/my.cnf" to set global options,
# - "/var/lib/mysql/my.cnf" to set server-specific options or
# - "~/.my.cnf" to set user-specific options.
#
# One can use all long options that the program supports.
# Run program with --help to get a list of available options and with
# --print-defaults to see which it would actually understand and use.
#
# For explanations see
# http://dev.mysql.com/doc/mysql/en/server-system-variables.html

# This will be passed to all mysql clients
# It has been reported that passwords should be enclosed with ticks/quotes
# escpecially if they contain "#" chars...
# Remember to edit /etc/mysql/debian.cnf when changing the socket location.
[client]
port            = 3306
socket          = /var/run/mysqld/mysqld.sock

# Here is entries for some specific programs
# The following values assume you have at least 32M ram

# This was formally known as [safe_mysqld]. Both versions are currently parsed.
[mysqld_safe]
socket          = /var/run/mysqld/mysqld.sock
nice            = 0

skip-bdb

set-variable = innodb_buffer_pool_size=2M
set-variable = innodb_additional_mem_pool_size=500K
set-variable = innodb_log_buffer_size=500K
set-variable = innodb_thread_concurrency=2
[mysqld]
set-variable=local-infile=0
#
# * Basic Settings
#
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
#
# For compatibility to other Debian packages that still use
# libmysqlclient10 and libmysqlclient12.
old_passwords   = 1
#
# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
# bind-address          = 127.0.0.1
#
# * Fine Tuning
#
key_buffer              = 8M
max_allowed_packet      = 16M
thread_stack            = 128K
ft_min_word_len         = 3

thread_cache_size = 512
#
# * Query Cache Configuration
#
query_cache_limit       = 1048576
query_cache_size        = 16777216
query_cache_type        = 1
#
# * Logging and Replication
#
# Both location gets rotated by the cronjob.
# Be aware that this log type is a performance killer.
#log            = /var/log/mysql.log
#log            = /var/log/mysql/mysql.log
#
# Error logging goes to syslog. This is a Debian improvement :)
#
# Here you can see queries with especially long duration
log-slow-queries        = /var/log/mysql/mysql-slow.log
long_query_time = 5
#
# The following can be used as easy to replay backup logs or for replication.
#server-id              = 1
#log-bin                = /var/log/mysql/mysql-bin.log
# See /etc/mysql/debian-log-rotate.conf for the number of files kept.
max_binlog_size         = 104857600
#binlog-do-db           = include_database_name
#binlog-ignore-db       = include_database_name
#
# * BerkeleyDB
#
# According to an MySQL employee the use of BerkeleyDB is now discouraged
# and support for it will probably cease in the next versions.
skip-bdb
#
# * InnoDB
#
# InnoDB is enabled by default with a 10MB datafile in /var/lib/mysql/.
# Read the manual for more InnoDB related options. There are many!
#
# * Security Features
#
# Read the manual, too, if you want chroot!
# chroot = /var/lib/mysql/
#
# If you want to enable SSL support (recommended) read the manual or my
# HOWTO in /usr/share/doc/mysql-server/SSL-MINI-HOWTO.txt.gz
# ssl-ca=/etc/mysql/cacert.pem
# ssl-cert=/etc/mysql/server-cert.pem
# ssl-key=/etc/mysql/server-key.pem


max_connections=500
set-variable = innodb_buffer_pool_size=2M
set-variable = innodb_additional_mem_pool_size=500K
set-variable = innodb_log_buffer_size=500K
set-variable = innodb_thread_concurrency=2
[mysqldump]
quick
quote-names
max_allowed_packet      = 16M

[mysql]
#no-auto-rehash # faster start of mysql but no tab completition

[isamchk]
key_buffer              = 16M

[myisamchk]
ft_min_word_len         = 3

Habe Apache2 ja.
Habe höchstens ne apache2.conf?!
 
in der my.cnf unter
Code:
key_buffer              = 8M
max_allowed_packet      = 16M
thread_stack            = 128K
ft_min_word_len         = 3

thread_cache_size = 512

table_cache = 512
low_priority_updates=1

hinzufügen
 
Is gemacht.

Code:
MySQL Version 4.1.11-Debian_4sarge7-log i386

Uptime = 0 days 0 hrs 2 min 17 sec
Avg. qps = 48
Total Questions = 6576
Threads Connected = 119

Warning: Server has not been running for at least 48hrs.
It may not be safe to use these recommendations

To find out more information on how each of these
runtime variables effects performance visit:
http://dev.mysql.com/doc/refman/4.1/en/server-system-variables.html

SLOW QUERIES
Current long_query_time = 5 sec.
You have 0 out of 6625 that take longer than 5 sec. to complete
The slow query log is enabled.
Your long_query_time seems to be fine

WORKER THREADS
Current thread_cache_size = 512
Current threads_cached = 0
Current threads_per_sec = 0
Historic threads_per_sec = 0
Your thread_cache_size is fine

MAX CONNECTIONS
Current max_connections = 500
Current threads_connected = 120
Historic max_used_connections = 120
The number of used connections is 24% of the configured maximum.
Your max_connections variable seems to be fine.

MEMORY USAGE
Max Memory Ever Allocated : 341 M
Configured Max Per-thread Buffers : 1 G
Configured Max Global Buffers : 26 M
Configured Max Memory Limit : 1 G
Total System Memory : 10.59 G
Max memory limit seem to be within acceptable norms

KEY BUFFER
Current MyISAM index space = 44 M
Current key_buffer_size = 8 M
Key cache miss rate is 1 : 35
Key buffer fill ratio = 14.00 %
Your key_buffer_size seems to be too high.
Perhaps you can use these resources elsewhere

QUERY CACHE
Query cache is enabled
Current query_cache_size = 16 M
Current query_cache_used = 16 K
Current query_cach_limit = 1 M
Current Query cache fill ratio = .09 %
Your query_cache_size seems to be too high.
Perhaps you can use these resources elsewhere
MySQL won't cache query results that are larger than query_cache_limit in size

SORT OPERATIONS
Current sort_buffer_size = 2 M
Current record/read_rnd_buffer_size = 256 K
No sort operations have been performed
Sort buffer seems to be fine

JOINS
Current join_buffer_size = 132.00 K
You have had 0 queries where a join could not use an index properly
Your joins seem to be using indexes properly

OPEN FILES LIMIT
Current open_files_limit = 2510 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 = 512 tables
You have a total of 404 tables
You have 412 open tables.
The table_cache value seems to be fine

TEMP TABLES
Current max_heap_table_size = 16 M
Current tmp_table_size = 32 M
Of 0 temp tables, 0% were created on disk
Effective in-memory tmp_table_size is limited to max_heap_table_size.
Created disk tmp tables ratio seems fine

TABLE SCANS
Current read_buffer_size = 128 K
Current table scan ratio = 881 : 1
read_buffer_size seems to be fine

TABLE LOCKING
Current Lock Wait ratio = 1 : 51
You may benefit from selective use of InnoDB.

Glaube is schon besser. Im top steht jedenfalls mysql nicht mehr mit 20% drinne
 
Last edited by a moderator:
Code:
TABLE CACHE
Current table_cache value = 512 tables
You have a total of 404 tables
You have 412 open tables.
The table_cache value seems to be fine
table_cache sollte mindestens so hoch sein wie die Anzahl der Tables, also 404

Um RAM zu sparen kannst du ja laut Script einige Variables kleiner machen wie z.B query_cache und dafür table_cache = 1024

in der httpd.conf (wenn du sie denn findest) würde ich
Code:
Timeout 30
KeepAlive On
MaxKeeAliveRequests 1000
KeepAliveTimeout 2
verwenden ect.

Apache scheint nicht optimal konfiguriert zu sein.
 
Last edited by a moderator:
Habe mal in der apache2.conf diese einstellungen vorgenommen.
Meiner Meinung nach läufts nun bischen schneller.
Aber könnte glaub noch nen bischen schneller gehen ..
 
Last edited by a moderator:
ja, Timeout bekomme ich nun nicht mehr. Antwortzeit ist aber immer noch zu hoch.

prefork oder worker Einstellungen solltest du auch nochmal überprüfen.
Code:
<IfModule prefork.c>
Code:
<IfModule worker.c>
poste mal die prefork und worker Einstellungen.

Dann solltest du noch Apache Module überprüfen und ausklammern was du nicht benötigst.
 
Last edited by a moderator:
Code:
<IfModule prefork.c>
StartServers         2
MinSpareServers      30
MaxSpareServers      120
MaxClients          256
MaxRequestsPerChild  32
</IfModule>

Code:
<IfModule worker.c>
StartServers         2
MaxClients         150
MinSpareThreads     25
MaxSpareThreads     75
ThreadsPerChild     25
MaxRequestsPerChild  0
</IfModule>
 
kannst du gleich mal ändern. (MaxRequestsPerChild sollte 0 (= unendlich) oder >4000 sein, sonst muss Apache ständig neue Kindsprozesse (Childs) forken.)
Code:
<IfModule prefork.c>
StartServers       [COLOR="Red"]5[/COLOR]
MinSpareServers    [COLOR="Red"]5[/COLOR]
MaxSpareServers    [COLOR="Red"]10[/COLOR]
ServerLimit       [COLOR="Red"]275[/COLOR]
MaxClients        [COLOR="Red"]275[/COLOR]
MaxRequestsPerChild  [COLOR="Red"]8000[/COLOR]
</IfModule>

Edit, server limit + max clients auf 275 erhöht!


Code:
<IfModule worker.c>
StartServers         2
MaxClients         [COLOR="Red"]275[/COLOR]
MinSpareThreads     25
MaxSpareThreads     75
ThreadsPerChild     25
MaxRequestsPerChild  [COLOR="Red"]8000[/COLOR]
</IfModule>

danach schauen wir mal..
 
Last edited by a moderator:
noch zu langsam.

probiere mal
Code:
<IfModule prefork.c>
StartServers       5
MinSpareServers    5
MaxSpareServers    10
ServerLimit       [COLOR="Red"]400[/COLOR]
MaxClients        [COLOR="Red"]400[/COLOR]
MaxRequestsPerChild  8000
</IfModule>

und
Code:
Timeout 30
KeepAlive On
MaxKeeAliveRequests [COLOR="Red"]200[/COLOR]
KeepAliveTimeout 2

und ein neues
Code:
top

Apache Module müssen wir auch noch optimieren. Und tuning-primer.sh Script solltest du auch regelmäßig laufen lassen.
 
Last edited by a moderator:
Scheint wohl immer noch nicht Perfekt?
km21803-04:/usr/bin# tuning-primer.sh
-bash: fork: Cannot allocate memory

Mysql macht auch Fehler

Code:
top - 18:53:36 up 3 days, 22:34,  5 users,  load average: 1.30, 2.54, 1.69
Tasks: 447 total,   2 running, 444 sleeping,   0 stopped,   1 zombie
Cpu(s):  3.7% us,  3.0% sy,  0.0% ni, 88.5% id,  4.7% wa,  0.0% hi,  0.0% si
Mem:   3101856k total,  3097164k used,     4692k free,    14216k buffers
Swap:  8008392k total,    85612k used,  7922780k free,  2318660k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
 9632 mysql     15   0  143m  44m 4568 S  3.0  1.5   5:43.16 mysqld
19969 root      16   0  2140 1164  736 R  1.3  0.0   0:00.71 top
20170 www-data  16   0     0    0    0 Z  1.0  0.0   0:00.03 apache2 <defunct>
 3351 teamspea  15   0 80096 4568 1316 S  0.3  0.1   4:01.63 server_linux
 3352 teamspea  15   0 80096 4568 1316 S  0.3  0.1   3:24.15 server_linux
 3361 teamspea  15   0 80096 4568 1316 S  0.3  0.1   2:21.36 server_linux
 3362 teamspea  15   0 80096 4568 1316 S  0.3  0.1   2:47.73 server_linux
 3363 teamspea  15   0 80096 4568 1316 S  0.3  0.1   2:27.88 server_linux
 3375 teamspea  15   0 80096 4568 1316 S  0.3  0.1   0:45.73 server_linux
19656 www-data  15   0 23876 8052 3644 S  0.3  0.3   0:00.06 apache2
19693 www-data  15   0 24276 8732 3824 S  0.3  0.3   0:00.12 apache2
19703 www-data  16   0 26032 8892 4508 S  0.3  0.3   0:00.04 apache2
19790 www-data  16   0 25312 7880 3540 S  0.3  0.3   0:00.05 apache2
19815 www-data  16   0 25228 8700 4368 S  0.3  0.3   0:00.02 apache2
19822 www-data  16   0 23828 8008 3632 S  0.3  0.3   0:00.02 apache2
19846 www-data  15   0 25640 8252 3844 S  0.3  0.3   0:00.07 apache2
19861 www-data  15   0 23696 8008 3612 S  0.3  0.3   0:00.06 apache2
19911 www-data  15   0 25784 7896 3552 S  0.3  0.3   0:00.06 apache2
19913 www-data  15   0 24572 8600 4184 S  0.3  0.3   0:00.05 apache2
19972 www-data  16   0 23696 8176 3692 S  0.3  0.3   0:00.06 apache2
20014 www-data  16   0 25648 9128 4792 S  0.3  0.3   0:00.02 apache2
20041 www-data  16   0 25944 7940 3596 S  0.3  0.3   0:00.02 apache2
20118 www-data  16   0 23756 7848 3540 S  0.3  0.3   0:00.01 apache2
20134 www-data  16   0 25876 8052 3624 S  0.3  0.3   0:00.02 apache2
20169 www-data  16   0 23844 7848 3540 S  0.3  0.3   0:00.01 apache2
20188 www-data  16   0 23588 7940 3612 S  0.3  0.3   0:00.02 apache2
    1 root      16   0  1504  512  452 S  0.0  0.0   0:00.55 init
32327 root      16   0  1560  536  440 S  0.0  0.0   0:05.88 syslogd
32337 bind      16   0 73956  38m 1792 S  0.0  1.3  12:33.43 named
32351 root      21   0  2828  700  544 S  0.0  0.0   0:00.00 couriertcpd
32353 root      24   0  2596  616  472 S  0.0  0.0   0:00.00 courierlogger
32362 root      18   0  2828  624  544 S  0.0  0.0   0:00.00 couriertcpd
32364 root      18   0  2596  616  472 S  0.0  0.0   0:00.00 courierlogger
32371 root      15   0  2828  628  548 S  0.0  0.0   0:00.11 couriertcpd
32373 root      15   0  2724  776  624 S  0.0  0.0   0:00.09 courierlogger
32381 root      21   0  2828  700  544 S  0.0  0.0   0:00.00 couriertcpd
32383 root      23   0  2592  612  472 S  0.0  0.0   0:00.00 courierlogger
32390 list      17   0  7792 3976  808 S  0.0  0.1   0:00.00 mailmanctl
32436 list      16   0  7592 5140 1984 S  0.0  0.2   0:00.68 python
32437 list      16   0  7512 5284 1984 S  0.0  0.2   0:00.71 python
32438 list      16   0  7620 5224 1984 S  0.0  0.2   0:00.60 python
32439 list      16   0  7508 5228 1984 S  0.0  0.2   0:00.61 python
 
Last edited by a moderator:
Swap ist noch eine wenig zu hoch. Ansonsten sieht es schonmal wesentlich besser aus. Hats du was verändert? Eben lief die Seite noch sau schnell.

Ja, in der my.cnf haben wir max_connections = 500 und in der Apache .conf haben wir MaxClients 400. Dein RAM reicht nicht aus für 400 max_connections. Daher musst du die Buffers kleiner machen.

probier mal
Code:
<IfModule prefork.c>
StartServers       5
MinSpareServers    5
MaxSpareServers    10
ServerLimit       375
MaxClients        375
MaxRequestsPerChild  8000
</IfModule>

in der my.cnf
Code:
key_buffer = 2M
sort_buffer = 128K
read_buffer = 128K
max_connections = 375

key_buffer + ((sort_buffer + read_buffer) x max_connections) = RAM

2048 + ((128 + 128) x 375) = 2048 + 96000 = 98 MB RAM (MySQL)

Lass tuning-primer.sh laufen und mache alle Variablen kleiner welche als zu gross angezeigt werden
 
Last edited by a moderator:
machen wir mal folgendes, bei der Anzahl der Verbindungen richten wir uns nach Tuning-Primer Script. Den Wert für Historic max_used_connections übernehmen wir in der .conf und my.cnf

Beispiel Tuning-Primer Script
Code:
MAX CONNECTIONS
Current max_connections = 500
Current threads_connected = 120
[COLOR="Blue"]Historic max_used_connections = 300[/COLOR]
dann nehmen wir diese 300 auch in der .conf
Code:
Timeout 30
KeepAlive On
MaxKeeAliveRequests 200
KeepAliveTimeout 2

<IfModule prefork.c>
StartServers       2
MinSpareServers    5
MaxSpareServers    10
ServerLimit       [COLOR="Blue"]300[/COLOR]
MaxClients       [COLOR="Blue"] 300[/COLOR]
MaxRequestsPerChild  8000
</IfModule>
und in der my.cnf
Code:
key_buffer = 2M
sort_buffer = 128K
read_buffer = 128K
max_connections = [COLOR="Blue"]300[/COLOR]
wenn der RAM nicht ausreicht müssen die Buffers noch kleiner gemacht werden z.B.
Code:
key_buffer = 512K
sort_buffer = 100K
read_buffer = 50K
max_connections = [COLOR="Blue"]300[/COLOR]
und nicht vergessen alle nicht benötigten Apache Module auszuklammern! Und lasse auch mal das vpsmem.sh Script laufen.
 
Last edited by a moderator:
Wo finde ich denn die apache Module und woher weiss ich welche unwichtig sind?

Einstellungen habe ich nun wie oben und es kommt immer noch Cannot allocate memory!
 
Last edited by a moderator:
Back
Top