LinuxForum.Fans
Тема

Debian 6 web server, тормозит очень сильно

Автор: Ahmund 2 сообщений 2583 просмотров
#207816

Доброе время суток.
Сразу говорю я в Linux чайник, так что прошу без наездов и "обсырань". Если надо какие то логи показать, скажите где и откудова взять я выложу, надеюсь на ваше понимание.

Начну с начала, нужен был веб сервер для отладки и тестирование 2-3 сайтов, для первого старта поставил обычный WinXP pro, ну и естественно апач, муску, фтп, плюс подвязка доменов к каждому сайту через dyndns, чтобы делится наработками по сайту с другими людьми.
Железо каторое использую для сервера:
AMD Atlon 1,5Ghz
ОЗУ 128Мб
HHD 20Гб
сетевая 100 мбит/сек
Интернет 2 мбит/сек
Все работало отлично, без глюков и капризов особых.
Ну вот начитавшись о Linux, о его быстроте и надежности по сравнению с WinXP, решил сделать на нем свой сервер для тестирование.
В качестве ОС Linux использовал Debian 6, плюс стандартный набор apache, mysql, proftpd, большего и не надо.
Загрузил два сайта на новый сервер и тут началось, сайты очень медлено грузятся, и притом винчестер на сервере хрустит как буто на него пишут или считывают гигабайты информации, а у других людей которые с интернета заходят на сайт он грузится минут 10, а у некоторых в обще не загружается просто грузится и все.. по локалке такая ж ситуация.
Не ожидал такого быстродействия от Linux, такое чувство что он в 10 раз больше ресурсов требует чем WinXP.


вот файл /etc/fstab

text

# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
proc            /proc           proc    defaults        0       0
# / was on /dev/sda1 during installation
UUID=2149d9bd-5b31-4233-ad7b-b6dcdbba8cf9 /               ext3    errors=remount-ro 0       1
/dev/sda5       none            swap    sw              0       0
/dev/scd0       /media/cdrom0   udf,iso9660 user,noauto     0       0
/dev/fd0        /media/floppy0  auto    rw,user,noauto  0       0

винчестер рабочий, проверяный.


Вот что показывает команда top при холостой работе сервера не обращаясь к сайтам

text

top - 19:51:49 up 4 min,  1 user,  load average: 0.01, 0.09, 0.05
Tasks:  71 total,   1 running,  70 sleeping,   0 stopped,   0 zombie
Cpu(s):  0.0%us,  0.6%sy,  0.0%ni, 99.4%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
Mem:    124784k total,   117488k used,     7296k free,     5084k buffers
Swap:  1971192k total,        0k used,  1971192k free,    70748k cached
  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
    1 root      20   0  2028  700  608 S  0.0  0.6   0:00.84 init
    2 root      20   0     0    0    0 S  0.0  0.0   0:00.00 kthreadd
    3 root      RT   0     0    0    0 S  0.0  0.0   0:00.00 migration/0
    4 root      20   0     0    0    0 S  0.0  0.0   0:00.00 ksoftirqd/0
    5 root      RT   0     0    0    0 S  0.0  0.0   0:00.00 watchdog/0
    6 root      20   0     0    0    0 S  0.0  0.0   0:00.00 events/0
    7 root      20   0     0    0    0 S  0.0  0.0   0:00.00 cpuset
    8 root      20   0     0    0    0 S  0.0  0.0   0:00.00 khelper
    9 root      20   0     0    0    0 S  0.0  0.0   0:00.00 netns
   10 root      20   0     0    0    0 S  0.0  0.0   0:00.00 async/mgr
   11 root      20   0     0    0    0 S  0.0  0.0   0:00.00 pm
   12 root      20   0     0    0    0 S  0.0  0.0   0:00.00 sync_supers
   13 root      20   0     0    0    0 S  0.0  0.0   0:00.00 bdi-default
   14 root      20   0     0    0    0 S  0.0  0.0   0:00.00 kintegrityd/0
   15 root      20   0     0    0    0 S  0.0  0.0   0:00.01 kblockd/0
   16 root      20   0     0    0    0 S  0.0  0.0   0:00.00 kacpid
   17 root      20   0     0    0    0 S  0.0  0.0   0:00.00 kacpi_notify
   18 root      20   0     0    0    0 S  0.0  0.0   0:00.00 kacpi_hotplug
   19 root      20   0     0    0    0 S  0.0  0.0   0:00.00 kseriod
   21 root      20   0     0    0    0 S  0.0  0.0   0:00.00 kondemand/0
   22 root      20   0     0    0    0 S  0.0  0.0   0:00.00 khungtaskd
   23 root      20   0     0    0    0 S  0.0  0.0   0:00.00 kswapd0
   24 root      25   5     0    0    0 S  0.0  0.0   0:00.00 ksmd
   25 root      20   0     0    0    0 S  0.0  0.0   0:00.00 aio/0
   26 root      20   0     0    0    0 S  0.0  0.0   0:00.00 crypto/0
  162 root      20   0     0    0    0 S  0.0  0.0   0:00.00 ksuspend_usbd
  163 root      20   0     0    0    0 S  0.0  0.0   0:00.00 khubd
  165 root      20   0     0    0    0 S  0.0  0.0   0:00.00 ata/0
  171 root      20   0     0    0    0 S  0.0  0.0   0:00.00 ata_aux
  175 root      20   0     0    0    0 S  0.0  0.0   0:00.00 scsi_eh_0
  176 root      20   0     0    0    0 S  0.0  0.0   0:00.00 scsi_eh_1
  213 root      20   0     0    0    0 S  0.0  0.0   0:00.01 kjournald
  278 root      16  -4  2252  784  416 S  0.0  0.6   0:00.07 udevd
  401 root      18  -2  2248  608  240 S  0.0  0.5   0:00.00 udevd
  402 root      18  -2  2248  600  232 S  0.0  0.5   0:00.00 udevd
  446 root      20   0     0    0    0 S  0.0  0.0   0:00.00 flush-8:0
  463 root      20   0     0    0    0 S  0.0  0.0   0:00.00 nouveau/0
  464 root      20   0     0    0    0 S  0.0  0.0   0:00.00 kgameportd
  465 root      20   0     0    0    0 S  0.0  0.0   0:00.00 ttm_swap
  666 daemon    20   0  1804  488  400 S  0.0  0.4   0:00.00 portmap
  678 statd     20   0  1936  768  640 S  0.0  0.6   0:00.00 rpc.statd
  852 root      20   0 27444 1568 1024 S  0.0  1.3   0:00.03 rsyslogd
  884 root      20   0  1704  592  480 S  0.0  0.5   0:00.00 acpid
  895 root      20   0 16616 3076 2368 S  0.0  2.5   0:00.02 smbd
  919 root      20   0 16616 1252  552 S  0.0  1.0   0:00.00 smbd
  941 root      20   0  2332  540  264 S  0.0  0.4   0:00.00 dhclient
  962 root      20   0  9212 1720 1180 S  0.0  1.4   0:00.00 nmbd
  966 root      20   0 65532  11m 7516 S  0.0  9.7   0:00.11 apache2
  976 daemon    20   0  2156  412  284 S  0.0  0.3   0:00.00 atd
 1002 root      20   0  3812  944  748 S  0.0  0.8   0:00.00 cron
 1013 messageb  20   0  2576  540  372 S  0.0  0.4   0:00.00 dbus-daemon
 1044 root      20   0  1748  540  452 S  0.0  0.4   0:00.02 mysqld_safe
 1155 mysql     20   0  134m  18m 5404 S  0.0 14.9   0:00.48 mysqld

Вот что показывает команда top при обращении к одному сайту

text

top - 19:53:21 up 6 min,  1 user,  load average: 0.16, 0.09, 0.05
Tasks:  73 total,   2 running,  71 sleeping,   0 stopped,   0 zombie
Cpu(s): 49.0%us,  9.3%sy,  0.0%ni,  2.3%id, 39.3%wa,  0.0%hi,  0.0%si,  0.0%st
Mem:    124784k total,   122572k used,     2212k free,     4292k buffers
Swap:  1971192k total,     2744k used,  1968448k free,    45948k cached
  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
 1170 www-data  20   0 88464  44m  17m R 32.6 36.7   0:01.60 apache2
 1169 www-data  20   0 73952  24m  11m S 24.0 20.3   0:00.73 apache2
 1155 mysql     20   0  134m  18m 5700 S  1.3 15.2   0:00.60 mysqld
   23 root      20   0     0    0    0 S  0.3  0.0   0:00.01 kswapd0
  966 root      20   0 65532  11m 7512 S  0.3  9.6   0:00.12 apache2
    1 root      20   0  2028  636  608 S  0.0  0.5   0:00.84 init
    2 root      20   0     0    0    0 S  0.0  0.0   0:00.00 kthreadd
    3 root      RT   0     0    0    0 S  0.0  0.0   0:00.00 migration/0
    4 root      20   0     0    0    0 S  0.0  0.0   0:00.00 ksoftirqd/0
    5 root      RT   0     0    0    0 S  0.0  0.0   0:00.00 watchdog/0
    6 root      20   0     0    0    0 S  0.0  0.0   0:00.01 events/0
    7 root      20   0     0    0    0 S  0.0  0.0   0:00.00 cpuset
    8 root      20   0     0    0    0 S  0.0  0.0   0:00.00 khelper
    9 root      20   0     0    0    0 S  0.0  0.0   0:00.00 netns
   10 root      20   0     0    0    0 S  0.0  0.0   0:00.00 async/mgr
   11 root      20   0     0    0    0 S  0.0  0.0   0:00.00 pm
   12 root      20   0     0    0    0 S  0.0  0.0   0:00.00 sync_supers
   13 root      20   0     0    0    0 S  0.0  0.0   0:00.00 bdi-default
   14 root      20   0     0    0    0 S  0.0  0.0   0:00.00 kintegrityd/0
   15 root      20   0     0    0    0 S  0.0  0.0   0:00.01 kblockd/0
   16 root      20   0     0    0    0 S  0.0  0.0   0:00.00 kacpid
   17 root      20   0     0    0    0 S  0.0  0.0   0:00.00 kacpi_notify
   18 root      20   0     0    0    0 S  0.0  0.0   0:00.00 kacpi_hotplug
   19 root      20   0     0    0    0 S  0.0  0.0   0:00.00 kseriod
   21 root      20   0     0    0    0 S  0.0  0.0   0:00.00 kondemand/0
   22 root      20   0     0    0    0 S  0.0  0.0   0:00.00 khungtaskd
   24 root      25   5     0    0    0 S  0.0  0.0   0:00.00 ksmd
   25 root      20   0     0    0    0 S  0.0  0.0   0:00.00 aio/0
   26 root      20   0     0    0    0 S  0.0  0.0   0:00.00 crypto/0
  162 root      20   0     0    0    0 S  0.0  0.0   0:00.00 ksuspend_usbd
  163 root      20   0     0    0    0 S  0.0  0.0   0:00.00 khubd
  165 root      20   0     0    0    0 S  0.0  0.0   0:00.00 ata/0
  171 root      20   0     0    0    0 S  0.0  0.0   0:00.00 ata_aux
  175 root      20   0     0    0    0 S  0.0  0.0   0:00.00 scsi_eh_0
  176 root      20   0     0    0    0 S  0.0  0.0   0:00.00 scsi_eh_1
  213 root      20   0     0    0    0 S  0.0  0.0   0:00.01 kjournald
  278 root      16  -4  2252  416  416 S  0.0  0.3   0:00.07 udevd
  401 root      18  -2  2248  240  240 S  0.0  0.2   0:00.00 udevd
  402 root      18  -2  2248  232  232 S  0.0  0.2   0:00.00 udevd
  446 root      20   0     0    0    0 S  0.0  0.0   0:00.00 flush-8:0
  463 root      20   0     0    0    0 S  0.0  0.0   0:00.00 nouveau/0
  464 root      20   0     0    0    0 S  0.0  0.0   0:00.00 kgameportd
  465 root      20   0     0    0    0 S  0.0  0.0   0:00.00 ttm_swap
  666 daemon    20   0  1804  400  400 S  0.0  0.3   0:00.00 portmap
  678 statd     20   0  1936  640  640 S  0.0  0.5   0:00.00 rpc.statd
  852 root      20   0 27444 1028 1024 S  0.0  0.8   0:00.03 rsyslogd
  884 root      20   0  1704  480  480 S  0.0  0.4   0:00.00 acpid
  895 root      20   0 16616 2584 2344 S  0.0  2.1   0:00.02 smbd
  919 root      20   0 16616  568  544 S  0.0  0.5   0:00.00 smbd
  941 root      20   0  2332  288  264 S  0.0  0.2   0:00.00 dhclient
  962 root      20   0  9212 1720 1180 S  0.0  1.4   0:00.00 nmbd
  976 daemon    20   0  2156  412  284 S  0.0  0.3   0:00.00 atd
 1002 root      20   0  3812  944  748 S  0.0  0.8   0:00.00 cron
 1013 messageb  20   0  2576  540  372 S  0.0  0.4   0:00.00 dbus-daemon

Команда tail -20 /var/log/apache2/error.log

text

[Sun Nov 20 02:21:08 2011] [warn] child process 2063 still did not exit, sending a SIGTERM
[Sun Nov 20 02:21:10 2011] [error] child process 2049 still did not exit, sending a SIGKILL
[Sun Nov 20 02:21:10 2011] [error] child process 2065 still did not exit, sending a SIGKILL
[Sun Nov 20 02:21:10 2011] [error] child process 2051 still did not exit, sending a SIGKILL
[Sun Nov 20 02:21:10 2011] [error] child process 2052 still did not exit, sending a SIGKILL
[Sun Nov 20 02:21:10 2011] [error] child process 2053 still did not exit, sending a SIGKILL
[Sun Nov 20 02:21:10 2011] [error] child process 2061 still did not exit, sending a SIGKILL
[Sun Nov 20 02:21:10 2011] [error] child process 2056 still did not exit, sending a SIGKILL
[Sun Nov 20 02:21:10 2011] [error] child process 2057 still did not exit, sending a SIGKILL
[Sun Nov 20 02:21:10 2011] [error] child process 2058 still did not exit, sending a SIGKILL
[Sun Nov 20 02:21:10 2011] [error] child process 2063 still did not exit, sending a SIGKILL
[Sun Nov 20 02:21:12 2011] [notice] caught SIGTERM, shutting down
PHP Deprecated:  Comments starting with '#' are deprecated in /etc/php5/apache2/conf.d/ps.ini on line 1 in Unknown on line 0
[Sun Nov 20 23:36:47 2011] [notice] Apache/2.2.16 (Debian) PHP/5.3.3-7+squeeze3 with Suhosin-Patch configured -- resuming normal operations
[Sun Nov 20 23:42:14 2011] [notice] caught SIGTERM, shutting down
PHP Deprecated:  Comments starting with '#' are deprecated in /etc/php5/apache2/conf.d/ps.ini on line 1 in Unknown on line 0
[Mon Nov 21 19:47:20 2011] [notice] Apache/2.2.16 (Debian) PHP/5.3.3-7+squeeze3 with Suhosin-Patch configured -- resuming normal operations
[Mon Nov 21 19:57:06 2011] [notice] caught SIGTERM, shutting down
PHP Deprecated:  Comments starting with '#' are deprecated in /etc/php5/apache2/conf.d/ps.ini on line 1 in Unknown on line 0
[Tue Nov 22 20:53:49 2011] [notice] Apache/2.2.16 (Debian) PHP/5.3.3-7+squeeze3 with Suhosin-Patch configured -- resuming normal operations

Команда ls /etc/apache2/mods-enabled/

text

alias.conf            autoindex.conf  mime.conf         rewrite.load
alias.load            autoindex.load  mime.load         setenvif.conf
auth_basic.load       cgi.load        negotiation.conf  setenvif.load
authn_file.load       deflate.conf    negotiation.load  status.conf
authz_default.load    deflate.load    php5.conf         status.load
authz_groupfile.load  dir.conf        php5.load
authz_host.load       dir.load        reqtimeout.conf
authz_user.load       env.load        reqtimeout.load
#207908

[console]iotop -Pk[/console]
во время нагрузки что показывает?

Войдите или зарегистрируйтесь, чтобы ответить.