apache langsam bsi garnicht bei "KeepAlive On"

conym18

Member
Hallo zusammen,

ich habe jetzt mehrere dokus und infos durchgelesen.
in der zusammenfassung konnte ich rauslesen, dass ich bei der server-tuning.conf das KeepAlive auf On stellen sollte, statt es auf Off zu lassen.

wenn ich dies jedoch mache, dann ist der seitenaufruf total langsam bzw. der IE meldet die normale "Seite kann nicht angezeigt" werden Seite.

Hier mal ein paar Conf's:
(KeepAlive hab ich mittlerweile erstmal wieder auf Off gestellt, dass die Seiten schnell laufen)

server-tuning.conf
Code:
# prefork MPM
<IfModule prefork.c>
        StartServers            1
        MinSpareServers         1
        MaxSpareServers         7
        ServerLimit            30
        MaxClients             30
        MaxRequestsPerChild   5000
</IfModule>

# worker MPM
<IfModule worker.c>
        StartServers            1
        MinSpareThreads         10
        MaxSpareThreads         20
        ThreadLimit         64
        MaxClients             15
        ThreadsPerChild         15
        MaxRequestsPerChild   1000
</IfModule>
KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 15


top:
Code:
top - 15:24:17 up 27 days, 51 min,  2 users,  load average: 0.14, 0.07, 0.05
Tasks:  36 total,   1 running,  35 sleeping,   0 stopped,   0 zombie
Cpu(s):  0.0% us,  0.1% sy,  0.0% ni, 99.9% id,  0.0% wa,  0.0% hi,  0.0% si
Mem:    524288k total,   171340k used,   352948k free,        0k buffers
Swap:        0k total,        0k used,        0k free,        0k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
 9349 mysql     15   0  262m  36m 4768 S    0  7.0 272:18.08 mysqld
15663 root      16   0  247m  13m 6584 S    0  2.7   0:00.27 httpd2-prefork
18267 wwwrun    15   0  250m  12m 4300 S    0  2.5   0:00.22 httpd2-prefork
15685 wwwrun    15   0  250m  12m 4328 S    0  2.4   0:00.39 httpd2-prefork
15705 wwwrun    16   0  250m  12m 3928 S    0  2.4   0:00.21 httpd2-prefork                             
15770 wwwrun    15   0  250m  11m 3920 S    0  2.3   0:00.10 httpd2-prefork
18277 wwwrun    16   0  248m  11m 3364 S    0  2.2   0:00.14 httpd2-prefork                             
18269 wwwrun    15   0  248m  11m 3252 S    0  2.2   0:00.10 httpd2-prefork
15664 wwwrun    15   0  248m  11m 3408 S    0  2.2   0:00.30 httpd2-prefork
21919 root      16   0 97456 3620 2660 S    0  0.7   0:01.11 sshd
13948 root      15   0 97456 3612 2660 S    0  0.7   0:00.08 sshd
22044 root      15   0 22408 2808 1528 S    0  0.5   0:00.15 bash
13977 root      15   0 22412 2800 1524 S    0  0.5   0:00.11 bash
 7170 root      15   0 23920 1588 1328 S    0  0.3   0:00.12 console-kit-dae
 8170 root      17   0 13072 1480 1180 S    0  0.3   0:00.02 mysqld_safe                                 
 7720 root      16   0 61740 1316  696 S    0  0.3   0:00.00 sshd
25954 root      15   0 16624 1212  920 R    1  0.2   0:14.07 top
 7788 root      16   0 13780 1116  836 S    0  0.2   0:00.00 courierlogger                               
 7813 root      16   0 13780 1116  836 S    0  0.2   0:01.93 courierlogger
 7738 root      16   0 18952  992  760 S    0  0.2   0:56.75 xinetd
 7801 root      18   0 13648  944  684 S    0  0.2   0:00.00 courierlogger
 7830 root      18   0 13648  944  684 S    0  0.2   0:00.00 courierlogger
 6131 messageb  15   0 14552  832  636 S    0  0.2   0:00.36 dbus-daemon
 7838 root      15   0 20440  816  624 S    0  0.2   0:13.92 cron
 7810 root      15   0 17988  800  500 S    0  0.2   0:02.72 couriertcpd
 5725 root      11  -4 12260  772  444 S    0  0.1   0:00.00 udevd
 7786 root      16   0 17980  764  468 S    0  0.1   0:00.00 couriertcpd
 7799 root      21   0 17976  748  456 S    0  0.1   0:00.00 couriertcpd
 7824 root      18   0 17976  748  456 S    0  0.1   0:00.01 couriertcpd
 7731 root      16   0  5776  680  548 S    0  0.1   1:06.45 syslogd
 9459 qmails    15   0  3704  560  452 S    0  0.1   0:40.92 qmail-send
 9470 qmaill    15   0  3652  536  444 S    0  0.1   0:05.59 splogger
 9472 qmailr    16   0  3688  472  352 S    0  0.1   0:03.85 qmail-rspawn
 9471 root      17   0  3692  456  340 S    0  0.1   0:00.24 qmail-lspawn
 9473 qmailq    15   0  3648  420  336 S    0  0.1   0:02.73 qmail-clean
    1 root      16   0   732  296  244 S    0  0.1   0:15.20 init

ps -aux
Code:
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root         1  0.0  0.0    732   296 ?        Ss   Apr14   0:15 init [3]
root      5725  0.0  0.1  12260   772 ?        S<s  Apr14   0:00 /sbin/udevd --daemon
100       6131  0.0  0.1  14552   832 ?        Ss   Apr14   0:00 /bin/dbus-daemon --system
root      7170  0.0  0.3  23920  1588 ?        Ss   Apr14   0:00 /usr/sbin/console-kit-daemon
root      7720  0.0  0.2  61740  1316 ?        Ss   Apr14   0:00 /usr/sbin/sshd -o PidFile=/var/run/sshd.init.pid
root      7731  0.0  0.1   5776   680 ?        Ss   Apr14   1:06 /sbin/syslogd -a /var/lib/named/dev/log
root      7738  0.0  0.1  18952   992 ?        Ss   Apr14   0:56 /usr/sbin/xinetd
root      7786  0.0  0.1  17980   764 ?        S    Apr14   0:00 /usr/lib/courier-imap/couriertcpd -address=0 -stderrlogger=/usr/sbin/courierlogger -stderrlog
root      7788  0.0  0.2  13780  1116 ?        S    Apr14   0:00 /usr/sbin/courierlogger imapd
root      7799  0.0  0.1  17976   748 ?        S    Apr14   0:00 /usr/lib/courier-imap/couriertcpd -address=0 -stderrlogger=/usr/sbin/courierlogger -stderrlog
root      7801  0.0  0.1  13648   944 ?        S    Apr14   0:00 /usr/sbin/courierlogger imapd-ssl
root      7810  0.0  0.1  17988   800 ?        S    Apr14   0:02 /usr/lib/courier-imap/couriertcpd -address=0 -stderrlogger=/usr/sbin/courierlogger -stderrlog
root      7813  0.0  0.2  13780  1116 ?        S    Apr14   0:01 /usr/sbin/courierlogger pop3d
root      7824  0.0  0.1  17976   748 ?        S    Apr14   0:00 /usr/lib/courier-imap/couriertcpd -address=0 -stderrlogger=/usr/sbin/courierlogger -stderrlog
root      7830  0.0  0.1  13648   944 ?        S    Apr14   0:00 /usr/sbin/courierlogger pop3d-ssl
root      7838  0.0  0.1  20440   816 ?        Ss   Apr14   0:13 /usr/sbin/cron
root      8170  0.0  0.2  13072  1480 ?        S    Apr14   0:00 /bin/sh /usr/bin/mysqld_safe --mysqld=mysqld --user=mysql --pid-file=/var/lib/mysql/mysqld.pi
mysql     9349  0.6  7.0 268536 36932 ?        Sl   Apr14 272:18 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --user=mysql --pid-file=/var/lib/mys
qmails    9459  0.0  0.1   3704   560 ?        S    Apr14   0:40 qmail-send
qmaill    9470  0.0  0.1   3652   536 ?        S    Apr14   0:05 splogger qmail
root      9471  0.0  0.0   3692   456 ?        S    Apr14   0:00 qmail-lspawn | /usr/bin/deliverquota ./Maildir
qmailr    9472  0.0  0.0   3688   472 ?        S    Apr14   0:03 qmail-rspawn
qmailq    9473  0.0  0.0   3648   420 ?        S    Apr14   0:02 qmail-clean
root     21919  0.0  0.6  97456  3620 ?        Ss   14:32   0:01 sshd: root@pts/0
root     22044  0.0  0.5  22408  2808 pts/0    Ss   14:32   0:00 -bash
root     25954  1.1  0.2  16624  1212 pts/0    S+   15:04   0:14 top
root     13948  0.0  0.6  97456  3612 ?        Ss   15:17   0:00 sshd: root@pts/1
root     13977  0.0  0.5  22412  2800 pts/1    Ss   15:17   0:00 -bash
root     15663  0.0  2.6 253504 13896 ?        Ss   15:18   0:00 /usr/sbin/httpd2-prefork -f /etc/apache2/httpd.conf -DSSL
wwwrun   15664  0.0  2.1 254040 11528 ?        S    15:18   0:00 /usr/sbin/httpd2-prefork -f /etc/apache2/httpd.conf -DSSL
wwwrun   15685  0.1  2.4 256380 12744 ?        S    15:18   0:00 /usr/sbin/httpd2-prefork -f /etc/apache2/httpd.conf -DSSL
wwwrun   15705  0.0  2.3 256504 12484 ?        S    15:18   0:00 /usr/sbin/httpd2-prefork -f /etc/apache2/httpd.conf -DSSL
wwwrun   15770  0.0  2.3 256324 12160 ?        S    15:19   0:00 /usr/sbin/httpd2-prefork -f /etc/apache2/httpd.conf -DSSL
wwwrun   18267  0.0  2.4 256620 12936 ?        S    15:20   0:00 /usr/sbin/httpd2-prefork -f /etc/apache2/httpd.conf -DSSL
wwwrun   18269  0.0  2.2 254808 11748 ?        S    15:20   0:00 /usr/sbin/httpd2-prefork -f /etc/apache2/httpd.conf -DSSL
wwwrun   18277  0.0  2.2 254572 11796 ?        S    15:20   0:00 /usr/sbin/httpd2-prefork -f /etc/apache2/httpd.conf -DSSL
root     25853  0.0  0.1  12504   936 pts/1    R+   15:25   0:00 ps -aux


free:
Code:
             total       used       free     shared    buffers     cached
Mem:        524288     171644     352644          0          0          0
-/+ buffers/cache:     171644     352644
Swap:            0          0          0

proc/user_bean...:
Code:
Version: 2.5
       uid  resource                     held              maxheld              barrier                limit              failcnt
    158148: kmemsize                 10706193             15548086             15523666             17076032            179222520
            lockedpages                     0                    3                  344                  344                    0
            privvmpages                 42890               123398               131072               139264                    0
            shmpages                     1418                10409                19567                19567                    0
            dummy                           0                    0                    0                    0                    0
            numproc                        39                  113                  128                  128                    0
            physpages                   17681                83129                    0  9223372036854775807                    0
            vmguarpages                     0                    0                65536  9223372036854775807                    0
            oomguarpages                17690                83138                65536  9223372036854775807                    0
            numtcpsock                     15                  288                  288                  288                    3
            numflock                        6                   22                  224                  246                    0
            numpty                          2                    5                   16                   16                    0
            numsiginfo                      0                   44                  512                  512                    0
            tcpsndbuf                  208616              1577808              2449232              3598712                    0
            tcprcvbuf                  231128              1282360              2449232              3598712                    0
            othersockbuf                21096               702912               844366              1481926                    0
            dgramrcvbuf                     0                26352               844366               844366                    0
            numothersock                   17                   95                  288                  288                    0
            dcachesize                1237761              2324035              2254786              2322430                86552
            numfile                      2040                 3920                 4256                 4256                    0
            dummy                           0                    0                    0                    0                    0
            dummy                           0                    0                    0                    0                    0
            dummy                           0                    0                    0                    0                    0
            numiptent                      27                   44                   64                   64                    0


es laufen 2 selbstgeschrieben protale und ein selbstgeschriebens browsergame (noch sehr wenig traffic und eigentlich nicht erwähnenswert)

ab2:
Code:
ab2 -n 100 www.XXXX.de/index.php
This is ApacheBench, Version 2.0.40-dev <$Revision: 1.146 $> apache-2.0
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Copyright 2006 The Apache Software Foundation, http://www.apache.org/

Benchmarking www.XXXXX.de (be patient).....done


Server Software:        Apache/2.2.4
Server Hostname:        www.XXXX.de
Server Port:            80

Document Path:          /index.php
Document Length:        30227 bytes

Concurrency Level:      1
Time taken for tests:   1.55298 seconds
Complete requests:      100
Failed requests:        99
   (Connect: 0, Length: 99, Exceptions: 0)
Write errors:           0
Total transferred:      3072115 bytes
HTML transferred:       3021215 bytes
Requests per second:    94.76 [#/sec] (mean)
Time per request:       10.553 [ms] (mean)
Time per request:       10.553 [ms] (mean, across all concurrent requests)
Transfer rate:          2842.80 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    0   0.1      0       1
Processing:     8    9   1.6     10      18
Waiting:        3    8   1.9      9      12
Total:          8    9   1.6     10      18

Percentage of the requests served within a certain time (ms)
  50%     10
  66%     10
  75%     11
  80%     11
  90%     11
  95%     12
  98%     12
  99%     18
 100%     18 (longest request)

my.cnf
Code:
[client]
port            = 3306
socket          = /var/lib/mysql/mysql.sock
[mysqld]
set-variable=local-infile=0
set-variable = max_connections=50
set-variable = query_cache_size=50M
set-variable = query_cache_limit=8M
port            = 3306
socket          = /var/lib/mysql/mysql.sock
skip-locking
key_buffer = 32M
max_allowed_packet = 1M
table_cache = 128
sort_buffer_size = 2M
net_buffer_length = 8K
read_buffer_size = 2M
read_rnd_buffer_size = 6M
myisam_sort_buffer_size = 10M
server-id       = 1
skip-innodb
skip-bdb
[safe_mysqld]
err-log=/var/lib/mysql/mysqld.log
skip-bdb
[mysqldump]
quick
max_allowed_packet = 16M
[mysql]
no-auto-rehash
[isamchk]
key_buffer = 2M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M
[myisamchk]
key_buffer = 2M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M
[mysqlhotcopy]
interactive-timeout


ich will einfach die seiten noch ein bisschen schneller machen und das auch mal bei einem erhöhten zugriff, alle user bedient werden können.

soweit geht alles, bis auf das wenn ich keepalive auf On stelle, sofort alles gaaaaaaannnnnzzzzzz langsam wird.


was fällt euch sofort auf, was ich ändern sollte, unabhängig was noch auf dem server läuft.
 
danke für den link, aber hilft dieser mir in meiner config, weil du ein fehler/problem gesehen hast, oder nur so als zusätzlicher link
 
Back
Top