LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 07-17-2008, 11:34 AM   #16
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 269Reputation: 269Reputation: 269

Quote:
but it's only one user-db... how to log as admin to get from all users?
phpBB uses the configured admin account for database connections within the application. It doesn't grant individual users direct access to update the tables, etc.
 
Old 07-17-2008, 11:34 AM   #17
Stephan_Craft
Member
 
Registered: Jul 2008
Posts: 184

Original Poster
Rep: Reputation: 30
and how to use it?
 
Old 07-17-2008, 11:36 AM   #18
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 269Reputation: 269Reputation: 269
Can you post your full my.cnf file?
 
Old 07-17-2008, 11:36 AM   #19
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 269Reputation: 269Reputation: 269
bash tuning-primer.sh or make it executable with chmod +x tuning-primer.sh and then just run it like ./tuning-primer.sh
 
Old 07-17-2008, 11:47 AM   #20
Stephan_Craft
Member
 
Registered: Jul 2008
Posts: 184

Original Poster
Rep: Reputation: 30
my.cnf
[mysqld]
bind-address=*.*.*.*
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
skip-locking
skip-innodb
skip-networking
skip-bdb
skip-ndbcluster
skip-external-locking
skip-name-resolve
query_cache_limit=100M
query_cache_size=600M
query_cache_type=1
max_connections=1000
interactive_timeout=10
wait_timeout=10
connect_timeout=10
thread_cache_size=500
key_buffer=1000M
join_buffer=1M
max_allowed_packet=16M
table_cache=1024
record_buffer=32M
sort_buffer_size=64M
read_buffer_size=64M
max_connect_errors=10
# Try number of CPU's*2 for thread_concurrency
thread_concurrency=16
#set-variable = myisam_sort_buffer_size=64M
#log-bin

tmp_table_size=2000M
max_heap_table_size=450M

[client]
socket=/var/lib/mysql/mysql.sock

[mysqladmin]
socket=/var/lib/mysql/mysql.sock

[mysql.server]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
basedir=/var/lib

[safe_mysqld]
err-log=/var/log/mysqld.log
pid-file=/var/lib/mysql/mysql.pid
open_files_limit=8192

[mysqldump]
quick
max_allowed_packet=16M

[mysql]
no-auto-rehash
socket=/var/lib/mysql/mysql.sock
#safe-updates

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

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

[mysqlhotcopy]
interactive-timeout

Last edited by Stephan_Craft; 07-17-2008 at 11:54 AM.
 
Old 07-17-2008, 11:49 AM   #21
Stephan_Craft
Member
 
Registered: Jul 2008
Posts: 184

Original Poster
Rep: Reputation: 30
-- MYSQL PERFORMANCE TUNING PRIMER --
- By: Matthew Montgomery -

MySQL Version 4.1.22-standard x86_64

Uptime = 0 days 7 hrs 42 min 56 sec
Avg. qps = 512
Total Questions = 14242404
Threads Connected = 142

Warning: Server has not been running for at least 48hrs.
It may not be safe to use these recommendations

To find out more information on how each of these
runtime variables effects performance visit:
http://dev.mysql.com/doc/refman/4.1/...variables.html
Visit http://www.mysql.com/products/enterprise/advisors.html
for info about MySQL's Enterprise Monitoring and Advisory Service

SLOW QUERIES
The slow query log is NOT enabled.
Current long_query_time = 10 sec.
You have 31 out of 14244485 that take longer than 10 sec. to complete
Your long_query_time may be too high, I typically set this under 5 sec.

BINARY UPDATE LOG
The binary update log is NOT enabled.
You will not be able to do point in time recovery
See http://dev.mysql.com/doc/refman/4.1/...-recovery.html

WORKER THREADS
Current thread_cache_size = 500
Current threads_cached = 430
Current threads_per_sec = 0
Historic threads_per_sec = 0
Your thread_cache_size is fine

MAX CONNECTIONS
Current max_connections = 1000
Current threads_connected = 98
Historic max_used_connections = 1001
The number of used connections is 100% of the configured maximum.
You should raise max_connections

MEMORY USAGE
Max Memory Ever Allocated : 128 G
Configured Max Per-thread Buffers : 126 G
Configured Max Global Buffers : 1 G
Configured Max Memory Limit : 127 G
Physical Memory : 11.73 G

Max memory limit exceeds 90% of physical memory

KEY BUFFER
Current MyISAM index space = 1 G
Current key_buffer_size = 1000 M
Key cache miss rate is 1 : 1092
Key buffer fill ratio = 20.00 %
Your key_buffer_size seems to be too high.
Perhaps you can use these resources elsewhere

QUERY CACHE
Query cache is enabled
Current query_cache_size = 600 M
Current query_cache_used = 68 M
Current query_cache_limit = 100 M
Current Query cache Memory fill ratio = 11.42 %
Current query_cache_min_res_unit = 4 K
Query Cache is 26 % fragmented
Run "FLUSH QUERY CACHE" periodically to defragment the query cache memory
If you have many small queries lower 'query_cache_min_res_unit' to reduce fragmentation.
Your query_cache_size seems to be too high.
Perhaps you can use these resources elsewhere
MySQL won't cache query results that are larger than query_cache_limit in size

SORT OPERATIONS
Current sort_buffer_size = 64 M
Current read_rnd_buffer_size = 256 K
Sort buffer seems to be fine

JOINS
Current join_buffer_size = 1.00 M
You have had 11179 queries where a join could not use an index properly
You should enable "log-queries-not-using-indexes"
Then look for non indexed joins in the slow query log.
If you are unable to optimize your queries you may want to increase your
join_buffer_size to accommodate larger joins in one pass.

Note! This script will still suggest raising the join_buffer_size when
ANY joins not using indexes are found.

OPEN FILES LIMIT
Current open_files_limit = 5000 files
The open_files_limit should typically be set to at least 2x-3x
that of table_cache if you have heavy MyISAM usage.
Your open_files_limit value seems to be fine

TABLE CACHE
Current table_cache value = 1024 tables
You have a total of 522 tables
You have 1024 open tables.
Current table_cache hit rate is 3%, while 100% of your table cache is in use
You should probably increase your table_cache

TEMP TABLES
Current max_heap_table_size = 449 M
Current tmp_table_size = 1.95 G
Of 931448 temp tables, 1% were created on disk
Effective in-memory tmp_table_size is limited to max_heap_table_size.
Created disk tmp tables ratio seems fine

TABLE SCANS
Current read_buffer_size = 63 M
Current table scan ratio = 2174 : 1
read_buffer_size is over 8 MB there is probably no need for such a large read_buffer

TABLE LOCKING
Current Lock Wait ratio = 1 : 5
You may benefit from selective use of InnoDB.
If you have long running SELECT's against MyISAM tables and perform
frequent updates consider setting 'low_priority_updates=1'
 
Old 07-17-2008, 11:52 AM   #22
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 269Reputation: 269Reputation: 269
Also Threads_running | 146 | and Threads_connected | 178 | seems high. You may want to tweak the Threads settings.

thread_cache - Thread creation/destructions can be expensive, which happen at each connect/disconnect. I normally set this value to at least 16. If application has large jumps in amount of concurrent connections and I see fast growth of
Threads_Created variable I boost it higher. The goal is not to have threads created in normal operation.
 
Old 07-17-2008, 11:54 AM   #23
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 269Reputation: 269Reputation: 269
Quote:
Originally Posted by trickykid View Post
Also Threads_running | 146 | and Threads_connected | 178 | seems high. You may want to tweak the Threads settings.

thread_cache - Thread creation/destructions can be expensive, which happen at each connect/disconnect. I normally set this value to at least 16. If application has large jumps in amount of concurrent connections and I see fast growth of
Threads_Created variable I boost it higher. The goal is not to have threads created in normal operation.
Okay so you already have 500 set for thread cache, so that's not a problem. I'd say read through the tuning primer script you just ran and make the changes that it suggests.
 
Old 07-17-2008, 11:55 AM   #24
Stephan_Craft
Member
 
Registered: Jul 2008
Posts: 184

Original Poster
Rep: Reputation: 30
tell my what to put in my.cnf
now it's the pick up time
the best time to test
 
Old 07-17-2008, 12:02 PM   #25
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 269Reputation: 269Reputation: 269
Quote:
Originally Posted by Stephan_Craft View Post
Your long_query_time may be too high, I typically set this under 5 sec.
I'd say set this to 5 instead of 10.

Quote:
MAX CONNECTIONS
Current max_connections = 1000
Current threads_connected = 98
Historic max_used_connections = 1001
The number of used connections is 100% of the configured maximum.
You should raise max_connections
I'd say, raise this like suggested.

Quote:
KEY BUFFER
Current MyISAM index space = 1 G
Current key_buffer_size = 1000 M
Key cache miss rate is 1 : 1092
Key buffer fill ratio = 20.00 %
Your key_buffer_size seems to be too high.
Perhaps you can use these resources elsewhere
I'd say lower your buffer size.

Quote:
QUERY CACHE
Query cache is enabled
Current query_cache_size = 600 M
Current query_cache_used = 68 M
Current query_cache_limit = 100 M
Current Query cache Memory fill ratio = 11.42 %
Current query_cache_min_res_unit = 4 K
Query Cache is 26 % fragmented
Run "FLUSH QUERY CACHE" periodically to defragment the query cache memory
If you have many small queries lower 'query_cache_min_res_unit' to reduce fragmentation.
Your query_cache_size seems to be too high.
Perhaps you can use these resources elsewhere
MySQL won't cache query results that are larger than query_cache_limit in size
I'd say lower the query_cache_min_res_unit as it suggests, this might eliminate the need to run FLUSH QUERY CACHE periodically.

Quote:
JOINS
Current join_buffer_size = 1.00 M
You have had 11179 queries where a join could not use an index properly
You should enable "log-queries-not-using-indexes"
Then look for non indexed joins in the slow query log.
If you are unable to optimize your queries you may want to increase your
join_buffer_size to accommodate larger joins in one pass.
I'd say just raise the join_buffer_size, probably has minimal impact right now.

Quote:
TABLE CACHE
Current table_cache value = 1024 tables
You have a total of 522 tables
You have 1024 open tables.
Current table_cache hit rate is 3%, while 100% of your table cache is in use
You should probably increase your table_cache
Increase this, perhaps double it to 2048.

Quote:
TABLE SCANS
Current read_buffer_size = 63 M
Current table scan ratio = 2174 : 1
read_buffer_size is over 8 MB there is probably no need for such a large read_buffer
I'd say lower it to the standard 8 MB.

Quote:
TABLE LOCKING
Current Lock Wait ratio = 1 : 5
You may benefit from selective use of InnoDB.
If you have long running SELECT's against MyISAM tables and perform
frequent updates consider setting 'low_priority_updates=1'
I'd actually suggest using InnoDB. Seems your server is hit pretty hard. There's a lot of locking and transactions being performed it seems. InnoDB would probably be beneficial but it would be a lot of work to convert existing tables to InnoDB from MyISAM. If you got a machine to test from a mysqldump, I'd suggest that first to make sure phpBB doesn't barf, etc.
 
Old 07-17-2008, 12:07 PM   #26
Stephan_Craft
Member
 
Registered: Jul 2008
Posts: 184

Original Poster
Rep: Reputation: 30
I change it to:

[mysqld]
bind-address=*.*.*.*
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
skip-locking
skip-innodb
skip-networking
skip-bdb
skip-ndbcluster
skip-external-locking
skip-name-resolve
query_cache_limit=100M
query_cache_size=100M
query_cache_type=1
max_connections=10000
interactive_timeout=10
wait_timeout=10
connect_timeout=10
thread_cache_size=500
key_buffer=256M
join_buffer=64M
max_allowed_packet=16M
table_cache=2048
record_buffer=32M
sort_buffer_size=64M
read_buffer_size=8M
max_connect_errors=10
# Try number of CPU's*2 for thread_concurrency
thread_concurrency=16
#set-variable = myisam_sort_buffer_size=64M
#log-bin
tmp_table_size=2000M
max_heap_table_size=450M

[client]
socket=/var/lib/mysql/mysql.sock

[mysqladmin]
socket=/var/lib/mysql/mysql.sock

[mysql.server]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
basedir=/var/lib

[safe_mysqld]
err-log=/var/log/mysqld.log
pid-file=/var/lib/mysql/mysql.pid
open_files_limit=8192

[mysqldump]
quick
max_allowed_packet=16M

[mysql]
no-auto-rehash
socket=/var/lib/mysql/mysql.sock
#safe-updates

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

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

[mysqlhotcopy]
interactive-timeout
 
Old 07-17-2008, 12:10 PM   #27
Stephan_Craft
Member
 
Registered: Jul 2008
Posts: 184

Original Poster
Rep: Reputation: 30
Still the error exist!
As I know from my experience, nothing in my.cnf can fix it

Quote:
MAX CONNECTIONS
Current max_connections = 10000
Current threads_connected = 88
Historic max_used_connections = 262
The number of used connections is 2% of the configured maximum.
You are using less than 10% of your configured max_connections.
Lowering max_connections could help to avoid an over-allocation of memory
See "MEMORY USAGE" section to make sure you are not over-allocating
 
Old 07-17-2008, 12:10 PM   #28
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 269Reputation: 269Reputation: 269
Quote:
Originally Posted by Stephan_Craft View Post
tell my what to put in my.cnf
now it's the pick up time
the best time to test
Not really, you'd have to do a restart of mysql. Best time to make changes is off peak hours really. But I'd say start by raising your max connections, which you can do on the fly without a restart, then do rest of changes when you can perform a restart:

Code:
set GLOBAL max_connections=2000;
 
Old 07-17-2008, 12:12 PM   #29
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 269Reputation: 269Reputation: 269
Okay so it's changed and you have it set to 10000 now. Make the other changes to your my.cnf and restart. You could allow that script to create one for you, look at differences and apply changes to current my.cnf.
 
Old 07-17-2008, 12:13 PM   #30
Stephan_Craft
Member
 
Registered: Jul 2008
Posts: 184

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by trickykid View Post
Okay so it's changed and you have it set to 10000 now. Make the other changes to your my.cnf and restart. You could allow that script to create one for you, look at differences and apply changes to current my.cnf.
I did all what the script suggested, make a restart. Not helped!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
linux home router reboot itself when NAT'ing for large number of connections asimov Linux - Networking 8 03-01-2008 09:22 AM
LXer: This week at LWN: Large pages, large blocks, and large problems LXer Syndicated Linux News 0 09-27-2007 11:40 AM
2000 MySQL connections, still "too many connections" newlinuxnewbie Linux - General 0 11-07-2005 01:03 PM
Bash and mysql connections. tia24 Linux - Newbie 1 04-13-2004 01:15 PM
mysql connections srikz Red Hat 1 01-17-2004 07:39 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:36 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration