PDA

View Full Version : Should I add RAM onto my server?


tears
Sat 10th Feb '01, 11:44am
top:
11:27pm up 48 min, 1 user, load average: 15.72, 10.33, 6.59
180 processes: 154 sleeping, 26 running, 0 zombie, 0 stopped
CPU states: 2.1% user, 40.1% system, 34.1% nice, 23.4% idle
Mem: 127816K av, 125444K used, 2372K free, 93648K shrd, 2620K buff
Swap: 530136K av, 19680K used, 510456K free

11:31pm up 52 min, 1 user, load average: 28.89, 20.21, 11.64
238 processes: 215 sleeping, 23 running, 0 zombie, 0 stopped
CPU states: 0.9% user, 28.8% system, 17.3% nice, 52.8% idle
Mem: 127816K av, 125780K used, 2036K free, 85908K shrd, 2620K buff
Swap: 530136K av, 65512K used, 464624K free

11:33pm up 54 min, 1 user, load average: 22.85, 21.09, 12.87
286 processes: 285 sleeping, 1 running, 0 zombie, 0 stopped
CPU states: 6.8% user, 8.1% system, 2.7% nice, 82.2% idle
Mem: 127816K av, 126408K used, 1408K free, 40292K shrd, 2632K buff
Swap: 530136K av, 84620K used, 445516K free

11:33pm up 54 min, 1 user, load average: 22.27, 21.08, 13.04
305 processes: 304 sleeping, 1 running, 0 zombie, 0 stopped
CPU states: 8.7% user, 8.7% system, 4.6% nice, 77.7% idle
Mem: 127816K av, 125292K used, 2524K free, 61364K shrd, 2632K buff
Swap: 530136K av, 96964K used, 433172K free

11:33pm up 55 min, 1 user, load average: 35.56, 23.95, 14.18
307 processes: 306 sleeping, 1 running, 0 zombie, 0 stopped
CPU states: 2.9% user, 13.3% system, 1.0% nice, 82.6% idle
Mem: 127816K av, 125808K used, 2008K free, 59200K shrd, 2620K buff
Swap: 530136K av, 111764K used, 418372K free
--------------------
Variable_name Value
back_log 5
connect_timeout 5
basedir /usr/local/mysql/
datadir /usr/local/mysql/var/
delayed_insert_limit 100
delayed_insert_timeout 300
delayed_queue_size 1000
join_buffer 131072
flush_time 0
key_buffer 16773120
language /usr/local/mysql/share/mysql/english/
log ON
log_update OFF
long_query_time 10
low_priority_updates OFF
max_allowed_packet 1047552
max_connections 250
max_connect_errors 10
max_delayed_insert_threads 20
max_join_size 4294967295
max_sort_length 1024
max_write_lock_count 4294967295
net_buffer_length 16384
pid_file /usr/local/mysql/var/abbs.pid
port 3306
protocol_version 10
record_buffer 131072
skip_locking ON
skip_networking OFF
socket /tmp/mysql.sock
Variable_name Value
sort_buffer 2097144
table_cache 256
thread_stack 131072
tmp_table_size 1048576
tmpdir /tmp/
version 3.22.32-log
wait_timeout 28800
--------------------
Variable_name Value
Aborted_clients 0
Aborted_connects 0
Created_tmp_tables 134
Delayed_insert_threads 0
Delayed_writes 0
Delayed_errors 0
Flush_commands 1
Handler_delete 229
Handler_read_first 1
Handler_read_key 46055
Handler_read_next 66356
Handler_read_rnd 61423195
Handler_update 4190
Handler_write 4020
Key_blocks_used 501
Key_read_requests 100151
Key_reads 501
Key_write_requests 582
Key_writes 456
Max_used_connections 152
Not_flushed_key_blocks 0
Not_flushed_delayed_rows 0
Open_tables 255
Open_files 75
Open_streams 1
Opened_tables 290
Questions 103069
Running_threads 151
Slow_queries 786
Uptime 3446
--------------------

my.cnf
>>>>>
# This will be passed to all mysql clients
[client]
#password = my_password
port = 3306
socket = /tmp/mysql.sock

# Here is entries for some specific programs
# The following values assume you have at least 32M ram

# The MySQL server
[mysqld]
port = 3306
socket = /tmp/mysql.sock
skip-locking
set-variable = max_connections=250
set-variable = key_buffer=16M
set-variable = max_allowed_packet=1M
set-variable = thread_stack=128K
set-variable = table_cache=256
# Start logging
log

[mysqldump]
quick
set-variable = max_allowed_packet=16M

[mysql]
no-auto-rehash

[isamchk]
set-variable = key_buffer=16M
--------------------

Is there something wrong in my.cnf file,or I sould add memory to the server?
And I have something to do in my.cnf?

Martin
Sat 10th Feb '01, 12:55pm
128 mb? how many users you have on average?

I would definitely add more RAM if you can. What kind of processor(s) you running?

tears
Sat 10th Feb '01, 11:36pm
80-150 users on my forum on average.
Dual Piii-550 CPU.
Can I do anything besides add more RAM?
my.cnf?

Karl
Sun 11th Feb '01, 6:06pm
You need lots of ram to go with 80-150 concurant users. Dual CPU with 128mb is such a waste, I would suggest 512mb if you can afford it.

tears
Mon 12th Feb '01, 6:54am
Can Normal SDRAM work with ECC RAM?

PeF
Mon 12th Feb '01, 8:18am
I highly recommend not to combine RAM types.

Mitrofan
Sat 17th Feb '01, 1:15pm
The first thing in improving mySQL performance is MORE RAM:

The second - add the second Hard drive and move the mySQL database to it.

Many people making a mistake by wasting money on adding second CPU, which is hard to do and you usually have to change the server or at least a motherboard.

Moving the database data files to a separate HD will do alot more good than a second CPU. A busy webserver constanly logging web access and errors. There could be 30 or more log entires per each page access. Each gif, css, js, or any other file requested from the server is logged as a hit. This means that the Hard drive constantly being written on.

The same is with mySQL log files.

This means that when mySQL need to read or write data, it must wait for a hard disk to finish what it was doing first.

Moving just a VBulletin database to a separate hard drive will make the data access a lot faster. It's easy to add another HD, and it's easy to move the data. On linux systems just use the mv command to move the entire folder and subfolders and then create a symling to point to the new location of the files. Make sure that the new folder has full access permissions for the user that mySQL runs under. Just doing that will speed up your Vbuletin over 100%

If you can't add another HD, what you can do to impove performance is to disable logging in Apache. That's right, just don't log web access at all. This will free up alot of disk time and you will see a big improvement. You will not be able to vew any web statistics, but if you use any kind of banner rotation software you can use its stats to get your page views numbers. You cannot disable the error log in Apache, so you will still get the errors data. If you just can't afford to disable web logging, at least disable HTTP_REFERER logging and make sure you don't use DNS lookup when loogins web access.

If you using banner rotation software you can usually disable IP logging in it. THis will also free up available disk time.

To manage RAM usage, disable Apache modules that you don't need. If you don't use mod_speling and mod_perl, just take it out and recompile Apache. Mod_perl is a big module and if you using PHP, you don't really need to use mod_perl because PHP scripts are faster then perl scrips even under mod_perl. Get rid of your CGI scripts and replace them with PHP scripts.

Edit the MaxClient to set it to lower number (100 is reasanable). When the server reaches this number, the new clients will see "server unavailable" error, but the connected clients will have better response.

Sharg
Tue 20th Feb '01, 12:05pm
If you can't add another HD, what you can do to impove performance is to disable logging in Apache.

I think this is a very wise and interesting idea... All I need is the error log from apache so as you said it always on :)

How to disable the web log ? Should I simply uncomment the log line from the apache file ? How ?

Thanks,

Mitrofan
Tue 20th Feb '01, 1:59pm
Yes, just comment our the log directive from http.cong
Or just remove it

Restart apache.

Sharg
Tue 20th Feb '01, 2:04pm
Should I comment


LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %T %v" full
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %b" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent


or


CustomLog /var/log/apache/access2.log combined


or both ?

Thanks,

Mitrofan
Tue 20th Feb '01, 2:11pm
The first block of directives is just a log format, not the actual log directive

The second one looks like the actual log directive, just remove it and you should be fine. Delete you access log from the server and restart Apache. If you see the new log created after the restart, then you have not disabled logging. If you don't see the new access log created after the restart, then you have successfully disabled logging.

Don't mess with error log directive or Apache will not start again.

Kier
Thu 22nd Feb '01, 7:30am
One thing that I've done is to disable logging for all gif, jpeg, png, swf, js and css files under Apache. Now apache only logs page hits for .htm, .html and .php files... this sped it up a lot, as my pages tend to be very image-rich.

Dragon
Mon 5th Mar '01, 4:21am
Could you tell us how you did that? Thanks in advance.

Kier
Wed 7th Mar '01, 12:12pm
Here is the code I used in httpd.conf to achieve this:
### define the 'common' logging format
LogFormat "%h %l %u %t \"%r\" %>s %b" common

### check to see if request is for an image or otherwise non-logging item
SetEnvIf Request_URI \.gif$ nolog
SetEnvIf Request_URI \.jpg$ nolog
SetEnvIf Request_URI \.swf$ nolog
SetEnvIf Request_URI \.png$ nolog
SetEnvIf Request_URI \.htc$ nolog
SetEnvIf Request_URI \.js$ nolog

### write log in 'common' format if not image
CustomLog /usr/local/apache/logs/3df_access_log common env=!nolog Hope this helps :)

Swamper
Wed 7th Mar '01, 12:56pm
Yup.. thanks kier.. I got that info from

http://httpd.apache.org/docs/env.html

Mitrofan
Wed 7th Mar '01, 5:02pm
This will add a lot of processing to the server. Every hit must be analyzed to see if it's for gif, jpeg, etc.

While it will cut down on the disc usage, it's not worth it becase of extra CPU utilisation for every hit. Remember that every page may have 10-100 graphics in it.

Limey
Sat 24th Mar '01, 1:36pm
a 15+ load average is insane!

people try to keep theirs kless than 3.

Add more ram and you should be fine. Dual CPU is a waste, but I really like the suggestion of the second HD for the database and vbulletin. Some people make an entire box into a database server, which would definitely be overkill here.

eva2000
Sat 24th Mar '01, 1:42pm
Originally posted by Limey
a 15+ load average is insane!

people try to keep theirs kless than 3.

Add more ram and you should be fine. Dual CPU is a waste, but I really like the suggestion of the second HD for the database and vbulletin. Some people make an entire box into a database server, which would definitely be overkill here. well dual cpus are kinda nice i think - > http://vbulletin.com/forum/showthread.php?s=&threadid=11903