Имя пользователя:
Пароль:  
Помощь | Регистрация | Забыли пароль?  | Правила  

Компьютерный форум OSzone.net » Linux и FreeBSD » Общий по Linux » Проблема с апчем под линух

Ответить
Настройки темы
Проблема с апчем под линух

Пользователь


Сообщения: 54
Благодарности: 0

Профиль | Отправить PM | Цитировать


Установил апач + php на сервер... вроде все работает нормально, но иногда случается что один или несколько процессов апача берут процентов 90 процессорных ресурсов и долго висят. При просмотре командой top, они в состоянии R. Смотрел http://server_name/server-status, показывает что эти процессы (которые висят и жрут процессор) отдают обычные картинки.

Из-за чего такое может быть? И как с этим можно попробовать побороться?

P.S.: Linux RH9.0 и апач 1.33 установленный из исходников

Отправлено: 14:43, 17-04-2006

 

Аватара для dmitryst

Ветеран


Сообщения: 7116
Благодарности: 886

Профиль | Отправить PM | Цитировать


m2001
А лог апача что говорит?

-------
Осваиваю FreeBSD


Отправлено: 14:47, 17-04-2006 | #2



Для отключения данного рекламного блока вам необходимо зарегистрироваться или войти с учетной записью социальной сети.

Если же вы забыли свой пароль на форуме, то воспользуйтесь данной ссылкой для восстановления пароля.


Пользователь


Сообщения: 54
Благодарности: 0

Профиль | Отправить PM | Цитировать


лог апача ничего не говорит, эти процессы просто висят и отбирают ресурсы проца. В общий лог /var/log/message тоже ничего не кидает

Отправлено: 16:44, 17-04-2006 | #3


Аватара для dmitryst

Ветеран


Сообщения: 7116
Благодарности: 886

Профиль | Отправить PM | Цитировать


m2001
Скиньте кусок конфигурации, примерно первую половину. Может быть, установлено слишком большое время соединения с клиентом.

-------
Осваиваю FreeBSD


Отправлено: 11:39, 18-04-2006 | #4


Пользователь


Сообщения: 54
Благодарности: 0

Профиль | Отправить PM | Цитировать


Вроде параметры нормальные, в основном сервер работает нормально, но вот за месяц 3 раза такое уже случилось, и непонятно из-за чего.
Нагрузка на процессоры небольшая, памяти всего стоит 2Gb, в часы пик еще один гиг свопа юзает, по данным апача доходит до 80 запросов в секунду. Может из-за такого кол-ва запросов это, можно как-то оптимальнее подобрать параметры для апача ?

Вот часть конфига:
### Section 1: Global Environment
#
# The directives in this section affect the overall operation of Apache,
# such as the number of concurrent requests it can handle or where it
# can find its configuration files.
#

#
# ServerType is either inetd, or standalone. Inetd mode is only supported on
# Unix platforms.
#
ServerType standalone

#
# ServerRoot: The top of the directory tree under which the server's
# configuration, error, and log files are kept.
#
# NOTE! If you intend to place this on an NFS (or otherwise network)
# mounted filesystem then please read the LockFile documentation
# (available at <URL:http://www.apache.org/docs/mod/core.html#lockfile>);
# you will save yourself a lot of trouble.
#
ServerRoot "/usr/local/apache"

#
# The LockFile directive sets the path to the lockfile used when Apache
# is compiled with either USE_FCNTL_SERIALIZED_ACCEPT or
# USE_FLOCK_SERIALIZED_ACCEPT. This directive should normally be left at
# its default value. The main reason for changing it is if the logs
# directory is NFS mounted, since the lockfile MUST BE STORED ON A LOCAL
# DISK. The PID of the main server process is automatically appended to
# the filename.
#
#LockFile /usr/local/apache/logs/httpd.lock

#
# PidFile: The file in which the server should record its process
# identification number when it starts.
#
PidFile /usr/local/apache/logs/httpd.pid

#
# ScoreBoardFile: File used to store internal server process information.
# Not all architectures require this. But if yours does (you'll know because
# this file will be created when you run Apache) then you *must* ensure that
# no two invocations of Apache share the same scoreboard file.
#
ScoreBoardFile /usr/local/apache/logs/httpd.scoreboard

#
# In the standard configuration, the server will process httpd.conf (this
# file, specified by the -f command line option), srm.conf, and access.conf
# in that order. The latter two files are now distributed empty, as it is
# recommended that all directives be kept in a single file for simplicity.
# The commented-out values below are the built-in defaults. You can have the
# server ignore these files altogether by using "/dev/null" (for Unix) or
# "nul" (for Win32) for the arguments to the directives.
#
#ResourceConfig /usr/local/apache/conf/srm.conf
#AccessConfig /usr/local/apache/conf/access.conf

#
# Timeout: The number of seconds before receives and sends time out.
#
Timeout 30

#
# KeepAlive: Whether or not to allow persistent connections (more than
# one request per connection). Set to "Off" to deactivate.
#
KeepAlive On

#
# MaxKeepAliveRequests: The maximum number of requests to allow
# during a persistent connection. Set to 0 to allow an unlimited amount.
# We recommend you leave this number high, for maximum performance.
#
MaxKeepAliveRequests 200

#
# KeepAliveTimeout: Number of seconds to wait for the next request from the
# same client on the same connection.
#
KeepAliveTimeout 15

#
# Server-pool size regulation. Rather than making you guess how many
# server processes you need, Apache dynamically adapts to the load it
# sees --- that is, it tries to maintain enough server processes to
# handle the current load, plus a few spare servers to handle transient
# load spikes (e.g., multiple simultaneous requests from a single
# Netscape browser).
#
# It does this by periodically checking how many servers are waiting
# for a request. If there are fewer than MinSpareServers, it creates
# a new spare. If there are more than MaxSpareServers, some of the
# spares die off. The default values are probably OK for most sites.
#
MinSpareServers 10
MaxSpareServers 25

#
# Number of servers to start initially --- should be a reasonable ballpark
# figure.
#
StartServers 5

#
# Limit on total number of servers running, i.e., limit on the number
# of clients who can simultaneously connect --- if this limit is ever
# reached, clients will be LOCKED OUT, so it should NOT BE SET TOO LOW.
# It is intended mainly as a brake to keep a runaway server from taking
# the system with it as it spirals down...
#
MaxClients 500

#
# MaxRequestsPerChild: the number of requests each child process is
# allowed to process before the child dies. The child will exit so
# as to avoid problems after prolonged use when Apache (and maybe the
# libraries it uses) leak memory or other resources. On most systems, this
# isn't really needed, but a few (such as Solaris) do have notable leaks
# in the libraries. For these platforms, set to something like 10000
# or so; a setting of 0 means unlimited.
#
# NOTE: This value does not include keepalive requests after the initial
# request per connection. For example, if a child process handles
# an initial request and 10 subsequent "keptalive" requests, it
# would only count as 1 request towards this limit.
#
MaxRequestsPerChild 0

#
# Listen: Allows you to bind Apache to specific IP addresses and/or
# ports, instead of the default. See also the <VirtualHost>
# directive.
#
#Listen 3000
#Listen 12.34.56.78:80

#
# BindAddress: You can support virtual hosts with this option. This directive
# is used to tell the server which IP address to listen to. It can either
# contain "*", an IP address, or a fully qualified Internet domain name.
# See also the <VirtualHost> and Listen directives.
#
#BindAddress *

#
# Dynamic Shared Object (DSO) Support
#
# To be able to use the functionality of a module which was built as a DSO you
# have to place corresponding `LoadModule' lines at this location so the
# directives contained in it are actually available _before_ they are used.
# Please read the file http://httpd.apache.org/docs/dso.html for more
# details about the DSO mechanism and run `httpd -l' for the list of already
# built-in (statically linked and thus always available) modules in your httpd
# binary.
#
# Note: The order in which modules are loaded is important. Don't change
# the order below without expert advice.
#
# Example:
# LoadModule foo_module libexec/mod_foo.so
LoadModule rewrite_module libexec/mod_rewrite.so
LoadModule php4_module libexec/libphp4.so

# Reconstruction of the complete module list from all available modules
# (static and shared ones) to achieve correct module execution order.
# [WHENEVER YOU CHANGE THE LOADMODULE SECTION ABOVE UPDATE THIS, TOO]
ClearModuleList
AddModule mod_env.c
AddModule mod_log_config.c
AddModule mod_mime.c
AddModule mod_negotiation.c
AddModule mod_status.c
AddModule mod_include.c
AddModule mod_autoindex.c
AddModule mod_dir.c
AddModule mod_cgi.c
AddModule mod_asis.c
AddModule mod_imap.c
AddModule mod_actions.c
AddModule mod_userdir.c
AddModule mod_alias.c
AddModule mod_rewrite.c
AddModule mod_access.c
AddModule mod_auth.c
AddModule mod_so.c
AddModule mod_setenvif.c
<IfDefine SSL>
AddModule mod_ssl.c
</IfDefine>
AddModule mod_php4.c
AddModule mod_deflate.c

#
# ExtendedStatus controls whether Apache will generate "full" status
# information (ExtendedStatus On) or just basic information (ExtendedStatus
# Off) when the "server-status" handler is called. The default is Off.
#
ExtendedStatus On

Отправлено: 11:53, 21-04-2006 | #5


Пользователь


Сообщения: 54
Благодарности: 0

Профиль | Отправить PM | Цитировать


???

Отправлено: 14:49, 21-04-2006 | #6


Аватара для dmitryst

Ветеран


Сообщения: 7116
Благодарности: 886

Профиль | Отправить PM | Цитировать


m2001
KeepAliveTimeout 15
Можно не 15, а 5-6 поставить для пробы

-------
Осваиваю FreeBSD


Отправлено: 22:49, 22-04-2006 | #7



Компьютерный форум OSzone.net » Linux и FreeBSD » Общий по Linux » Проблема с апчем под линух

Участник сейчас на форуме Участник сейчас на форуме Участник вне форума Участник вне форума Автор темы Автор темы Шапка темы Сообщение прикреплено

Похожие темы
Название темы Автор Информация о форуме Ответов Последнее сообщение
Дрова под линух для 1650ХТ K@kTuS Железо в Linux 5 15-02-2008 18:10
В Линух из под винды? Snakegreen Общий по Linux 7 25-01-2006 12:12
Ищу аналоги программ под Линух Guest Программное обеспечение Linux и FreeBSD 11 27-05-2005 17:37
q3  под линух ? aliquis Программное обеспечение Linux и FreeBSD 11 02-02-2004 20:14
Опера под линух Kudryavcev Dmitry Общий по Linux 14 22-11-2003 01:03




 
Переход