Помогите оптимизировать впс

Тема в разделе "Администрирование серверов", создана пользователем Juri, 19 окт 2009.

Статус темы:
Закрыта.
Модераторы: mefish, stooper
  1. Juri

    Juri

    Заблокирован
    Регистр.:
    5 окт 2007
    Сообщения:
    1.065
    Симпатии:
    197
    Есть впс средней мощности, а именно процессор 600 мг оперативки 512 мб если не ошибаюсь стоит дебиан.

    конфиг мускуля

    Код:
    
    # 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
    #
    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
    #
    # 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	= 8M
    thread_stack		= 256K
    thread_cache_size	= 10
    
    
    # This replaces the startup script and checks MyISAM tables if needed
    # the first time they are touched
    myisam-recover		= BACKUP
    #max_connections        = 100
    #table_cache            = 64
    #thread_concurrency     = 10
    #
    # * Query Cache Configuration
    #
    query_cache_limit       = 1M
    query_cache_size        = 8M
    #
    # * Logging and Replication
    #
    # Both location gets rotated by the cronjob.
    # Be aware that this log type is a performance killer.
    #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
    #log-queries-not-using-indexes
    #
    # The following can be used as easy to replay backup logs or for replication.
    # note: if you are setting up a replication slave, see README.Debian about
    #       other settings you may need to change.
    #server-id		= 1
    #log_bin			= /var/log/mysql/mysql-bin.log
    #expire_logs_days	= 10
    #max_binlog_size         = 100M
    #binlog_do_db		= include_database_name
    #binlog_ignore_db	= include_database_name
    #
    # * BerkeleyDB
    #
    # Using BerkeleyDB is now discouraged as its support will cease in 5.1.12.
    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!
    # You might want to disable InnoDB to shrink the mysqld process by circa 100MB.
    skip-innodb
    #
    # * Security Features
    #
    # Read the manual, too, if you want chroot!
    # chroot = /var/lib/mysql/
    #
    # For generating SSL certificates I recommend the OpenSSL GUI "tinyca".
    #
    # ssl-ca=/etc/mysql/cacert.pem
    # ssl-cert=/etc/mysql/server-cert.pem
    # ssl-key=/etc/mysql/server-key.pem
    
    
    
    [mysqldump]
    quick
    quote-names
    max_allowed_packet	= 8M
    
    [mysql]
    #no-auto-rehash	# faster start of mysql but no tab completition
    
    [isamchk]
    key_buffer		= 10M
    
    #
    # * NDB Cluster
    #
    # See /usr/share/doc/mysql-server-*/README.Debian for more information.
    #
    # The following configuration is read by the NDB Data Nodes (ndbd processes)
    # not from the NDB Management Nodes (ndb_mgmd processes).
    #
    # [MYSQL_CLUSTER]
    # ndb-connectstring=127.0.0.1
    
    
    #
    # * IMPORTANT: Additional settings that can override those from this file!
    #   The files must end with '.cnf', otherwise they'll be ignored.
    #
    !includedir /etc/mysql/conf.d/
    
    
    
    конфиг апача

    Код:
    
    
    ### 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.
    #
    
    #
    # 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://httpd.apache.org/docs-2.1/mod/mpm_common.html#lockfile>);
    # you will save yourself a lot of trouble.
    #
    # Do NOT add a slash at the end of the directory path.
    #
    ServerRoot "/etc/apache2"
    
    #
    # The accept serialization lock file MUST BE STORED ON A LOCAL DISK.
    #
    #<IfModule !mpm_winnt.c>
    #<IfModule !mpm_netware.c>
    LockFile /var/lock/apache2/accept.lock
    #</IfModule>
    #</IfModule>
    
    #
    # PidFile: The file in which the server should record its process
    # identification number when it starts.
    # This needs to be set in /etc/apache2/envvars
    #
    PidFile ${APACHE_PID_FILE}
    
    #
    # Timeout: The number of seconds before receives and sends time out.
    #
    Timeout 150
    
    #
    # 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 50
    
    #
    # KeepAliveTimeout: Number of seconds to wait for the next request from the
    # same client on the same connection.
    #
    KeepAliveTimeout 10
    
    ##
    ## Server-Pool Size Regulation (MPM specific)
    ## 
    
    # prefork MPM
    # StartServers: number of server processes to start
    # MinSpareServers: minimum number of server processes which are kept spare
    # MaxSpareServers: maximum number of server processes which are kept spare
    # MaxClients: maximum number of server processes allowed to start
    # MaxRequestsPerChild: maximum number of requests a server process serves
    <IfModule mpm_prefork_module>
        StartServers          4
        MinSpareServers       4
        MaxSpareServers      4
        MaxClients          80
        MaxRequestsPerChild  5000
    </IfModule>
    
    # worker MPM
    # StartServers: initial number of server processes to start
    # MaxClients: maximum number of simultaneous client connections
    # MinSpareThreads: minimum number of worker threads which are kept spare
    # MaxSpareThreads: maximum number of worker threads which are kept spare
    # ThreadsPerChild: constant number of worker threads in each server process
    # MaxRequestsPerChild: maximum number of requests a server process serves
    <IfModule mpm_worker_module>
        StartServers          2
        MaxClients          80
        MinSpareThreads      25
        MaxSpareThreads      75 
        ThreadsPerChild      25
        MaxRequestsPerChild  5000
    </IfModule>
    
    # These need to be set in /etc/apache2/envvars
    User ${APACHE_RUN_USER}
    Group ${APACHE_RUN_GROUP}
    
    #
    # AccessFileName: The name of the file to look for in each directory
    # for additional configuration directives.  See also the AllowOverride
    # directive.
    #
    
    AccessFileName .htaccess
    
    #
    # The following lines prevent .htaccess and .htpasswd files from being 
    # viewed by Web clients. 
    #
    <Files ~ "^\.ht">
        Order allow,deny
        Deny from all
    </Files>
    
    #
    # DefaultType is the default MIME type the server will use for a document
    # if it cannot otherwise determine one, such as from filename extensions.
    # If your server contains mostly text or HTML documents, "text/plain" is
    # a good value.  If most of your content is binary, such as applications
    # or images, you may want to use "application/octet-stream" instead to
    # keep browsers from trying to display binary files as though they are
    # text.
    #
    DefaultType text/plain
    
    
    #
    # HostnameLookups: Log the names of clients or just their IP addresses
    # e.g., www.apache.org (on) or 204.62.129.132 (off).
    # The default is off because it'd be overall better for the net if people
    # had to knowingly turn this feature on, since enabling it means that
    # each client request will result in AT LEAST one lookup request to the
    # nameserver.
    #
    HostnameLookups Off
    
    # ErrorLog: The location of the error log file.
    # If you do not specify an ErrorLog directive within a <VirtualHost>
    # container, error messages relating to that virtual host will be
    # logged here.  If you *do* define an error logfile for a <VirtualHost>
    # container, that host's errors will be logged there and not here.
    #
    ErrorLog /var/log/apache2/error.log
    
    #
    # LogLevel: Control the number of messages logged to the error_log.
    # Possible values include: debug, info, notice, warn, error, crit,
    # alert, emerg.
    #
    LogLevel warn
    
    # Include module configuration:
    Include /etc/apache2/mods-enabled/*.load
    Include /etc/apache2/mods-enabled/*.conf
    
    # Include all the user configurations:
    Include /etc/apache2/httpd.conf
    
    # Include ports listing
    Include /etc/apache2/ports.conf
    
    #
    # The following directives define some format nicknames for use with
    # a CustomLog directive (see below).
    # If you are behind a reverse proxy, you might want to change %h into %{X-Forwarded-For}i
    #
    LogFormat "%v:%p %h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined
    LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
    LogFormat "%h %l %u %t \"%r\" %>s %b" common
    LogFormat "%{Referer}i -> %U" referer
    LogFormat "%{User-agent}i" agent
    
    #
    # Define an access log for VirtualHosts that don't define their own logfile
    CustomLog /var/log/apache2/other_vhosts_access.log vhost_combined
    
    #
    # Customizable error responses come in three flavors:
    # 1) plain text 2) local redirects 3) external redirects
    #
    # Some examples:
    #ErrorDocument 500 "The server made a boo boo."
    #ErrorDocument 404 /missing.html
    #ErrorDocument 404 "/cgi-bin/missing_handler.pl"
    #ErrorDocument 402 http://www.example.com/subscription_info.html
    #
    
    #
    # Putting this all together, we can internationalize error responses.
    #
    # We use Alias to redirect any /error/HTTP_<error>.html.var response to
    # our collection of by-error message multi-language collections.  We use 
    # includes to substitute the appropriate text.
    #
    # You can modify the messages' appearance without changing any of the
    # default HTTP_<error>.html.var files by adding the line:
    #
    #   Alias /error/include/ "/your/include/path/"
    #
    # which allows you to create your own set of files by starting with the
    # /usr/share/apache2/error/include/ files and copying them to /your/include/path/, 
    # even on a per-VirtualHost basis.  The default include files will display
    # your Apache version number and your ServerAdmin email address regardless
    # of the setting of ServerSignature.
    #
    # The internationalized error documents require mod_alias, mod_include
    # and mod_negotiation.  To activate them, uncomment the following 30 lines.
    
    #    Alias /error/ "/usr/share/apache2/error/"
    #
    #    <Directory "/usr/share/apache2/error">
    #        AllowOverride None
    #        Options IncludesNoExec
    #        AddOutputFilter Includes html
    #        AddHandler type-map var
    #        Order allow,deny
    #        Allow from all
    #        LanguagePriority en cs de es fr it nl sv pt-br ro
    #        ForceLanguagePriority Prefer Fallback
    #    </Directory>
    #
    #    ErrorDocument 400 /error/HTTP_BAD_REQUEST.html.var
    #    ErrorDocument 401 /error/HTTP_UNAUTHORIZED.html.var
    #    ErrorDocument 403 /error/HTTP_FORBIDDEN.html.var
    #    ErrorDocument 404 /error/HTTP_NOT_FOUND.html.var
    #    ErrorDocument 405 /error/HTTP_METHOD_NOT_ALLOWED.html.var
    #    ErrorDocument 408 /error/HTTP_REQUEST_TIME_OUT.html.var
    #    ErrorDocument 410 /error/HTTP_GONE.html.var
    #    ErrorDocument 411 /error/HTTP_LENGTH_REQUIRED.html.var
    #    ErrorDocument 412 /error/HTTP_PRECONDITION_FAILED.html.var
    #    ErrorDocument 413 /error/HTTP_REQUEST_ENTITY_TOO_LARGE.html.var
    #    ErrorDocument 414 /error/HTTP_REQUEST_URI_TOO_LARGE.html.var
    #    ErrorDocument 415 /error/HTTP_UNSUPPORTED_MEDIA_TYPE.html.var
    #    ErrorDocument 500 /error/HTTP_INTERNAL_SERVER_ERROR.html.var
    #    ErrorDocument 501 /error/HTTP_NOT_IMPLEMENTED.html.var
    #    ErrorDocument 502 /error/HTTP_BAD_GATEWAY.html.var
    #    ErrorDocument 503 /error/HTTP_SERVICE_UNAVAILABLE.html.var
    #    ErrorDocument 506 /error/HTTP_VARIANT_ALSO_VARIES.html.var
    
    
    
    тут прочая лабуда схостами
    
    
    

    на впс крутится два сайта на дле общей посещаемостью до 6000 в сутки. он-лайн сидит в общем до 130 человек.

    в логах апача вижу что иногда не хватает памяти, не много удивлен как это 512 метров и не хватает.

    подскажите что подправить что б как то оптимизировать нагрузку?
    заранее спасибо
     
  2. unixman

    unixman

    Регистр.:
    6 сен 2006
    Сообщения:
    687
    Симпатии:
    61
    Без доступа к серверу сложно сказать - смотреть надо
    Но думаю можно
     
  3. Ad1ce

    Ad1ce Постоялец

    Регистр.:
    18 авг 2009
    Сообщения:
    109
    Симпатии:
    25
    Раз апачу не хватает памяти, то надо смотреть кто память всю съел.
     
  4. FastByte

    FastByte

    Регистр.:
    17 апр 2007
    Сообщения:
    263
    Симпатии:
    13
    Если я прально помню на каждого юзера апач выделяет по 8мб памяти
    130х8 = ...гиг тебе наверно хватит, но там еще мускуль, скрипты, система под это тоже надо чего-то.

    Так что или плати за 1,5 Гб впс или ( куда выгоднее) поставь nginx перед апачем, можно и на php-fpm (чтоб от апача вообще уйти) перебраться, и твой впс залетает!
     
  5. porsche2

    porsche2

    Регистр.:
    18 ноя 2007
    Сообщения:
    667
    Симпатии:
    210
    Ставь nginx как proxy на отдачу статики
    и попробуй так
    My.cnf
    Код:
    # Example MySQL config file for small systems.
    #
    # This is for a system with little memory (<= 64M) where MySQL is only used
    # from time to time and it's important that the mysqld daemon
    # doesn't use much resources.
    #
    # You can copy this file to
    # /etc/my.cnf to set global options,
    # mysql-data-dir/my.cnf to set server-specific options (in this
    # installation this directory is /var/lib/mysql) or
    # ~/.my.cnf to set user-specific options.
    #
    # In this file, you can use all long options that a program supports.
    # If you want to know which options a program supports, run the program
    # with the "--help" option.
    # The following options will be passed to all MySQL clients
    [client]
    #password	= your_password
    port		= 3306
    socket		= /var/run/mysqld/mysql.sock
    # Here follows entries for some specific programs
    # The MySQL server
    [mysqld]
    port		= 3306
    user		= mysql
    pid-file	= /var/run/mysqld/mysqld.pid
    socket		= /var/run/mysqld/mysql.sock
    skip-locking
    skip_networking
    low-priority-updates
    key_buffer = 50M
    max_allowed_packet = 8M
    table_cache = 32
    net_buffer_length = 4K
    read_buffer_size = 256k
    sort_buffer_size = 128k
    query-cache-type = 1
    query_cache_size = 25M
    max_connections=200
    back-log=30
    skip-bdb
    # Uncomment the following if you are using InnoDB tables
    #innodb_data_home_dir = /var/lib/mysql/
    #innodb_data_file_path = ibdata1:10M:autoextend
    #innodb_log_group_home_dir = /var/lib/mysql/
    #innodb_log_arch_dir = /var/lib/mysql/
    # You can set .._buffer_pool_size up to 50 - 80 %
    # of RAM but beware of setting memory usage too high
    #innodb_buffer_pool_size = 16M
    #innodb_additional_mem_pool_size = 2M
    # Set .._log_file_size to 25 % of buffer pool size
    #innodb_log_file_size = 5M
    #innodb_log_buffer_size = 8M
    #innodb_flush_log_at_trx_commit = 1
    #innodb_lock_wait_timeout = 50
    [mysqldump]
    quick
    max_allowed_packet = 20M
    [mysql]
    no-auto-rehash
    set-variable = connect_timeout=10
    # Remove the next comment character if you are not familiar with SQL
    #safe-updates
    [isamchk]
    key_buffer = 8M
    sort_buffer_size = 8M
    [myisamchk]
    key_buffer = 8M
    sort_buffer_size = 8M
    [mysqlhotcopy]
    interactive-timeout
    
    httpd.conf
    Код:
    ### 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.
    #
    #
    # 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://httpd.apache.org/docs-2.1/mod/mpm_common.html#lockfile>);
    # you will save yourself a lot of trouble.
    #
    # Do NOT add a slash at the end of the directory path.
    #
    ServerRoot "/etc/apache2"
    #
    # The accept serialization lock file MUST BE STORED ON A LOCAL DISK.
    #
    #<IfModule !mpm_winnt.c>
    #<IfModule !mpm_netware.c>
    LockFile /var/lock/apache2/accept.lock
    #</IfModule>
    #</IfModule>
    #
    # PidFile: The file in which the server should record its process
    # identification number when it starts.
    # This needs to be set in /etc/apache2/envvars
    #
    PidFile ${APACHE_PID_FILE}
    #
    # Timeout: The number of seconds before receives and sends time out.
    #
    Timeout 2
    #
    # KeepAlive: Whether or not to allow persistent connections (more than
    # one request per connection). Set to "Off" to deactivate.
    #
    KeepAlive Off
    #
    # 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 100
    #
    # KeepAliveTimeout: Number of seconds to wait for the next request from the
    # same client on the same connection.
    #
    KeepAliveTimeout 2
    ##
    ## Server-Pool Size Regulation (MPM specific)
    ##
    # prefork MPM
    # StartServers: number of server processes to start
    # MinSpareServers: minimum number of server processes which are kept spare
    # MaxSpareServers: maximum number of server processes which are kept spare
    # MaxClients: maximum number of server processes allowed to start
    # MaxRequestsPerChild: maximum number of requests a server process serves
    <IfModule prefork.c>
    StartServers 4
    MinSpareServers 4
    MaxSpareServers 10
    ServerLimit 13
    MaxClients 13
    MaxRequestsPerChild 1000
    </IfModule>
    # worker MPM
    # StartServers: initial number of server processes to start
    # MaxClients: maximum number of simultaneous client connections
    # MinSpareThreads: minimum number of worker threads which are kept spare
    # MaxSpareThreads: maximum number of worker threads which are kept spare
    # ThreadsPerChild: constant number of worker threads in each server process
    # MaxRequestsPerChild: maximum number of requests a server process serves
    <IfModule mpm_worker_module>
        StartServers          2
        MaxClients          80
        MinSpareThreads      25
        MaxSpareThreads      75
        ThreadsPerChild      25
        MaxRequestsPerChild  5000
    </IfModule>
    # These need to be set in /etc/apache2/envvars
    User ${APACHE_RUN_USER}
    Group ${APACHE_RUN_GROUP}
    #
    # AccessFileName: The name of the file to look for in each directory
    # for additional configuration directives.  See also the AllowOverride
    # directive.
    #
    AccessFileName .htaccess
    #
    # The following lines prevent .htaccess and .htpasswd files from being
    # viewed by Web clients.
    #
    <Files ~ "^\.ht">
        Order allow,deny
        Deny from all
    </Files>
    #
    # DefaultType is the default MIME type the server will use for a document
    # if it cannot otherwise determine one, such as from filename extensions.
    # If your server contains mostly text or HTML documents, "text/plain" is
    # a good value.  If most of your content is binary, such as applications
    # or images, you may want to use "application/octet-stream" instead to
    # keep browsers from trying to display binary files as though they are
    # text.
    #
    DefaultType text/plain
    #
    # HostnameLookups: Log the names of clients or just their IP addresses
    # e.g., www.apache.org (on) or 204.62.129.132 (off).
    # The default is off because it'd be overall better for the net if people
    # had to knowingly turn this feature on, since enabling it means that
    # each client request will result in AT LEAST one lookup request to the
    # nameserver.
    #
    HostnameLookups Off
    # ErrorLog: The location of the error log file.
    # If you do not specify an ErrorLog directive within a <VirtualHost>
    # container, error messages relating to that virtual host will be
    # logged here.  If you *do* define an error logfile for a <VirtualHost>
    # container, that host's errors will be logged there and not here.
    #
    ErrorLog /var/log/apache2/error.log
    #
    # LogLevel: Control the number of messages logged to the error_log.
    # Possible values include: debug, info, notice, warn, error, crit,
    # alert, emerg.
    #
    LogLevel warn
    # Include module configuration:
    Include /etc/apache2/mods-enabled/*.load
    Include /etc/apache2/mods-enabled/*.conf
    # Include all the user configurations:
    Include /etc/apache2/httpd.conf
    # Include ports listing
    Include /etc/apache2/ports.conf
    #
    # The following directives define some format nicknames for use with
    # a CustomLog directive (see below).
    # If you are behind a reverse proxy, you might want to change %h into %{X-Forwarded-For}i
    #
    LogFormat "%v:%p %h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined
    LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
    LogFormat "%h %l %u %t \"%r\" %>s %b" common
    LogFormat "%{Referer}i -> %U" referer
    LogFormat "%{User-agent}i" agent
    #
    # Define an access log for VirtualHosts that don't define their own logfile
    CustomLog /var/log/apache2/other_vhosts_access.log vhost_combined
    #
    # Customizable error responses come in three flavors:
    # 1) plain text 2) local redirects 3) external redirects
    #
    # Some examples:
    #ErrorDocument 500 "The server made a boo boo."
    #ErrorDocument 404 /missing.html
    #ErrorDocument 404 "/cgi-bin/missing_handler.pl"
    #ErrorDocument 402 http://www.example.com/subscription_info.html
    #
    #
    # Putting this all together, we can internationalize error responses.
    #
    # We use Alias to redirect any /error/HTTP_<error>.html.var response to
    # our collection of by-error message multi-language collections.  We use
    # includes to substitute the appropriate text.
    #
    # You can modify the messages' appearance without changing any of the
    # default HTTP_<error>.html.var files by adding the line:
    #
    #   Alias /error/include/ "/your/include/path/"
    #
    # which allows you to create your own set of files by starting with the
    # /usr/share/apache2/error/include/ files and copying them to /your/include/path/,
    # even on a per-VirtualHost basis.  The default include files will display
    # your Apache version number and your ServerAdmin email address regardless
    # of the setting of ServerSignature.
    #
    # The internationalized error documents require mod_alias, mod_include
    # and mod_negotiation.  To activate them, uncomment the following 30 lines.
    #    Alias /error/ "/usr/share/apache2/error/"
    #
    #    <Directory "/usr/share/apache2/error">
    #        AllowOverride None
    #        Options IncludesNoExec
    #        AddOutputFilter Includes html
    #        AddHandler type-map var
    #        Order allow,deny
    #        Allow from all
    #        LanguagePriority en cs de es fr it nl sv pt-br ro
    #        ForceLanguagePriority Prefer Fallback
    #    </Directory>
    #
    #    ErrorDocument 400 /error/HTTP_BAD_REQUEST.html.var
    #    ErrorDocument 401 /error/HTTP_UNAUTHORIZED.html.var
    #    ErrorDocument 403 /error/HTTP_FORBIDDEN.html.var
    #    ErrorDocument 404 /error/HTTP_NOT_FOUND.html.var
    #    ErrorDocument 405 /error/HTTP_METHOD_NOT_ALLOWED.html.var
    #    ErrorDocument 408 /error/HTTP_REQUEST_TIME_OUT.html.var
    #    ErrorDocument 410 /error/HTTP_GONE.html.var
    #    ErrorDocument 411 /error/HTTP_LENGTH_REQUIRED.html.var
    #    ErrorDocument 412 /error/HTTP_PRECONDITION_FAILED.html.var
    #    ErrorDocument 413 /error/HTTP_REQUEST_ENTITY_TOO_LARGE.html.var
    #    ErrorDocument 414 /error/HTTP_REQUEST_URI_TOO_LARGE.html.var
    #    ErrorDocument 415 /error/HTTP_UNSUPPORTED_MEDIA_TYPE.html.var
    #    ErrorDocument 500 /error/HTTP_INTERNAL_SERVER_ERROR.html.var
    #    ErrorDocument 501 /error/HTTP_NOT_IMPLEMENTED.html.var
    #    ErrorDocument 502 /error/HTTP_BAD_GATEWAY.html.var
    #    ErrorDocument 503 /error/HTTP_SERVICE_UNAVAILABLE.html.var
    #    ErrorDocument 506 /error/HTTP_VARIANT_ALSO_VARIES.html.var
    тут прочая лабуда схостами
    
    если nginx нет, то KeepAlive On и KeepAliveTimeout 20
     
  6. FastByte

    FastByte

    Регистр.:
    17 апр 2007
    Сообщения:
    263
    Симпатии:
    13
    Попробовал тоже:ah: ...Вот интересно, у меня в httpd.conf блин ни prefork ни worker не находятся даже по поиску по словам...:nezn:

    При этом вот стока всякой хрени подключается (ispmanager автоматом поставил), подозреваю большую часть можно выкинуть - а что х.з. (апач счас по 110М лопает!:(mad:
    Код:
    LoadModule authn_dbm_module libexec/apache22/mod_authn_dbm.so
    LoadModule authn_anon_module libexec/apache22/mod_authn_anon.so
    LoadModule authn_default_module libexec/apache22/mod_authn_default.so
    LoadModule authn_alias_module libexec/apache22/mod_authn_alias.so
    LoadModule authz_host_module libexec/apache22/mod_authz_host.so
    LoadModule authz_groupfile_module libexec/apache22/mod_authz_groupfile.so
    LoadModule authz_user_module libexec/apache22/mod_authz_user.so
    LoadModule authz_dbm_module libexec/apache22/mod_authz_dbm.so
    LoadModule authz_owner_module libexec/apache22/mod_authz_owner.so
    LoadModule authz_default_module libexec/apache22/mod_authz_default.so
    LoadModule auth_basic_module libexec/apache22/mod_auth_basic.so
    LoadModule auth_digest_module libexec/apache22/mod_auth_digest.so
    LoadModule file_cache_module libexec/apache22/mod_file_cache.so
    LoadModule cache_module libexec/apache22/mod_cache.so
    LoadModule disk_cache_module libexec/apache22/mod_disk_cache.so
    LoadModule dumpio_module libexec/apache22/mod_dumpio.so
    LoadModule include_module libexec/apache22/mod_include.so
    LoadModule filter_module libexec/apache22/mod_filter.so
    LoadModule charset_lite_module libexec/apache22/mod_charset_lite.so
    LoadModule deflate_module libexec/apache22/mod_deflate.so
    LoadModule log_config_module libexec/apache22/mod_log_config.so
    LoadModule logio_module libexec/apache22/mod_logio.so
    LoadModule env_module libexec/apache22/mod_env.so
    LoadModule mime_magic_module libexec/apache22/mod_mime_magic.so
    LoadModule cern_meta_module libexec/apache22/mod_cern_meta.so
    LoadModule expires_module libexec/apache22/mod_expires.so
    LoadModule headers_module libexec/apache22/mod_headers.so
    LoadModule usertrack_module libexec/apache22/mod_usertrack.so
    LoadModule setenvif_module libexec/apache22/mod_setenvif.so
    LoadModule version_module libexec/apache22/mod_version.so
    LoadModule ssl_module libexec/apache22/mod_ssl.so
    LoadModule mime_module libexec/apache22/mod_mime.so
    LoadModule dav_module libexec/apache22/mod_dav.so
    LoadModule status_module libexec/apache22/mod_status.so
    LoadModule autoindex_module libexec/apache22/mod_autoindex.so
    LoadModule asis_module libexec/apache22/mod_asis.so
    LoadModule info_module libexec/apache22/mod_info.so
    LoadModule suexec_module libexec/apache22/mod_suexec.so
    LoadModule cgi_module libexec/apache22/mod_cgi.so
    LoadModule dav_fs_module libexec/apache22/mod_dav_fs.so
    LoadModule vhost_alias_module libexec/apache22/mod_vhost_alias.so
    LoadModule negotiation_module libexec/apache22/mod_negotiation.so
    LoadModule dir_module libexec/apache22/mod_dir.so
    LoadModule imagemap_module libexec/apache22/mod_imagemap.so
    LoadModule actions_module libexec/apache22/mod_actions.so
    LoadModule speling_module libexec/apache22/mod_speling.so
    LoadModule userdir_module libexec/apache22/mod_userdir.so
    LoadModule alias_module libexec/apache22/mod_alias.so
    LoadModule rewrite_module libexec/apache22/mod_rewrite.so
    LoadModule php5_module        libexec/apache22/libphp5.so
    
    Есть мысли что точно для банального wp не нада?:bc:
     
  7. porsche2

    porsche2

    Регистр.:
    18 ноя 2007
    Сообщения:
    667
    Симпатии:
    210
    Это про что вопрос? Если ispmanager, то эта панель ставит апач автоматом как prefork. httpd -V все покажет.

    чтобы выяснить какие модули не нужны, можно тупо отключать их поочерёдно, перезагружать апач, и смотреть, работает WP и ISpmanager или нет.

    чтобы совсем не тупить, можно почитать тут http://httpd.apache.org/docs/2.2/mod/
     
  8. FastByte

    FastByte

    Регистр.:
    17 апр 2007
    Сообщения:
    263
    Симпатии:
    13
    Вопрос о том что как уменьшить - непонятно. Берем httpd.conf, делаем поск по словам - ни "prefork" ни "worker" не находятся. А в приведенном выше httpd.conf они есть и потому их можно изменять...
    Ну вот httpd -V
    Код:
    Server version: Apache/2.2.13 (FreeBSD)
    Server built:   Oct 21 2009 13:09:09
    Server's Module Magic Number: 20051115:23
    Server loaded:  APR 1.3.8, APR-Util 1.3.9
    Compiled using: APR 1.3.8, APR-Util 1.3.9
    Architecture:   64-bit
    Server MPM:     Prefork
      threaded:     no
        forked:     yes (variable process count)
    Server compiled with....
     -D APACHE_MPM_DIR="server/mpm/prefork"
     -D APR_HAS_SENDFILE
     -D APR_HAS_MMAP
     -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
     -D APR_USE_FLOCK_SERIALIZE
     -D APR_USE_PTHREAD_SERIALIZE
     -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
     -D APR_HAS_OTHER_CHILD
     -D AP_HAVE_RELIABLE_PIPED_LOGS
     -D DYNAMIC_MODULE_LIMIT=128
     -D HTTPD_ROOT="/usr/local"
     -D SUEXEC_BIN="/usr/local/sbin/suexec"
     -D DEFAULT_PIDLOG="/var/run/httpd.pid"
     -D DEFAULT_SCOREBOARD="/var/run/apache_runtime_status"
     -D DEFAULT_LOCKFILE="/var/run/accept.lock"
     -D DEFAULT_ERRORLOG="/var/log/httpd-error.log"
     -D AP_TYPES_CONFIG_FILE="etc/apache22/mime.types"
     -D SERVER_CONFIG_FILE="etc/apache22/httpd.conf"
    
    Ну и что мне это дало в целях уменьшения?:nezn:
     
  9. Juri

    Juri

    Заблокирован
    Регистр.:
    5 окт 2007
    Сообщения:
    1.065
    Симпатии:
    197

    с такими настройками как вы предложили сайт отказался принимать он-лайн больше 25 человек... этот вариант не подходит, но все равно спасибо
     
  10. mefish

    mefish Support

    Moderator
    • Супермодератор
    Регистр.:
    30 авг 2007
    Сообщения:
    887
    Симпатии:
    629
    Оно и понятно ))) вообще наврядли получится оптимизировать с 512 рамой. Опытным путем все ето делаеш.

    Идеш гугли, ищеш скрипт для тестирования запросов, скрипт работает 24 часа помоему и потом выдает приблизительные, НО оптимальные настройки для мускуля.

    Кстате, для дле лучше закоментировать query_cache_size или убрать вовсе) он только будет тормозить.

    НАсчет апача, то тут только KeepAlive off и шаманить с етим блоком (так же опытным путем:(

    ЗЫ: что за тузла. точно непомню, немогу в закладках найти почему-то.
     
Статус темы:
Закрыта.