justbenice
02-27-2004, 07:35 AM
Hello ,
My server having a very strange problem , after turn on server 5 minute , my server load rise up to 50 . And it very slow , but after i restart apache and sql , everything back to normal , But it just normal for a few minute ,and ram usege , serverload rising again .
I am in dual xeon and 2G ram .
This is my my.cnf
[mysql]
[mysqld]
max_connections=500
thread_concurrency=2
skip-networking
myisam_sort_buffer_size=128M
long_query_time=3
wait_timeout=100
key_buffer=1024M
join_buffer=1M
record_buffer=1M
sort_buffer=1M
read_buffer=1M
table_cache=1500
thread_cache_size=256
connect_timeout=10
tmp_table_size=42M
max_allowed_packet=16M
max_connect_errors=10
query_cache_limit=2M
query_cache_size=128M
query_cache_type=1
skip-innodb
[mysqld_safe]
open_files_limit=8192
[mysqldump]
quick
set-variable = max_allowed_packet=16M
[myisamchk]
set-variable = key_buffer=128M
set-variable = sort_buffer=128M
set-variable = read_buffer=16M
set-variable = write_buffer=16M
Any one can help me ?
Thank you
NexDog
02-27-2004, 07:43 AM
Damn, I would tame that down ALOT. If someone is caning your mysql, use:
set-variable = max_user_connections=30
set-variable = max_connections=150
That will stop alot of abuse. Alse max_allowed_packet=1M.
justbenice
02-27-2004, 07:52 AM
i have a forum with more than 50 000 member , more than 1500 user online , so i can't set that set-variable = max_connections=150 . My server can handle my forum , this strange thing only happen 2 week ago after i updrage mysql version and recompile apache . :(
2 week before when everything was ok , i check in Current CPU Usage and only see ONE big sql processing .
But now i see tons of :
26354 mysql 0 2. 0 /usr/sbin/mysqld--basedir=/--datadir=/var/lib/mysql--user=mysql--pid-file=/var/lib/mysql/monster.vntoday-network.com.pid--skip-locking
7809 mysql 0 2. 0 /usr/sbin/mysqld--basedir=/--datadir=/var/lib/mysql--user=mysql--pid-file=/var/lib/mysql/monster.vntoday-network.com.pid--skip-locking
27331 mysql 0 2. 0 /usr/sbin/mysqld--basedir=/--datadir=/var/lib/mysql--user=mysql--pid-file=/var/lib/mysql/monster.vntoday-network.com.pid--skip-locking
22248 mysql 0 2. 0 /usr/sbin/mysqld--basedir=/--datadir=/var/lib/mysql--user=mysql--pid-file=/var/lib/mysql/monster.vntoday-network.com.pid--skip-locking
31151 mysql 0 2. 0 /usr/sbin/mysqld--basedir=/--datadir=/var/lib/mysql--user=mysql--pid-file=/var/lib/mysql/monster.vntoday-network.com.pid--skip-locking
24278 mysql 0 2. 0 /usr/sbin/mysqld--basedir=/--datadir=/var/lib/mysql--user=mysql--pid-file=/var/lib/mysql/monster.vntoday-network.com.pid--skip-locking
19465 mysql 0 2. 0 /usr/sbin/mysqld--basedir=/--datadir=/var/lib/mysql--user=mysql--pid-file=/var/lib/mysql/monster.vntoday-network.com.pid--skip-locking
29227 root 0 0. 0 op -n 2 -b -c
3084 mysql 0 2. 0 /usr/sbin/mysqld--basedir=/--datadir=/var/lib/mysql--user=mysql--pid-file=/var/lib/mysql/monster.vntoday-network.com.pid--skip-locking
19153 mysql 0 2. 0 /usr/sbin/mysqld--basedir=/--datadir=/var/lib/mysql--user=mysql--pid-file=/var/lib/mysql/monster.vntoday-network.com.pid--skip-locking
15392 mysql 0 2. 0 /usr/sbin/mysqld--basedir=/--datadir=/var/lib/mysql--user=mysql--pid-file=/var/lib/mysql/monster.vntoday-network.com.pid--skip-locking
5489 mysql 0 2. 0 /usr/sbin/mysqld--basedir=/--datadir=/var/lib/mysql--user=mysql--pid-file=/var/lib/mysql/monster.vntoday-network.com.pid--skip-locking
14690 mysql 0 2. 0 /usr/sbin/mysqld--basedir=/--datadir=/var/lib/mysql--user=mysql--pid-file=/var/lib/mysql/monster.vntoday-network.com.pid--skip-locking
16058 mysql 0 2. 0 /usr/sbin/mysqld--basedir=/--datadir=/var/lib/mysql--user=mysql--pid-file=/var/lib/mysql/monster.vntoday-network.com.pid--skip-locking
4169 mysql 0 2. 0 /usr/sbin/mysqld--basedir=/--datadir=/var/lib/mysql--user=mysql--pid-file=/var/lib/mysql/monster.vntoday-network.com.pid--skip-locking
1142 mysql 0 2. 0 /usr/sbin/mysqld--basedir=/--datadir=/var/lib/mysql--user=mysql--pid-file=/var/lib/mysql/monster.vntoday-network.com.pid--skip-locking
JanetGeorge
02-27-2004, 09:19 AM
My forum isn't as big as yours - 165 online is our record, although we usually have at least 100. My server isn't as big either BUT I was having endless trouble with memory and server load.
I THOUGHT I couldn't reduce max connections in MySQL and MaxClients in Apache BUT at any one time - even with 100 users online, I never had more than 10 httpd processes and about 5 MySQL processes DOING something. The rest were sitting on their backsides using memory!
I chopped max.clients back to 32 - with 100 users online there are STILL only 10 httpd processes in use and about 3 MySQL!
Run top while your forum is busy. Try sorting for CPU and see how many httpd/MySQL processes are actually DOING something. Then sort for memory and see how many are actually DOING something. Reconfigure accordingly.
Jakiao
02-27-2004, 05:45 PM
The problem with your idea, Janet, is that it is different over a lot of servers. You had 10 active apache with 100 people. Lets assume that just's traffic is directly proportional to yours. That makes Just's server having no less than 160 active apache processes and 48 mySQL processes. See the problem?
WCHost
02-28-2004, 12:31 AM
Max_user_connections......30???
That will be so little for clients who have over 30 people online at a same time loading mysql at the same time!
=/
Jakiao
02-28-2004, 12:36 AM
Let me put it this way: it doesn't matter the number, just as long as it is more than you need. I know that I don't need more than 500 at any given moment, but still have it set to 16,000. It wont hurt the server to have that many available is you aren't using all of them.
JanetGeorge
02-28-2004, 05:24 AM
The bottom line is that every Apache or MySQL process running uses memory, even doing nothing. If it works for you, fine, although I don't know how. All I know is that on MY server with MY forum. max.connections set at 32 works WELL with an AVERAGE of 100 users online. For anyone having Memory problems, it is worth looking at the actual number of connections THEY need.