C
coleccionocromo
Delta
¡Usuario con pocos negocios! ¡Utiliza siempre saldo de Forobeta!
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
skip-locking
skip-innodb
query_cache_limit=1M
query_cache_size=16M
query_cache_type=1
max_connections=500
interactive_timeout=10
wait_timeout=15
connect_timeout=10
thread_cache_size=128
key_buffer=32M
join_buffer=1M
max_allowed_packet=16M
table_cache=1024
record_buffer=1M
sort_buffer_size=1M
read_buffer_size=2M
max_connect_errors=10
# Try number of CPU's*2 for thread_concurrency
thread_concurrency=2
myisam_sort_buffer_size=16M
log-bin
server-id=1
[mysql.server]
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=32M
[mysql]
no-auto-rehash
#safe-updates
[isamchk]
key_buffer=32M
sort_buffer=32M
read_buffer=8M
write_buffer=8M
[myisamchk]
key_buffer=32M
sort_buffer=32M
read_buffer=8M
write_buffer=8M
[mysqlhotcopy]
interactive-timeout
Prueba esta config:
puedes usar este script para saber que parámetros optimizar:Insertar CODE, HTML o PHP:[mysqld] datadir=/var/lib/mysql socket=/var/lib/mysql/mysql.sock skip-locking skip-innodb query_cache_limit=1M query_cache_size=16M query_cache_type=1 max_connections=500 interactive_timeout=10 wait_timeout=15 connect_timeout=10 thread_cache_size=128 key_buffer=32M join_buffer=1M max_allowed_packet=16M table_cache=1024 record_buffer=1M sort_buffer_size=1M read_buffer_size=2M max_connect_errors=10 # Try number of CPU's*2 for thread_concurrency thread_concurrency=2 myisam_sort_buffer_size=16M log-bin server-id=1 [mysql.server] 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=32M [mysql] no-auto-rehash #safe-updates [isamchk] key_buffer=32M sort_buffer=32M read_buffer=8M write_buffer=8M [myisamchk] key_buffer=32M sort_buffer=32M read_buffer=8M write_buffer=8M [mysqlhotcopy] interactive-timeout
Enlace eliminado
si no sabes como hacerlo dímelo, saludos!
KeepAlive= On
MaxKeepAliveRequests= 150
KeepAliveTimeout= 15
<IfModule prefork.c>
StartServers 8
MinSpareServers 5
MaxSpareServers 20
MaxClients 150
MaxRequestsPerChild 100
</IfModule>
[mysqld]
user=mysql
socket=/var/lib/mysql/mysql.sock
datadir=/var/lib/mysql
skip-locking
skip-innodb
max_connections = 500
key_buffer = 16M
myisam_sort_buffer_size = 64M
join_buffer_size = 1M
read_buffer_size = 1M
sort_buffer_size = 2M
table_cache = 1800
thread_cache_size = 128
wait_timeout = 900
connect_timeout = 10
tmp_table_size = 64M
max_allowed_packet = 16M
max_connect_errors = 10
read_rnd_buffer_size = 524288
bulk_insert_buffer_size = 8M
thread_concurrency = 2
query_cache_limit = 1M
query_cache_size = 96M
query_cache_type = 1
query_prealloc_size = 16384
query_alloc_block_size = 16384
[mysql.server]
user=mysql
basedir=/var/lib
[mysqld_safe]
err-log=/var/log/mysqld.log
open_files_limit = 8192
[mysqldump]
quick
max_allowed_packet = 16M
[myisamchk]
key_buffer = 64M
sort_buffer = 64M
read_buffer = 16M
write_buffer = 16M
[INDENT][xcache-common]
zend_extension = /usr/lib/php4/xcache.so
; required for >=php5.1 if you turn XCache on
auto_globals_jit = Off
[xcache.admin]
xcache.admin.user = "admin"
; paste the output of md5("password") below
xcache.admin.pass = ""
[xcache]
xcache.size = 32M
xcache.count = 1
xcache.slots = 8K
xcache.mmap_path = "/dev/zero"
xcache.cacher = On
[/INDENT]
Instalando XCACHE
XCache se autodescribe como un cacheador de opcode PHP que es rápido, estable, muy probado y que se usa en servidores en producción con muchas visitas. El aumento del rendimiento se nota: sólo tenemos que pensar que en lugar de interpretarse los scripts PHP cada vez y ejecutar el código, directamente se ejecuta el código ya interpretado que está en caché.
Aunque personalmente vengo utilizando ‘PHP opcode cachers’ como EAccelerator y Turck MMCACHE desde hace tiempo, este XCache ha funcionado bien y ha resultado dar menos problemas con los cambios de versión de PHP.
# yum install php-develAsegurarse que el archivo generado “xcache.so” está en el directorio de módulos de php necesario (puede ser /usr/lib/php/modules o bien otro)
# wget http://xcache.lighttpd.net/pub/Releases/1.2.2/xcache-1.2.2.tar.gz
# tar -zxf xcache-*.tar.gz
# cd xcache-*
# phpize
# ./configure –enable-xcache
# make
# make install
Añadir la siguiente configuración al php.ini (si lo metemos como archivo INI en /etc/php.d/ no podremos controlar el orden de cargado y no funcionará)
Nota: Primero debe ir la config. de Suhosin, luego XCACHE y finalmente el bloque del Zend Optimizer.
[xcache-common]
zend_extension = /usr/lib/php/modules/xcache.so
[xcache.admin]
xcache.admin.user = “admin”
xcache.admin.pass = “md5password”
[xcache]
xcache.shm_scheme = “mmap”
xcache.size = 64M
xcache.count = 1
xcache.slots = 8K
xcache.ttl = 0
xcache.gc_interval = 0
xcache.var_size = 0M
xcache.var_count = 1
xcache.var_slots = 8K
xcache.var_ttl = 0
xcache.var_maxttl = 0
xcache.var_gc_interval = 3000
xcache.test = Off
xcache.readonly_protection = Off
xcache.mmap_path = “/dev/zero”
xcache.coredump_directory = “/tmp/xcache”
xcache.cacher = On
xcache.stat = On
xcache.optimizer = Off
[xcache.coverager]
xcache.coverager = Off
xcache.coveragedump_directory = “”
[root@localhost ~/xcache-1.2.2] # /etc/init.d/httpd restart
Stopping httpd: [FAILED]
Starting httpd: httpd: bad group name apache
[FAILED]
Actualiza a PHP 5.2.9 o 5.2.10 no CGI sinío a través de APXS2 (módulo de apache)
'./configure' '--enable-bcmath' '--enable-calendar'
'--enable-ftp' '--enable-gd-native-ttf' '--enable-libxml'
'--enable-magic-quotes' '--enable-mbstring' '--enable-pdo=shared'
'--enable-sockets' '--enable-zip' '--prefix=/usr' '--with-curl=/opt/curl/'
'--with-freetype-dir=/usr' '--with-gd' '--with-imap=/opt/php_with_imap_client/'
'--with-imap-ssl=/usr' '--with-jpeg-dir=/usr'
'--with-kerberos' '--with-libxml-dir=/opt/xml2/' '--with-mysql=/usr'
'--with-mysql-sock=/var/lib/mysql/mysql.sock' '--with-openssl=/usr'
'--with-openssl-dir=/usr' '--with-pdo-mysql=shared'
'--with-pdo-sqlite=shared' '--with-png-dir=/usr'
'--with-sqlite=shared' '--with-ttf' '--with-xpm-dir=/usr' '--with-zlib'
'--with-zlib-dir=/usr'
Muy pequeña la imagen para poder apreciarla...
saludos
15 de load es brutal, eso indica que tu servidor está a punto de reventar, un load normal es de 1.5 uno de >3 se asume como alto, cualquier cosa por encima de >10 se asume como problema. Utiliza la configuración que te di, es lo más optimizado con los pocos recursos que tienes. Y sigue todos los pasos que te puse.
Por cierto tu problema no está en MySQL aunque tienes que usar la config que te di para ahorrar recursos sinó en apache aparte creo que por como están los childnodes en el top, es la versión 2.0.x
// ****** DATASTORE CACHE CONFIGURATION *****
// Here you can configure different methods for caching datastore items.
// vB_Datastore_Filecache - to use includes/datastore/datastore_cache.php
// vB_Datastore_APC - to use APC
// vB_Datastore_XCache - to use XCache
// vB_Datastore_Memcached - to use a Memcache server, more configuration below
// $config['Datastore']['class'] = 'vB_Datastore_Filecache';
// ******** DATASTORE PREFIX ******
// If you are using a PHP Caching system (APC, XCache, eAccelerator) with more
// than one set of forums installed on your host, you *may* need to use a prefix
// so that they do not try to use the same variable within the cache.
// This works in a similar manner to the database table prefix.
// $config['Datastore']['prefix'] = '';
No hay más que configurar, al menos yo no dí con más configuración en el panel de admin.
a esas variables debes ponerle los datos correctos tambien, para Xcache, tienes que poner entre comillas vB_Datastore_XCache en la primer variable, y en la segunda debes poner un prefijo. Si lo has hehco, entonces todo debería estar bien.
Utilizamos cookies y tecnologías similares para los siguientes fines:
¿Aceptas las cookies y estas tecnologías?
Utilizamos cookies y tecnologías similares para los siguientes fines:
¿Aceptas las cookies y estas tecnologías?