Previous Thread
Next Thread
Print Thread
Rating: 5
Page 1 of 2 1 2
Let's tune MySQL! #253430
07/11/2003 4:05 PM
07/11/2003 4:05 PM
Joined: Feb 2002
Posts: 1,969
Lansing, Michigan
M
msula Offline OP
Addict
msula  Offline OP
Addict
M
Joined: Feb 2002
Posts: 1,969
Lansing, Michigan
Granted, if you are on a shared hosting solution, you won't have much control over these changes, but most hosts will tune their MySQL as much as possible.

But if you are hosting your forum on a dedicated server and have full control over your configuration, this may help. A lot of times, MySQL is installed without any detailed configuration file. While this works, it may not be optimal for your use.

So, we'll start there. The config file for MySQL is called "my.cnf". On linux servers, it is typically located in the /etc directory. If you are unsure of where yours is located, at a command prompt type "locate my.cnf". If you are on windows, you can edit the file named my.ini in the C:\WINNT or C:\Windows directory.

If you open that file and see it is almost empty, then you have a lot of different options. Typically, the MySQL installation directory will have some example my.cnf files for you to use.

my-small.cnf � For systems with less than 64MB of RAM, where MySQL is used occasionally.

my-medium.cnf � For systems with less than 64MB of RAM, where MySQL is the primary activity on the system, or for systems with up to 128MB of RAM, where MySQL shares the box with other processes. This is the most common configuration, where MySQL is installed on the same box as a Web server and receives a moderate amount of traffic.

my-large.cnf � For a system with 128MB to 512MB of RAM, where MySQL is the primary activity.

my-huge.cnf � For a system with 1GB to 2GB of RAM, where MySQL is the primary activity

These are excellent places to start. You can copy the contents of the file you choose to use into your existing my.cnf file, or just move and rename the appropriate file.

A word of warning, if your server hosts other websites, and is running a lot of httpd processes, you will probably not want to run the huge.cnf file, as almost all of your resources will be used by MySQL, possibly not leaving enough for HTTP.

So, you have filled your my.cnf file with goodies.. its time to put it into action. You will need to restart MySQL for these changes to take effect. That was the easy part, you may or may not notice much performance difference yet. So, to dig a little deeper, we need to analyze what mysql is doing, and how well it is performing.

For you command line junkies, you can find out some information by typing this command: mysqladmin extended-status That will display a lot of important information.

But, to make it easier on you I have attached a script that you can run on your server that will provide current server loads, current running processes, netstat information, the extended-status information from mysql, and some important calculations regarding mysql queries and cache.

So, when you run the script, what do you see? A lot of information that probably gives you a headache That's ok, we don't need to understand ALL of it to get the most out of MySQL.

There are two primary start-up parameters that will affect your system the most: key_buffer_size and table_cache. If you get only two server parameters correctly tuned, make sure they're these two!

The value of key_buffer_size is the size of the buffer used with indexes. The larger the buffer, the faster the SQL command will finish and a result will be returned. Try to find the fine line between finely tuned and over-optimized; you may have a key_buffer_size of 256MB on a system with 512MB of RAM, but any more than 256MB could cause degraded server performance.

A simple way to check the actual performance of the buffer is to examine four additional variables: key_read_requests, key_reads, key_write_requests, and key_writes.

Find the rows that look something like this (your values will differ):

Code
| Key_read_requests    | 602843 |
| Key_reads            | 151    |
| Key_write_requests   | 1773   |
| Key_writes           | 805    |


If you divide the value of key_read by the value of key_reads_requests, the result should be less than 0.01. Also, if you divide the value of key_write by the value of key_writes_requests, the result should be less than 1. Using the values above, we have results of 0.000250479809834401 and 0.454032712915962 respectively, well within the acceptable parameters. To try to get these numbers even smaller, more tuning could occur by increasing the value of key_buffer_size, but these numbers would be fine to leave as they are.

The other important server parameter is table_cache, which is the number of open tables for all threads. The default is 64, but you may need to adjust this number. Look for a variable called open_tables in the output. If this number is large, the value of table_cache should be increased.

Each time MySQL accesses a table, it places it in the cache. If your system accesses many tables, it is faster to have these in the cache. A good way to see whether your system needs to increase this is to examine the value of open_tables at peak times (one of the extended status values, above). If you find it stays at the same value as your table_cache value, and then the number of opened_tables starts increasing, you should increase the table_cache if you have enough memory.

The sample configuration files use various combinations of key_buffer_size and table_cache, which you can use as a baseline for any modifications you need to make. Whenever you modify your configuration, you'll be restarting your server in order for changes to take effect, sometimes with no knowledge of the consequences of your changes. In this case, be sure to try your modifications in a development environment before rolling the changes into production.

Let's use some scenarios to further illustrate:

Scenario 1
table_cache - 512
open_tables - 98
opened_tables - 1513
uptime - 3046085

Here it looks like the table cache has been set too high. The server has been up for ages, the number of opened_tables is relatively low, and the open_tables (remember we're checking at a peak time) is nowhere near what it could be.

Scenario 2
table_cache - 64
open_tables - 64
opened_tables - 517
uptime - 1662790 (measure in seconds)

Here, although the open_tables is maxed out, the number of open_tables is very low even though the server has been up for ages. There is probably not much benefit in upping the table_cache (this example comes from a development server).


Scenario 3
table_cache - 64
open_tables - 64
opened_tables - 13918
uptime - 33754
This table_cache is set too low. The open_tables is running at maximum, and the number of open_tables is high, even though the uptime is less than a day. If you have the memory, up the table_cache. One thing to note is that even if you only have 64 tables in your database, you may still have more open tables. MySQL, being multi-threaded, may be running many queries on the table at one time, and each of these will open a table.

Scenario 4
key_buffer_size - 402649088 (384M)
Key_read_requests - 609601541
Key_reads - 67299


Scenario 5
key_buffer_size - 16777216 (16M)
Key_read_requests - 609601541
Key_reads - 46729832
The values in scenario 1 are looking healthy. The ratio of key_reads to key_read_requests should be as low as possible, no more than 1:100. In scenario 1 it is close to 1:10000. In scenario 2, it is shocking, about 1:15, and the key_buffer size should be increased to as much as the memory allows (you can see that RAM is the primary hardware upgrade you can do to improve your system).

Lastly, if you are using MySQL 4.x, a few new variables have been introduced that will help your performance tremendously:

query_cache_limit = 1M
query_cache_size = 32M
query_cache_type = 1

You may want to drop query_cache_size to 16M if you have only 1GB of ram, and maybe even lower if you have less ram.

Again, these are just guidelines and rules of thumb to help you better get the most performance. Each machine is slightly different, and different values will apply. So you may need to really sit down and experiment to find the fine line between optimized and overkill.

Attached Files
88576-stats.txt (932 downloads)
Sponsored Links
Re: Let's tune MySQL! [Re: palmen] #253431
07/11/2003 4:08 PM
07/11/2003 4:08 PM
Joined: Feb 2002
Posts: 1,969
Lansing, Michigan
M
msula Offline OP
Addict
msula  Offline OP
Addict
M
Joined: Feb 2002
Posts: 1,969
Lansing, Michigan
Notice, you'll have to edit your login information in the attached script for it to work

Re: Let's tune MySQL! [Re: palmen] #253432
07/11/2003 5:41 PM
07/11/2003 5:41 PM
Joined: Aug 2002
Posts: 1,271
Vienna, Austria
dimopoulos Offline
Kahuna
dimopoulos  Offline
Kahuna
Joined: Aug 2002
Posts: 1,271
Vienna, Austria
Jer you are a superstar!! Thanks a bunch!


Nikos
Re: Let's tune MySQL! [Re: palmen] #253433
07/11/2003 5:49 PM
07/11/2003 5:49 PM
Joined: Apr 2002
Posts: 1,929
Virginia, USA
D
Dave_L_dup1 Offline
Addict
Dave_L_dup1  Offline
Addict
D
Joined: Apr 2002
Posts: 1,929
Virginia, USA

Re: Let's tune MySQL! [Re: joeuser] #253434
07/11/2003 7:19 PM
07/11/2003 7:19 PM
Joined: Oct 2000
Posts: 2,518
navahoville! :D
N
navaho Offline
Veteran
navaho  Offline
Veteran
N
Joined: Oct 2000
Posts: 2,518
navahoville! :D
I just made this post sticky so people can book mark it.

Good job, Jeremy.


Picture perfect penmanship here.
Sponsored Links
Re: Let's tune MySQL! [Re: palmen] #253435
07/11/2003 8:29 PM
07/11/2003 8:29 PM
Joined: Jun 2001
Posts: 4,097
J
JustDave Offline
That 70's Guy
JustDave  Offline
That 70's Guy
J
Joined: Jun 2001
Posts: 4,097
Very nice job!

Re: Let's tune MySQL! [Re: sjsaunders] #253436
07/11/2003 9:38 PM
07/11/2003 9:38 PM
Joined: Feb 2002
Posts: 1,969
Lansing, Michigan
M
msula Offline OP
Addict
msula  Offline OP
Addict
M
Joined: Feb 2002
Posts: 1,969
Lansing, Michigan
I can't take all the credit, I pieced together a lot of information I've been saving from across the internet

Re: Let's tune MySQL! [Re: palmen] #253437
07/11/2003 9:51 PM
07/11/2003 9:51 PM
Joined: Mar 2003
Posts: 171
Southern California
BWilliams_dup1 Offline
Member
BWilliams_dup1  Offline
Member
Joined: Mar 2003
Posts: 171
Southern California
I just ran the script and to be honest I have no idea what I am doing, but I am getting a bit concerned with the speed of the forum and wanted to see if this shows anything that would point the finger to the hosting company.

Here is the info I got:

Fri Jul 11 19:46:19 PDT 2003 7:46pm up 11 days, 4:10, 1 user, load average: 1.83, 3.65, 6.84 319 processes: 303 sleeping, 11 running, 5 zombie, 0 stopped Mem: 2582300K av, 2563864K used, 18436K free, 0K shrd, 185480K buff Swap: 4194192K av, 77868K used, 4116324K free 1885028K cached PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME COMMAND 14707 nobody 16 0 1220 1220 828 R 14.9 0.0 0:00 top Http processes currently running = 95 Mysql processes currently running = 5 Netstat information summary 1 CLOSING 1 LAST_ACK 2 FIN_WAIT2 6 SYN_RECV 15 FIN_WAIT1 22 LISTEN 183 ESTABLISHED 1078 TIME_WAIT


Can someone decifer the above info to me?

P.S.- Jeremy, I have been playing on your site and man is it fast compared to mine. The truck club is growning a lot faster than expected, so it looks like I may have to get away from the $9.95 / month hosting and get you to help me out in transfering it

Re: Let's tune MySQL! [Re: vajraman] #253438
07/11/2003 10:00 PM
07/11/2003 10:00 PM
Joined: Feb 2002
Posts: 1,969
Lansing, Michigan
M
msula Offline OP
Addict
msula  Offline OP
Addict
M
Joined: Feb 2002
Posts: 1,969
Lansing, Michigan
Well, the first part of your results, and somewhat important is the load average. 1.83 is the 1 minute average, 3.65 is the 5 min, and 6.84 is a 15 minute average. This is showing average to slightly high loads (hard to really say for sure without knowing server hardware)

So.. the first clue is that the server may be slightly overworked. The second clue, is you see 300+ processes running. This is typical for a busy server.. not terribly alarming.

Next on the list is memory. as you can see, only 18436K is free, This isn't a lot. When you run low on memory, things need to be stored on the hard drive... which is the swap. Reading and writing data to a disk is much slower than to ram.

So, that is the jist of what that part you posted is. Again, nothing terribly alarming or really sticks out, it just seems to be a kinda busy server, which may be part of your slowdown. The one load average of almost 7 is kinda high, so if the server frequently spikes like that, that may be part of the problem. Or, it could be just the host not having MySQL optimized as well as they should, or a number of things

Re: Let's tune MySQL! [Re: palmen] #253439
07/11/2003 10:47 PM
07/11/2003 10:47 PM
Joined: Nov 2001
Posts: 11,330
Charlotte, NC
JoshPet Offline
I type Like navaho
JoshPet  Offline
I type Like navaho
Joined: Nov 2001
Posts: 11,330
Charlotte, NC
Jeremy -
This is awesome!

Great work! Thanks for posting it.

Sponsored Links
Re: Let's tune MySQL! [Re: palmen] #253440
07/12/2003 8:54 AM
07/12/2003 8:54 AM
Joined: Apr 2001
Posts: 3,440
abingdon,md
O
omegatron Offline
Member
omegatron  Offline
Member
O
Joined: Apr 2001
Posts: 3,440
abingdon,md
well I edited and entered MYSQL user and password and this is all I get when I run the script.

Sat Jul 12 09:53:01 EDT 2003 Http processes currently running = 5 Mysql processes currently running = 6 Netstat information summary

I do not see where to set a path maybe mysql is dieing from improper path. I know the login is correct as I can telnet in no problem and run mysqladmin extended-status however I have to set the path first


Re: Let's tune MySQL! [Re: sf49rminer] #253441
07/12/2003 9:24 AM
07/12/2003 9:24 AM
Joined: Feb 2002
Posts: 1,969
Lansing, Michigan
M
msula Offline OP
Addict
msula  Offline OP
Addict
M
Joined: Feb 2002
Posts: 1,969
Lansing, Michigan
Code
 <br />/*** <br />  Configure statistic gathering programs; specify path if necessary <br />***/ <br /> <br />$netstat = 'netstat -a -n|grep -E "^(tcp)"| cut -c 68-|sort|uniq -c|sort -n'; <br />$http = "ps -auxww | grep -c http"; <br />$mysql = "ps -auxww | grep -c mysql"; <br />$top = "top"; <br />$uptime = "uptime"; <br />$free = "free"; <br />$mysqladmin = "/set/path/here/mysqladmin"; <br />


I think this would do what you need

Re: Let's tune MySQL! [Re: palmen] #253442
07/12/2003 9:28 AM
07/12/2003 9:28 AM
Joined: Apr 2001
Posts: 3,440
abingdon,md
O
omegatron Offline
Member
omegatron  Offline
Member
O
Joined: Apr 2001
Posts: 3,440
abingdon,md
Yeah I did that and the results are the same. If we look at my output where is it dieing at TOP??

Re: Let's tune MySQL! [Re: sf49rminer] #253443
07/12/2003 9:47 AM
07/12/2003 9:47 AM
Joined: Feb 2002
Posts: 1,969
Lansing, Michigan
M
msula Offline OP
Addict
msula  Offline OP
Addict
M
Joined: Feb 2002
Posts: 1,969
Lansing, Michigan
You said all you get is this:

[]Sat Jul 12 09:53:01 EDT 2003 Http processes currently running = 5 Mysql processes currently running = 6 Netstat information summary [/]

So, like you mentioned, it looks like it is running netstat, http, and mysql fine.. but nothing after Top.

Can you just type top at the command line without a path?

EDIT: Actually, netstat isn't running either, since that would be listing some information as well. So it looks like just the ps -auxww commands are running, you may need paths for everything.

Last edited by Jeremy; 07/12/2003 9:49 AM.
Re: Let's tune MySQL! [Re: palmen] #253444
07/12/2003 10:00 AM
07/12/2003 10:00 AM
Joined: Apr 2001
Posts: 3,440
abingdon,md
O
omegatron Offline
Member
omegatron  Offline
Member
O
Joined: Apr 2001
Posts: 3,440
abingdon,md
top will not run at the path

so what are the normal paths or folders?

Re: Let's tune MySQL! [Re: palmen] #253445
07/13/2003 2:35 PM
07/13/2003 2:35 PM
Joined: Mar 2000
Posts: 25,587
Texas
AllenAyres Offline
I type Like navaho
AllenAyres  Offline
I type Like navaho
Joined: Mar 2000
Posts: 25,587
Texas
for windows servers, isn't the file called my.ini?


- Allen wavey
- What Drives You?
Re: Let's tune MySQL! [Re: SurfMinister] #253446
07/13/2003 6:34 PM
07/13/2003 6:34 PM
Joined: Aug 2002
Posts: 1,271
Vienna, Austria
dimopoulos Offline
Kahuna
dimopoulos  Offline
Kahuna
Joined: Aug 2002
Posts: 1,271
Vienna, Austria
Yes and it usually gets created by the WinMySQLAdmin under your windows folder C:\WINNT or C:\WINDOWS


Nikos
Re: Let's tune MySQL! [Re: Hal_dup2] #253447
07/13/2003 6:40 PM
07/13/2003 6:40 PM
Joined: Mar 2000
Posts: 25,587
Texas
AllenAyres Offline
I type Like navaho
AllenAyres  Offline
I type Like navaho
Joined: Mar 2000
Posts: 25,587
Texas
danke I thought so, but spent a while searching for my.cnf anyways


- Allen wavey
- What Drives You?
Re: Let's tune MySQL! [Re: SurfMinister] #253448
07/13/2003 6:47 PM
07/13/2003 6:47 PM
Joined: Feb 2002
Posts: 1,969
Lansing, Michigan
M
msula Offline OP
Addict
msula  Offline OP
Addict
M
Joined: Feb 2002
Posts: 1,969
Lansing, Michigan
oops, sorry about that mixup. I get so confused in the windows world

Re: Let's tune MySQL! [Re: palmen] #253449
07/13/2003 6:48 PM
07/13/2003 6:48 PM
Joined: Aug 2002
Posts: 1,271
Vienna, Austria
dimopoulos Offline
Kahuna
dimopoulos  Offline
Kahuna
Joined: Aug 2002
Posts: 1,271
Vienna, Austria
LOL I had the same problem searching for the cnf files


Nikos
Re: Let's tune MySQL! [Re: Hal_dup2] #253450
07/13/2003 6:56 PM
07/13/2003 6:56 PM
Joined: Feb 2002
Posts: 1,969
Lansing, Michigan
M
msula Offline OP
Addict
msula  Offline OP
Addict
M
Joined: Feb 2002
Posts: 1,969
Lansing, Michigan
max edit time is up on my original post, so if someone could edit it so it specifies my.ini for windows, that would be good

Re: Let's tune MySQL! [Re: palmen] #253451
07/13/2003 9:40 PM
07/13/2003 9:40 PM
Joined: Mar 2000
Posts: 25,587
Texas
AllenAyres Offline
I type Like navaho
AllenAyres  Offline
I type Like navaho
Joined: Mar 2000
Posts: 25,587
Texas
got it for you As moderator for this forum, you should be able to indefinitely edit your posts... let's see if we can fix it


- Allen wavey
- What Drives You?
Re: Let's tune MySQL! [Re: SurfMinister] #253452
07/13/2003 9:49 PM
07/13/2003 9:49 PM
Joined: Feb 2002
Posts: 1,969
Lansing, Michigan
M
msula Offline OP
Addict
msula  Offline OP
Addict
M
Joined: Feb 2002
Posts: 1,969
Lansing, Michigan
But I'm not a moderator of the MySQL forum

Re: Let's tune MySQL! [Re: palmen] #253453
07/13/2003 11:05 PM
07/13/2003 11:05 PM
Joined: Mar 2000
Posts: 25,587
Texas
AllenAyres Offline
I type Like navaho
AllenAyres  Offline
I type Like navaho
Joined: Mar 2000
Posts: 25,587
Texas
? really? hmmm... gotta fix that


- Allen wavey
- What Drives You?
Re: Let's tune MySQL! [Re: palmen] #253454
07/14/2003 2:20 AM
07/14/2003 2:20 AM
Joined: Feb 2002
Posts: 2,575
England
Ian_W Offline
Veteran
Ian_W  Offline
Veteran
Joined: Feb 2002
Posts: 2,575
England
[]Jeremy said:
But I'm not a moderator of the MySQL forum [/]

You are now and thanks for the post.


Fans Focus - Focusing on Fans of Sport

(Okay - mainly football (the British variety wink at the moment - but expanding all the time....)
Re: Let's tune MySQL! [Re: Gorlum] #253455
07/14/2003 7:53 AM
07/14/2003 7:53 AM
Joined: Feb 2002
Posts: 1,969
Lansing, Michigan
M
msula Offline OP
Addict
msula  Offline OP
Addict
M
Joined: Feb 2002
Posts: 1,969
Lansing, Michigan
Thanks I can't hack threads code for crap, but at least I can be helpful in other areas

Re: Let's tune MySQL! [Re: palmen] #253456
07/14/2003 7:30 PM
07/14/2003 7:30 PM
Joined: Feb 2001
Posts: 144
Bakersfield, Ca.
S
ScottCargill Offline
Journeyman
ScottCargill  Offline
Journeyman
S
Joined: Feb 2001
Posts: 144
Bakersfield, Ca.
Dunno what else you're good for, but this thread was VERY helpful to me...

Thanks!

[]https://www.ubbdev.com/threads/php/uploads/panels/6747-13980.png[/]

Re: Let's tune MySQL! [Re: DRYCARPET1] #253457
07/15/2003 1:06 PM
07/15/2003 1:06 PM
Joined: Oct 2000
Posts: 2,518
navahoville! :D
N
navaho Offline
Veteran
navaho  Offline
Veteran
N
Joined: Oct 2000
Posts: 2,518
navahoville! :D
Chcuk, try /bin/top /bin/ps

or if they don't work try

bash2.04$ whereis top
bash2.04$ whereis ps
bash2.04$ whereis netstat

It looks to me as though your environment isn't setup well, no paths. We should probably make another thread soemwhere on customizing your environment.


Picture perfect penmanship here.
Re: Let's tune MySQL! [Re: zerind] #253458
08/12/2003 5:48 PM
08/12/2003 5:48 PM
Joined: Feb 2002
Posts: 2,575
England
Ian_W Offline
Veteran
Ian_W  Offline
Veteran
Joined: Feb 2002
Posts: 2,575
England
I notice from the large version it says in mine...

# Try number of CPU's*2 for thread_concurrency
set-variable = thread_concurrency=8

What would be the additional setting to benefit from dual CPU's?



Fans Focus - Focusing on Fans of Sport

(Okay - mainly football (the British variety wink at the moment - but expanding all the time....)
Re: Let's tune MySQL! [Re: Gorlum] #253459
08/12/2003 8:02 PM
08/12/2003 8:02 PM
Joined: Oct 2000
Posts: 2,518
navahoville! :D
N
navaho Offline
Veteran
navaho  Offline
Veteran
N
Joined: Oct 2000
Posts: 2,518
navahoville! :D
set-variable = threads_concurrency=4

dual CPU = 2 CPU, times 2 = 4.



Picture perfect penmanship here.
Re: Let's tune MySQL! [Re: zerind] #253460
08/13/2003 3:23 AM
08/13/2003 3:23 AM
Joined: Feb 2002
Posts: 2,575
England
Ian_W Offline
Veteran
Ian_W  Offline
Veteran
Joined: Feb 2002
Posts: 2,575
England
Thanks.

Going off to add

set-variable = threads_concurrency=4
dual CPU = 2 CPU, times 2 = 4.

to my cnf fle


Fans Focus - Focusing on Fans of Sport

(Okay - mainly football (the British variety wink at the moment - but expanding all the time....)
Re: Let's tune MySQL! [Re: Gorlum] #253461
08/13/2003 5:06 AM
08/13/2003 5:06 AM
Joined: Apr 2001
Posts: 3,440
abingdon,md
O
omegatron Offline
Member
omegatron  Offline
Member
O
Joined: Apr 2001
Posts: 3,440
abingdon,md
Actually Dave ps is the only one in the /bin directory the other two top and netstat are nowhere to be found. The command whereis is not found LOL

Re: Let's tune MySQL! [Re: Gorlum] #253462
08/13/2003 5:15 AM
08/13/2003 5:15 AM
Joined: Dec 2000
Posts: 1,545
Germany
A
Astaran Offline
Addict
Astaran  Offline
Addict
A
Joined: Dec 2000
Posts: 1,545
Germany
[]Ian_W said:
Thanks.

Going off to add

set-variable = threads_concurrency=4
dual CPU = 2 CPU, times 2 = 4.

to my cnf fle
[/]

I think you'll have more luck if you only add
Code
set-variable = threads_concurrency=4

Re: Let's tune MySQL! [Re: -Fusion-] #253463
08/13/2003 11:50 AM
08/13/2003 11:50 AM
Joined: Feb 2002
Posts: 2,575
England
Ian_W Offline
Veteran
Ian_W  Offline
Veteran
Joined: Feb 2002
Posts: 2,575
England
Doh!! Just re-read what he put LOL


Fans Focus - Focusing on Fans of Sport

(Okay - mainly football (the British variety wink at the moment - but expanding all the time....)
Re: Let's tune MySQL! [Re: Gorlum] #253464
08/13/2003 2:13 PM
08/13/2003 2:13 PM
Joined: Oct 2000
Posts: 2,518
navahoville! :D
N
navaho Offline
Veteran
navaho  Offline
Veteran
N
Joined: Oct 2000
Posts: 2,518
navahoville! :D
chcuk when I run whereis whereis on one of the machines I am handy to I get

[[email protected]:/root]# whereis whereis
whereis: /usr/bin/whereis /usr/share/man/man1/whereis.1.gz

perhaps /usr/bin is not in your path?

Look at your .bash_profile if you're running bash.


PATH=$PATH:$HOME/bin:/usr/local/bin

Add more to it as you feel necessary, colon delimited. log out, log in. magic. Now it will start finding things for you.


Picture perfect penmanship here.
Re: Let's tune MySQL! [Re: zerind] #253465
08/13/2003 2:44 PM
08/13/2003 2:44 PM
Joined: Apr 2001
Posts: 3,440
abingdon,md
O
omegatron Offline
Member
omegatron  Offline
Member
O
Joined: Apr 2001
Posts: 3,440
abingdon,md
How do you find your bash profile?

Re: Let's tune MySQL! [Re: sf49rminer] #253466
08/13/2003 4:37 PM
08/13/2003 4:37 PM
Joined: Oct 2000
Posts: 2,518
navahoville! :D
N
navaho Offline
Veteran
navaho  Offline
Veteran
N
Joined: Oct 2000
Posts: 2,518
navahoville! :D
When you are ssh'd in just type more .bash_profile to read it, to edit it use pico or vi.

the file will be in your home directory.


Picture perfect penmanship here.
Re: Let's tune MySQL! [Re: palmen] #253467
01/29/2004 1:23 AM
01/29/2004 1:23 AM
Joined: Sep 2000
Posts: 229
Asia
S
santana Offline
Member
santana  Offline
Member
S
Joined: Sep 2000
Posts: 229
Asia
Jeremy

I think my server needs your trick.

Here is my result:
Code
<br />Thu Jan 29 13:16:11 2004 13:16:18 up 1:33, 2 users, load average: 26.99, 27.69, 31.70 184 processes: 183 sleeping, 1 running, 0 zombie, 0 stopped CPU0 states: 89.2% user 10.0% system 0.0% nice 0.0% iowait 0.0% idle CPU1 states: 84.1% user 7.0% system 0.0% nice 0.0% iowait 8.1% idle Mem: 1030284k av, 540420k used, 489864k free, 0k shrd, 36708k buff 478752k actv, 2664k in_d, 3780k in_c Swap: 1020116k av, 6532k used, 1013584k free 225288k cached Http processes currently running = 122 Mysql processes currently running = 3 Netstat information summary 2 SYN_RECV 3 CLOSING 5 LAST_ACK 10 FIN_WAIT1 10 LISTEN 15 CLOSE_WAIT 81 ESTABLISHED 392 TIME_WAIT <br />


I am using Xeon HT 2.4Ghz on Intel Server board with 1GB ECC RAM and SCSI.

On average there are 100 users login at the same time. Does persistant connection help?

Re: Let's tune MySQL! [Re: often] #253468
01/29/2004 4:24 AM
01/29/2004 4:24 AM
Joined: Dec 2000
Posts: 1,545
Germany
A
Astaran Offline
Addict
Astaran  Offline
Addict
A
Joined: Dec 2000
Posts: 1,545
Germany
No, in most cases persistant connections are a bad idea.

Re: What Need to be Tuned? [Re: -Fusion-] #253469
02/19/2004 6:57 PM
02/19/2004 6:57 PM
Joined: Feb 2004
Posts: 4
T
Tony Offline
Lurker
Tony  Offline
Lurker
T
Joined: Feb 2004
Posts: 4
I have a P4 2.4 with 1GB RAM dedicated server 100Mbps net connection

It runs WHM 8.8.0 cPanel 8.8.0-R73 RedHat 9 - WHM X v2.1.2 apache (1.3.29 (Unix)) mysql (4.0.15-standard)

This machine is entirely use for just 1 domain with a vBulletin board. The site has about somewhere from 200+ to 800+ users online concurrent depends on time of the day.

When the number of users about 300- (less than 300) the server seem to react normally (Not Slow)

However, when the number of users increase at night (7mp - 5am PST) the server react extreamly slow (I mean really really slow) and it sometimes refuse to dislay page and not to load images as well.

1. Is this because of MySQL not tuned or Apache not Turned? How do I go about finding what need to fix?

2. I have include the 2 results (when site not busy & busy) of the script Germy provide, with the numbers shown, How I optimize MySQL to be the most efficient for my site?

3. With the hardware I have how many users I could have on the site just to browse the vBulletin board?

Thank you in advance for helping.

Result when site not busy:

Thu Feb 19 15:57:00 PST 2004

15:57:01 up 8:37, 1 user, load average: 0.53, 0.68, 0.72
99 processes: 89 sleeping, 1 running, 9 zombie, 0 stopped
Mem: 1032320k av, 994240k used, 38080k free, 0k shrd, 16036k buff
151248k active, 805548k inactive
Swap: 2104504k av, 936k used, 2103568k free 862944k cached

PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME CPU COMMAND
7416 nobody 19 0 1096 1096 752 R 1.9 0.1 0:00 0 top


Http processes currently running = 24
Mysql processes currently running = 3

Page 1 of 2 1 2

Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with, and recommend, the following Web Hosts:
· Stable Host
· Blue Host
· Interserver.net
Visit Us on Facebook
Member Spotlight
isaac
isaac
California
Posts: 1,170
Joined: July 2001
Show All Member Profiles 
Forum Statistics
Forums64
Topics37,448
Posts293,484
Members13,793
Most Online1,498
Mar 17th, 2017
Top Posters(All Time)
AllenAyres 25,587
JoshPet 11,330
Rick 8,373
LK 7,396
Lord Dexter 6,503
Gizmo 5,938
Greg Hard 5,533
Top Posters(30 Days)
isaac 4
Today's Statistics
Currently Online 686
Topics Created 0
Posts Made 0
Users Online 0
Birthdays 19
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2018 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 7.6.2
(Preview build 20180611.dev)
Page Time: 0.246s Queries: 17 (0.143s) Memory: 3.6065 MB (Peak: 4.0566 MB) Zlib enabled. Server Time: 2018-06-19 10:15:48 UTC