Tenho um problemao pra resolver,
tenho um servidor dedicado MySQL na fundação onde trabalho,
só que ele tá com muito SWAP conforme relatórios abaixo.
Alguem poderia me dizer o que eu poderia fazer pra melhorar a
performance desse servidor.
Mémoria para ele tá muito cara e dificil de encontrar. Alem disso o
servidor aceita apenas
2GB de RAM, ele já tem 1GB.

Tem todas as informações abaixo, configuração do servidor, versão do
MySQL, comando TOP e DF,
e o arquivo MY.CNF.

Agradeço qualquer ajuda, pois estou desesperado...hehe

Abraços a todos.
Márcio Erli

-----------------------------------------------top-----------------------------------------
top - 08:42:02 up 1 day, 14:20,  1 user,  load average: 0.30, 0.34, 0.29
Tasks:  66 total,   1 running,  65 sleeping,   0 stopped,   0 zombie
Cpu(s): 29.0% us, 12.0% sy,  0.0% ni, 28.6% id, 28.8% wa,  0.3% hi,  1.3% si
Mem:   1032388k total,  1008636k used,    23752k free,    23800k buffers
Swap:  1317288k total,   341696k used,   975592k free,   308188k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
17576 mysql     18   0  478m 436m 5248 D 57.3 43.3   0:07.04 mysqld
17571 mysql     16   0  478m 436m 5248 S 17.5 43.3   0:06.34 mysqld
17558 mysql     15   0  478m 436m 5248 S  7.1 43.3   0:07.15 mysqld
  968 snort     15   0 31720 1704 2316 S  1.9  0.2   6:03.29 snort
   28 root      15   0     0    0    0 D  1.0  0.0   0:51.01 kjournald
17583 root      16   0  2172 1032 1964 R  0.6  0.1   0:00.02 top
17580 mysql     16   0  478m 436m 5248 S  0.3 43.3   0:00.06 mysqld
    1 root      16   0  1580   80 1424 S  0.0  0.0   0:02.05 init
    2 root      RT   0     0    0    0 S  0.0  0.0   0:00.00 migration/0
    3 root      34  19     0    0    0 S  0.0  0.0   0:00.00 ksoftirqd/0
    4 root      RT   0     0    0    0 S  0.0  0.0   0:00.00 migration/1
    5 root      34  19     0    0    0 S  0.0  0.0   0:00.00 ksoftirqd/1
    6 root       5 -10     0    0    0 S  0.0  0.0   0:00.00 events/0
    7 root       6 -10     0    0    0 S  0.0  0.0   0:00.00 events/1
    8 root       5 -10     0    0    0 S  0.0  0.0   0:03.41 kblockd/0
    9 root       5 -10     0    0    0 S  0.0  0.0   0:04.05 kblockd/1
   10 root      15   0     0    0    0 S  0.0  0.0   0:00.00 kirqd
   13 root      15   0     0    0    0 S  0.0  0.0   0:17.09 kswapd0
   14 root      10 -10     0    0    0 S  0.0  0.0   0:00.00 aio/0
   15 root       5 -10     0    0    0 S  0.0  0.0   0:00.00 aio/1
   17 root      25   0     0    0    0 S  0.0  0.0   0:00.13 kseriod
   21 root      25   0     0    0    0 S  0.0  0.0   0:00.00 scsi_eh_0
   22 root      15   0     0    0    0 S  0.0  0.0   0:00.00 ahc_dv_0
   23 root      18   0     0    0    0 S  0.0  0.0   0:00.00 scsi_eh_1
   24 root      15   0     0    0    0 S  0.0  0.0   0:00.00 ahc_dv_1
  134 root      20   0  2036  356 1588 S  0.0  0.0   0:00.24 devfsd
  223 root      15   0     0    0    0 S  0.0  0.0   0:00.00 khubd
  365 root      15   0     0    0    0 S  0.0  0.0   0:04.92 kjournald
  366 root      15   0     0    0    0 S  0.0  0.0   0:00.00 kjournald
  932 root      16   0  1640  236 1468 S  0.0  0.0   0:00.06 syslogd
  940 root      16   0  2512   40 1416 S  0.0  0.0   0:00.12 klogd
  954 daemon    16   0  1616  104 1456 S  0.0  0.0   0:00.00 atd
 1002 root      17   0  3152  216 2940 S  0.0  0.0   0:00.53 sshd
 1023 root      16   0  2164   44 1828 S  0.0  0.0   0:00.00 xinetd
 1091 nobody    16   0  4500  216 3788 S  0.0  0.0   0:00.03 proftpd
 1106 root      16   0  1624  148 1460 S  0.0  0.0   0:00.01 crond
 1122 root      19   0  2228   40 2096 S  0.0  0.0   0:00.01 mysqld_safe
 1174 mysql     16   0  478m 436m 5248 S  0.0 43.3   0:00.79 mysqld
 1194 root      17   0  1568   36 1408 S  0.0  0.0   0:00.00 mingetty
 1195 root      17   0  1568   36 1408 S  0.0  0.0   0:00.00 mingetty
 1198 root      16   0  1568   36 1408 S  0.0  0.0   0:00.00 mingetty
 1199 root      16   0  1568   36 1408 S  0.0  0.0   0:00.00 mingetty
 1200 root      16   0  1568   36 1408 S  0.0  0.0   0:00.00 mingetty
 1201 root      19   0  1568   36 1408 S  0.0  0.0   0:00.00 mingetty
 1202 mysql     16   0  478m 436m 5248 S  0.0 43.3   0:00.29 mysqld
 1203 mysql     16   0  478m 436m 5248 S  0.0 43.3   0:00.01 mysqld
 1204 mysql     16   0  478m 436m 5248 S  0.0 43.3   0:00.59 mysqld
 1205 mysql     16   0  478m 436m 5248 S  0.0 43.3   2:14.95 mysqld
 1206 mysql     16   0  478m 436m 5248 S  0.0 43.3   0:06.11 mysqld
 1229 mysql     16   0  478m 436m 5248 S  0.0 43.3   0:00.73 mysqld
 1230 mysql     16   0  478m 436m 5248 S  0.0 43.3   0:03.10 mysqld
 1231 mysql     16   0  478m 436m 5248 D  0.0 43.3   0:15.33 mysqld
 1232 mysql     16   0  478m 436m 5248 S  0.0 43.3   0:00.78 mysqld

------------------------------------------------my.cnf---------------------------------------------------

[EMAIL PROTECTED] root]# cat /etc/my.cnf
# Example MySQL config file for medium systems.
#
# This is for a system with little memory (32M - 64M) where MySQL plays
# an important part, or systems up to 128M where MySQL is used together with
# other programs (such as a web server)
#
# You can copy this file to
# /etc/my.cnf to set global options,
# mysql-data-dir/my.cnf to set server-specific options (in this
# installation this directory is /var/lib/mysql) or
# ~/.my.cnf to set user-specific options.
#
# In this file, you can use all long options that a program supports.
# If you want to know which options a program supports, run the program
# with the "--help" option.

# The following options will be passed to all MySQL clients
[client]
#password       = your_password
port            = 3306
socket          = /var/lib/mysql/mysql.sock

# Here follows entries for some specific programs

# The MySQL server
[mysqld]
port            = 3306
socket          = /var/lib/mysql/mysql.sock
datadir = /var/lib/mysql
skip-locking
#key_buffer = 16M
key_buffer = 2M
max_allowed_packet = 1M
#table_cache = 64
table_cache = 128
#sort_buffer_size = 512K
sort_buffer_size = 2M
net_buffer_length = 8K
read_buffer_size = 256K
read_rnd_buffer_size = 512K
#myisam_sort_buffer_size = 8M
myisam_sort_buffer_size = 100K
#datadir = /var/lib/mysql
socket = /var/lib/mysql/mysql.sock
language=/usr/share/mysql/portuguese/

# Adicionado em 25/05/2006 devido a excesso de conexoes
max_connections = 1000
max_connect_errors = 1000
wait_timeout = 300

# MySQL Brasil - BH
# log=/var/lib/mysql/mysqld.log
log-slow-queries
log-long-format
long-query-time=5

# Don't listen on a TCP/IP port at all. This can be a security enhancement,
# if all processes that need to connect to mysqld run on the same host.
# All interaction with mysqld must be made via Unix sockets or named pipes.
# Note that using this option without enabling named pipes on Windows
# (via the "enable-named-pipe" option) will render mysqld useless!
#
#skip-networking

# Replication Master Server (default)
# binary logging is required for replication
log-bin

# required unique id between 1 and 2^32 - 1
# defaults to 1 if master-host is not set
# but will not function as a master if omitted
server-id       = 1

# Replication Slave (comment out master section to use this)
#
# To configure this host as a replication slave, you can choose between
# two methods :
#
# 1) Use the CHANGE MASTER TO command (fully described in our manual) -
#    the syntax is:
#
#    CHANGE MASTER TO MASTER_HOST=<host>, MASTER_PORT=<port>,
#    MASTER_USER=<user>, MASTER_PASSWORD=<password> ;
#
#    where you replace <host>, <user>, <password> by quoted strings and
#    <port> by the master's port number (3306 by default).
#
#    Example:
#
#    CHANGE MASTER TO MASTER_HOST='125.564.12.1', MASTER_PORT=3306,
#    MASTER_USER='joe', MASTER_PASSWORD='secret';
#
# OR
#
# 2) Set the variables below. However, in case you choose this method, then
#    start replication for the first time (even unsuccessfully, for example
#    if you mistyped the password in master-password and the slave fails to
#    connect), the slave will create a master.info file, and any later
#    change in this file to the variables' values below will be ignored and
#    overridden by the content of the master.info file, unless you shutdown
#    the slave server, delete master.info and restart the slaver server.
#    For that reason, you may want to leave the lines below untouched
#    (commented) and instead use CHANGE MASTER TO (see above)
#
# required unique id between 2 and 2^32 - 1
# (and different from the master)
# defaults to 2 if master-host is set
# but will not function as a slave if omitted
#server-id       = 2
#
# The replication master for this slave - required
#master-host     =   <hostname>
#
# The username the slave will use for authentication when connecting
# to the master - required
#master-user     =   <username>
#
# The password the slave will authenticate with when connecting to
# the master - required
#master-password =   <password>
#
# The port the master is listening on.
# optional - defaults to 3306
#master-port     =  <port>
#
# binary logging - not required for slaves, but recommended
#log-bin

# Point the following paths to different dedicated disks
#tmpdir         = /tmp/
tmpdir          = /tmp/
#log-update     = /path-to-dedicated-directory/hostname

# Uncomment the following if you are using BDB tables
#bdb_cache_size = 4M
#bdb_max_lock = 10000

# Uncomment the following if you are using InnoDB tables
#innodb_data_home_dir = /var/lib/mysql/
innodb_data_file_path = ibdata1:100M;ibdata2:100M:autoextend
#innodb_log_group_home_dir = /var/lib/mysql/
#innodb_log_arch_dir = /var/lib/mysql/
# You can set .._buffer_pool_size up to 50 - 80 %
# of RAM but beware of setting memory usage too high
#innodb_buffer_pool_size = 16M
innodb_buffer_pool_size = 400M
#innodb_additional_mem_pool_size = 2M
innodb_additional_mem_pool_size = 20M
# Set .._log_file_size to 25 % of buffer pool size
#innodb_log_file_size = 5M
innodb_log_file_size = 10M
#innodb_log_buffer_size = 8M
innodb_log_buffer_size = 8M
#innodb_flush_log_at_trx_commit = 1
#innodb_lock_wait_timeout = 50

[mysqldump]
quick
max_allowed_packet = 16M

[mysql]
no-auto-rehash
# Remove the next comment character if you are not familiar with SQL
#safe-updates

[isamchk]
key_buffer = 20M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M

[myisamchk]
key_buffer = 20M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M

[mysqlhotcopy]
interactive-timeout

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


---------------------------------------------------------------------------
Esta lista é patrocinada pela Conectiva S.A. Visite http://www.conectiva.com.br

Arquivo: http://bazar2.conectiva.com.br/mailman/listinfo/linux-br
Regras de utilização da lista: http://linux-br.conectiva.com.br
FAQ: http://www.zago.eti.br/menu.html

Responder a