Announcement

Collapse
No announcement yet.

Apache sometimes goes to swap

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Apache sometimes goes to swap

    Hello,
    I run two vbulletin 3.8.6 sites on dedicated server (non VDS).
    Average load:
    Daily visitors ~ 15000
    Daily page views ~ 300000-350000
    Online visitors ~ 1000

    Server: Apache/2.2.9 (FreeBSD) mod_ssl/2.2.9 OpenSSL/0.9.8e DAV/2 PHP/5.2.6 with Suhosin-Patch MySQL/5.1.42

    The problem: Sometimes web-server (apache) goes to swap without any visible reason. Users see it as "site not responding" error and there are numerous errors in logs:
    MySQL Error : MySQL server has gone away
    Error Number : 2006

    See ini-files below.
    Does anybody have ideas about tuning these options to prevent apache swapping?

    php.ini
    upload_max_filesize = 1024M
    post_max_size = 800M
    max_execution_time = 240
    max_input_time = 360
    ;max_input_nesting_level = 128
    memory_limit = 800M
    mysql/my.cnf
    port = 3306
    socket = /tmp/mysql.sock
    # The MySQL server
    [mysqld]
    port = 3306
    socket = /tmp/mysql.sock
    skip-locking
    key_buffer_size = 512M
    max_allowed_packet = 2M
    table_open_cache = 256
    sort_buffer_size = 4M
    bulk_insert_buffer_size = 128M
    read_buffer_size = 4M
    read_rnd_buffer_size = 8M
    myisam_sort_buffer_size = 128M
    max_connections = 600
    thread_cache_size = 8
    query_cache_size= 512M
    thread_concurrency = 8
    log-bin=mysql-bin
    binlog_format=mixed
    server-id = 1
    [mysqldump]
    quick
    max_allowed_packet = 64M
    [mysql]
    no-auto-rehash
    [myisamchk]
    key_buffer_size = 256M
    sort_buffer_size = 256M
    query_cache_size= 512M
    read_buffer = 4M
    write_buffer = 4M
    httpd.conf
    <Directory /usr/home/some/data/cgi-bin>
    Options +ExecCGI +FollowSymLinks +Includes
    AllowOverride None
    Order allow,deny
    Allow from all
    </Directory>
    <Directory /usr/home/some/data/www>
    Options +Indexes +FollowSymLinks +Includes
    AllowOverride All
    Order allow,deny
    Allow from all
    </Directory>
    <Directory /usr/home/some/data/www/forum/images>
    ExpiresActive On
    ExpiresDefault "access plus 2 month"
    </Directory>
    <Directory /usr/home/some/data/www/images>
    ExpiresActive On
    ExpiresDefault "access plus 2 month"
    </Directory>

    <VirtualHost *:80>
    ServerAdmin [email protected]
    DocumentRoot "/usr/home/some/data/www"
    SuexecUserGroup some some
    ServerName some.xxx.com
    ServerAlias www.some.xxx.com some.xxx.com
    www.some.yyy some.yyy
    ScriptAlias /cgi-bin "/usr/home/some/data/cgi-bin"
    php_admin_value open_basedir "/usr/home/some/data:."
    php_admin_value upload_tmp_dir "/usr/home/some/data/tmp"
    php_admin_value session.save_path "/usr/home/some/data/tmp"
    AddType application/x-httpd-php .php .php3 .php4 .php5 .phtml
    AddType application/x-httpd-php-source .phps
    ErrorLog "/usr/home/some/data/log/httpd-error.log"
    CustomLog "/usr/home/some/data/log/httpd-access.log" common
    </VirtualHost> <VirtualHost *:443>
    ServerAdmin [email protected]
    DocumentRoot /usr/home/some/data/www/
    SuexecUserGroup some some
    ServerName some.xxx.com
    SSLEngine on
    SSLCertificateFile
    /usr/local/etc/apache22/ssl.csr/some1.xxx.com.csr
    SSLCertificateKeyFile
    /usr/local/etc/apache22/ssl.key/some1.xxx.com.key
    SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown
    downgrade-1.0 force-response-1.0
    ScriptAlias /cgi-bin "/usr/home/some/data/cgi-bin"
    Alias /myadmin /usr/local/www/phpMyAdmin/ <Directory
    /usr/local/www/phpMyAdmin/>
    AllowOverride All
    AddType application/x-httpd-php .php
    php_admin_value open_basedir
    /usr/local/www/phpMyAdmin/:/tmp:.:..:./:../
    php_admin_value upload_tmp_dir /tmp
    php_admin_value include_path .:..
    php_admin_value session.save_path /tmp
    php_admin_value safe_mode off
    DirectoryIndex index.php
    Order allow,deny
    Allow from all
    </Directory>
    php_admin_value open_basedir "/usr/home/some/data:."
    php_admin_value upload_tmp_dir "/usr/home/some/data/tmp"
    php_admin_value session.save_path "/usr/home/some/data/tmp"
    AddType application/x-httpd-php .php .php3 .php4 .php5 .phtml
    AddType application/x-httpd-php-source .phps
    ErrorLog "/usr/home/some/data/log/httpd-error.log"
    CustomLog "/usr/home/some/data/log/httpd-access.log" common
    </VirtualHost>

  • #2
    I would advise that you request server optimization help by starting a thread in the Server Configuration forum supplying the information requested in this thread:

    http://www.vbulletin.com/go/tweak
    Vote for:

    - *Admin Settable Paid Subscription Reminder Timeframe*
    -
    *PM - Add ability to reply to originator only*
    - Add Admin ability to auto-subscribe users to specific channel(s)
    - Highlight the correct navigation tab when you are on a custom page
    - "Quick Route" Interface...
    - Allow to use custom icons for individual forums

    Comment

    widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
    Working...
    X