PDA

View Full Version : server surcharge


Nassou
11-07-2008, 09:17 AM
Hi guys

i have a big big probleme with surcharge of my server and database error !


I think that a relationship with the hack: good now when I turn these hack is the catalyst:

Cyb - Statistics Advanced Forum
Latest X Threads Forum on Home
vBSEO
vBSEO:: Sitemap Generator

I looks on with TOP, so I watch httpd very frequent and mysqld

What is surprising is that the former host while niquel worked with these hack but this is the big overload what's more I really need this hack!

I present below my configuration:

httpd.conf

Citation:
#
# This is the main Apache HTTP server configuration file. It contains the
# configuration directives that give the server its instructions.
# See <URL:http://httpd.apache.org/docs/2.2> (https://www.vbulletin.com/link.php?u=http%3A%2F%2Fhttpd.apache.org%2Fdocs%2F 2.2%26gt%3B) for detailed information.
# In particular, see
# <URL:http://httpd.apache.org/docs/2.2/mod/directives.html> (https://www.vbulletin.com/link.php?u=http%3A%2F%2Fhttpd.apache.org%2Fdocs%2F 2.2%2Fmod%2Fdirectives.html%26gt%3B)
# for a discussion of each configuration directive.
#
# Do NOT simply read the instructions in here without understanding
# what they do. They're here only as hints or reminders. If you are unsure
# consult the online docs. You have been warned.

ServerRoot "/etc/httpd"
Listen 80

#LoadModule dummy_module /usr/lib/apache/mod_dummy.so
#LoadModule php5_module /usr/lib/apache/libphp5.so
Include /etc/httpd/conf/extra/httpd-phpmodules.conf

User apache
Group apache

ServerAdmin admin@localhost
DocumentRoot "/var/www/html"

<Directory /home/*>
AllowOverride All
Options -MultiViews -Indexes FollowSymlinks IncludesNoExec +Includes
<Limit GET POST OPTIONS PROPFIND>
Order allow,deny
Allow from all
</Limit>
<LimitExcept GET POST OPTIONS PROPFIND>
Order deny,allow
Deny from all
</LimitExcept>
</Directory>

<Directory />
Options All
AllowOverride All
</Directory>

<Directory "/var/www/html">
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
<IfModule mod_suphp.c>
suPHP_Engine On
suPHP_UserGroup webapps webapps
</IfModule>
</Directory>

<IfModule dir_module>
DirectoryIndex index.html index.htm index.shtml index.php index.php5 index.php4 index.php3 index.phtml index.cgi
</IfModule>

<FilesMatch "^\.ht">
Order allow,deny
Deny from all
Satisfy All
</FilesMatch>

ErrorLog /var/log/httpd/error_log
LogLevel warn

<IfModule log_config_module>
#replace %b with %O for more accurate logging
<IfModule mod_logio.c>
LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %O" common
LogFormat "%O" bytes

LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio
</IfModule>

CustomLog /var/log/httpd/access_log common
</IfModule>

<IfModule alias_module>
# Include some DirectAdmin alias
Include conf/extra/httpd-alias.conf
</IfModule>

<Directory "/var/www/cgi-bin">
AllowOverride None
Options None
Order allow,deny
Allow from all
</Directory>

DefaultType text/plain

<IfModule mime_module>
TypesConfig conf/mime.types
AddType application/x-gzip .tgz
AddEncoding x-compress .Z
AddEncoding x-gzip .gz .tgz
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
AddHandler cgi-script .cgi
AddHandler type-map var
AddType text/html .shtml
AddOutputFilter INCLUDES .shtml
AddType video/x-ms-asf .avi
AddType video/mpeg .mpg
AddType video/mpeg .mpeg
AddType video/quicktime .mov
AddType video/x-ms-wmv .wmv
</IfModule>

#EnableMMAP off
#EnableSendfile off

################################################## #####################################
# Do not change anything in included files, because they are rewritten by DirectAdmin #
################################################## #####################################

# This is needed for PHP
Include conf/extra/httpd-php-handlers.conf

# Server-pool management (MPM specific)
Include conf/extra/httpd-mpm.conf

# Multi-language error messages
Include conf/extra/httpd-multilang-errordoc.conf

# Fancy directory listings
Include conf/extra/httpd-autoindex.conf

# Language settings
Include conf/extra/httpd-languages.conf

# User home directories
#Include conf/extra/httpd-userdir.conf

# Real-time info on requests and configuration
Include conf/extra/httpd-info.conf

# Virtual hosts
Include conf/extra/httpd-vhosts.conf

# Local access to the Apache HTTP Server Manual
#Include conf/extra/httpd-manual.conf

# Distributed authoring and versioning (WebDAV)
Include conf/extra/httpd-dav.conf

# Various default settings
Include conf/extra/httpd-default.conf

# Secure (SSL/TLS) connections
Include conf/extra/httpd-ssl.conf

# Deflate module settings
Include conf/extra/httpd-deflate.conf

# All the DirectAdmin vhosts
Include conf/extra/directadmin-vhosts.conf

# All suPHP directives
Include conf/extra/httpd-suphp.conf

# All the other includes needed by the custombuild script
Include conf/extra/httpd-includes.conf

################################################## #####################################
# End of included files that are rewritten by DirectAdmin #
################################################## #####################################

<IfModule ssl_module>
SSLRandomSeed startup builtin
SSLRandomSeed connect builtin
</IfModule>

my.cnf

Citation:
[mysqld]
local-infile=0
socket=/tmp/mysql.sock
skip-name-resolve
safe-show-database
#old_passwords
back_log = 50
skip-innodb
max_connections = 800
key_buffer_size = 640M
myisam_sort_buffer_size = 128M
join_buffer_size = 2M
read_buffer_size = 2M
sort_buffer_size = 8M
table_cache = 4000
thread_cache_size = 512
wait_timeout = 60
connect_timeout = 10
tmp_table_size = 64M
max_heap_table_size = 64M
max_allowed_packet = 64M
net_buffer_length = 16384
max_connect_errors = 10
thread_concurrency = 16
concurrent_insert = 2
table_lock_wait_timeout = 30
read_rnd_buffer_size = 1M
bulk_insert_buffer_size = 32M
query_cache_limit = 6M
query_cache_size = 288M
query_cache_type = 1
query_prealloc_size = 262144
query_alloc_block_size = 65536
transaction_alloc_block_size = 8192
transaction_prealloc_size = 4096
default-storage-engine = MyISAM
max_write_lock_count = 16

[mysqld_safe]
nice = -10
open_files_limit = 8192

[mysqldump]
quick
max_allowed_packet = 16M

[myisamchk]
key_buffer = 512M
sort_buffer = 64M
read_buffer = 16M
write_buffer = 16M

############################################

AND DATABASE ERROR

mysql_connect() [<a href='function.mysql-connect'>function.mysql-connect</a>]: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (11)

Database error in vBulletin 3.7.4:

Invalid SQL:

SELECT
user.username, (user.options & 512) AS invisible, user.usergroupid,
session.userid, session.inforum, session.lastactivity, session.useragent,
IF(displaygroupid=0, user.usergroupid, displaygroupid) AS displaygroupid
FROM session AS session
LEFT JOIN user AS user ON(user.userid = session.userid)
WHERE session.lastactivity > 1226049603
ORDER BY username ASC;

MySQL Error : MySQL server has gone away
Error Number : 2006

####################################"

####################
server configuration
RAM : 1GB DDRAM
HDD : 160 GB
CPU : Intel 1 X Core Duo T2450
Linux Debian
#####################
EDIT:
Version vBulletin : 3.7.4
PHP 5.2.6
Serveur web : apache2handler
Version MySQL 5.0.67
users online : de 100 ~ 150 ~ 300 ~ 380

Angel-Wings
11-07-2008, 11:44 AM
Well - please take a look first at your Apache / MySQL Configuration - specially the Apache one.
If the shown configuration is really running, this should be your priority right now

snakes1100
11-07-2008, 11:48 AM
Well, first off, where ever you got those my.cnf settings, you need to revise them, if what you posted is right and you only have 1gb of ram in this server, those settings are way to high!

These settings should be corrected before you proceed any further.

Once you correct my.cnf, restart mysql, as well, enable logging in my.cnf

Also, your apache settings are fine, only you didn't post your start, min, max server settings, which shouldnt be a issue anyways.

Nassou
11-07-2008, 12:01 PM
I have corrected my.cnf to these values

my.cnf

[mysqld]
socket=/tmp/mysql.sock
local-infile=0
skip-locking
#skip-innodb
query_cache_limit=1M
query_cache_size=32M
query_cache_type=1
max_connections=800
interactive_timeout=100
wait_timeout=100
connect_timeout=10
thread_cache_size=128
key_buffer=16M
join_buffer=1M
max_allowed_packet=16M
table_cache=1024
record_buffer=1M
sort_buffer_size=2M
read_buffer_size=2M
max_connect_errors=10
# Try number of CPU's*2 for thread_concurrency
thread_concurrency=2
myisam_sort_buffer_size=64M
server-id=1

[safe_mysqld]
err-log=/var/log/mysqld.log
open_files_limit=8192

[mysqldump]
quick
max_allowed_packet=16M

[mysql]
no-auto-rehash
#safe-updates

[isamchk]
key_buffer=64M
sort_buffer=64M
read_buffer=16M
write_buffer=16M

[myisamchk]
key_buffer=64M
sort_buffer=64M
read_buffer=16M
write_buffer=16M

[mysqlhotcopy]
interactive-timeout


But always the same probleme
i think this bug is wuth my apache config !!!

Also, your apache settings are fine, only you didn't post your start, min, max server settings, which shouldnt be a issue anyways.How to post this ?

snakes1100
11-07-2008, 12:09 PM
Those settings are a bit tricky at times to find, depending on what OS & Apache version you run, as well as the web host manager that you might also run.

Typically they are in the httpd.conf/apache.conf file, sometimes they are in the extra or modules directory of apache in the mpm.conf file.

Change the following & restart mysql.
wait_timeout = 60
connect_timeout = 60
max_allowed_packet = 32M <-- I doubt this one is the issue, but its possible.

Nassou
11-07-2008, 02:35 PM
Always the same probleme

database error can't connect to mysql server and mysql server has gone away !:confused:

SEOvB
11-07-2008, 03:25 PM
Always the same probleme

database error can't connect to mysql server and mysql server has gone away !:confused:

This is from having bad mysql settings or your mysql process constantly crashing. Depending on your traffic and resource usuage you may have to upgrade your server, or optimize it further.

What does your server loads look like during your peak times or when these errors are occuring.

Nassou
11-08-2008, 07:23 AM
Now , i have increase timeout but the forum is too long for loading !


This server configuration:

####################
server configuration
RAM : 1GB DDRAM
HDD : 160 GB
CPU : Intel 1 X Core Duo T2450
Linux Debian
#####################

with a total of 300 ~ 400 users online is not enough for vBulletin?

royo
11-08-2008, 08:30 AM
Well, you are using a cheap server, with low amounts of RAM and a laptop processor.

Angel-Wings
11-08-2008, 09:05 AM
So long to "fine" Apache settings :confused:


<Limit GET POST OPTIONS PROPFIND>
Order allow,deny
Allow from all
</Limit>
<LimitExcept GET POST OPTIONS PROPFIND>
Order deny,allow
Deny from all
</LimitExcept>


Except you use WebDav - which shouldn't be used:

<LimitExcept GET POST>
Order deny,allow
Deny from all
</LimitExcept>

Will be enough.


<Directory "/var/www/html">
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all


If you don't use .htaccess - change AllowOverride to "AllowOverride None"


<IfModule mod_suphp.c>
suPHP_Engine On
suPHP_UserGroup webapps webapps
</IfModule>
</Directory>


If you don't have a Vhost running - use mod_php or FastCGI instead of suPHP


<IfModule dir_module>
DirectoryIndex index.html index.htm index.shtml index.php index.php5 index.php4 index.php3 index.phtml index.cgi
</IfModule>


DirectoryIndex index.php

Will be enough for Vbulletin


Include conf/extra/httpd-mpm.conf


Here are the min / max server settings configured.


Include conf/extra/httpd-multilang-errordoc.conf
Include conf/extra/httpd-autoindex.conf
Include conf/extra/httpd-languages.conf
Include conf/extra/httpd-info.conf
Include conf/extra/httpd-vhosts.conf
Include conf/extra/httpd-dav.conf
Include conf/extra/httpd-ssl.conf
Include conf/extra/httpd-deflate.conf
Include conf/extra/directadmin-vhosts.conf
Include conf/extra/httpd-suphp.conf


Here some sorting out can be done as well. If you don't use DAV / SSL as example.

And:


<Directory />
Options All
AllowOverride All
</Directory>


Why is this there ? :confused: Shouldn't it be:

<Directory />
AllowOverride None
Order deny,allow
Deny from all
</Directory>

So far to "fine" Apache settings ;)

y2ksw
11-08-2008, 03:32 PM
open_files_limit=8192
max_allowed_packet=16M
max_connections=800
connect_timeout=10

I would not set any open file limit, or at most very high, and the packet size to 1M unless you have huge queries.

Also a number of 800 connections seem to me pretty high. A connection timeout of 10 seconds on the other hand may be too low, depending on your server load.

You may also try (carefully) permanent connections, which may help to reduce memory usage and speed certain things sensibly up, in particular when you have a lot of users and high hit rates.

ImmortalForums
11-10-2008, 07:54 PM
This would be best to post on vbulletin.com server forum where they can give u a full list of variables to put in.

Also check on vbseo.com forums for how to optimize vbseo as its very load intensive if not done right.

Carnage
11-15-2008, 08:50 AM
for 300 users online i suspect your server specs are too low.

My forum probably averages 300 online; i run a dual quad core xeon (2ghz) with 4 gb of ram. Granted the box also runs another fairly large site and about a dozen smaller sites - several of which run vb.

Only time i've noticed issues were when we got a /. effect and had ~2000 online users.