Configuracion mysql en dedicado

Beor Seguir

Beta
¡Usuario con pocos negocios! ¡Utiliza siempre saldo de Forobeta!
Desde
2 Mar 2006
Mensajes
77
Por favor, ten en cuenta 📝 que si deseas hacer un trato 🤝 con este usuario, está baneado 🔒.
Hola compañeros

Desde que instale vb4 vengo experimentando problemillas en mi servidor, cada x dias se colgaba y tenia que reiniciar, haciendo esto funcionaba perfectamente hasta que otra vez le daba.

El domingo pasado no se que paso que la cpu no bajaba del 100% y el acceso era lentisimo, hasta que no re-configure el my.cnf por consejo de un amigo no se bajo de ahi, tengo la ram en un 20-25% ahora mismo y la cpu siempre currando bastante pero va bien, lo malo es que de vez en cuando debe pillar algo de swap, pq cada vez que miro esta ocupado un poco mas.

Asi que me gustaria me ayudaran a encontrar la mejor configuracion para mi dedicado, esta es la maquina:

Insertar CODE, HTML o PHP:
[B]Hardware[/B]

                         Procesador                     Intel Core2Duo
2x 2.33+ GHz                          
3 MB                                                               L2 -                                                                     FSB 1066 MHz                                       Arquitectura64 bits                               Memoria RAM                      2 GB DDR2                         Disco duro                     2x 500 GB - SATA2                         RAID                      0/1NICFastEthernet
Espero sus recomendaciones.

Saludos
 

Beor

Beta
¡Usuario con pocos negocios! ¡Utiliza siempre saldo de Forobeta!
Desde
2 Mar 2006
Mensajes
77
Por favor, ten en cuenta 📝 que si deseas hacer un trato 🤝 con este usuario, está baneado 🔒.
Con esta configuracion y unos 100 miembros y 200-300 visitantes en los ultimos 15 minutos se me pone la cpu al 100% y la memoria al 22-25%

Insertar CODE, HTML o PHP:
[mysqld]
set-variable=local-infile=0
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
# Default to using old password format for compatibility with mysql 3.x
# clients (those using the mysqlclient10 compatibility package).
old_passwords=1
log_slow_queries=/var/log/mysqld.slow.log
key_buffer_size=512M
max_connections=500
max_connect_errors=25
connect_timeout=10
interactive_timeout=20
wait_timeout=10
delayed_insert_timeout=10
join_buffer_size=2M
key_buffer=128M
max_allowed_packet=32M
sort_buffer_size=2M
myisam_sort_buffer_size=1M
read_buffer_size=1M
read_rnd_buffer_size=2M
table_cache=1024
thread_cache_size=192
query_cache_size=1024M
query_cache_limit=64M
query_cache_type=1
tmp_table_size=256M
max_tmp_tables=10
long_query_time=1

[mysql.server]
user=mysql
basedir=/var/lib

[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid

Recomendaciones?

Saludos
 

Beor

Beta
¡Usuario con pocos negocios! ¡Utiliza siempre saldo de Forobeta!
Desde
2 Mar 2006
Mensajes
77
Por favor, ten en cuenta 📝 que si deseas hacer un trato 🤝 con este usuario, está baneado 🔒.
Respuesta de vbulletin despues de pasarles todos los datos que solicitaban:

Are you actually using innodb tables ? i.e. /var/lib/mysql are files with *.myd and *.myi extensions ? If you converted your tables to innodb using command ALTER TABLE tablename ENGINE=InnoDB; then you're using innodb for some tables possibly up to 1GB in index+data size, i'd at least at another 1GB memory minimum to your server. If not using inndob then below my.cnf might be best suited to you as below my.cnf assumes you converted to innodb tables.

Then try the following in this exact order. You can ignore any of the suggestions that you have already done.

1. Upgrade MySQL 5.1.44 or 5.1.45 if possible and then upgrade PHP to 5.2.11 or 5.2.12 (in either case install as apache module and NOT CGI. For windows based PHP try FastCGI method or ISAPI method). If you're upgrading from MySQL 4.x, you must upgrade to MySQL 5.0.xx before moving to MySQL 5.1.x series.

Backup your databases prior to mysql upgrades where possible using mysqldump via ssh telnet and not via admincp backup options or phpmyadmin which in some cases of large databases can result in incomplete backups!

2. Edit mysql server's /etc/my.cnf or c:\my.ini for windows and place the following mysql server settings in /etc/my.cnf and restart mysql server afterwards. Make sure to restart mysql server everytime you make changes to your my.cnf for the changes to take effect.

If mysql doesn't restart properly after my.cnf changes and you're on VPS server, make sure skip-innodb entry is removed or commented out from below my.cnf

If using Innodb tables, best to use innodb_file_per_table option in my.cnf. To enable set innodb_file_per_table = 1 to enable or 0 to disable (default). Read more about this option here MySQL :: MySQL 5.0 Reference Manual :: 13.2.2.1 Using Per-Table Tablespaces and MySQL :: MySQL 5.0 Reference Manual :: 13.2.2 InnoDB Configuration and optional use of raw partitions for InnoDB data files MySQL :: MySQL 5.0 Reference Manual :: 13.2.2.2 Using Raw Devices for the Shared Tablespace.

So 4 steps to utilise this function:

BACKUP all your mysql databases BEFORE you do this

1. add or enable innodb_file_per_table option in my.cnf and create a new directory with mkdir command for appropriate path for innodb files pertaining to below setting for innodb_data_home_dir i.e. innodb_data_home_dir = /var/lib/mysql/idatadir. A separate disk or raid array from main /var mysql data partition would be beneficial if possible.
2. restart mysql server
3. do an ALTER TABLE tablename ENGINE = InnoDB; on each database tablename you want to recreate a separate *.idb file for OR alternatively
4. if existing database tablename is InnoDB table already, use command:

mysqlcheck --optimize databasename tablename

do this for each tablename of your database you want split to separate *.idb files for.

or for entire databases

mysqlcheck --optimize databasename

In relation to vB 3.8.x read vBulletin Community Forum

Might need to adjust innodb_buffer_pool_size = 128M depending on the total cummulative size of innodb tables data + indexes see MySQL :: MySQL 3.23, 4.0, 4.1 Reference Manual :: 13.2.4 InnoDB Startup Options and System Variables



If you get mysql server gone away error messages, then keep increasing wait_timeout value in my.cnf by 60 second increments, then restart mysql after my.cnf changes for it to take effect. Test for a few days and see if you get less or eliminate that error message. If it still occurs, then keep repeating the 60 second increment until the message goes away. Each vB forum and server will have different optimal wait_timeout values depending on your vB forum traffic patterns and server hardware specifications.

3. Remove Eaccelerator or APC Cache if they're installed (check phpinfo.php url of yours to see) and instead install Xcache v1.2.2 Release-1.2.2 which seems to be a bit faster than APC Cache - vBulletin Community Forum. Xcache site XCache, install guide InstallFromSource and forums lighttpd forum - XCache

Remember to set in php.ini the values for xcache.size to 128M and for xcache.count to 4. Set xcache.var.size to 3M per vB forum installed and set xcache.var.count to 1 or 2 so you'd have 3M divide by 1 or 2.

Install the xcache admin end and monitor how much memory is used and available and adjust accordingly. The size specified will be divided into the value of counts set (number of cpu cores). So for count of 4, 64MB will be split to 16MB per cpu core and xcache.count_size of 12MB will be split to 3MB per cpu core.

Now enable xcache datastore caching for each vB forum (vB 3.7.x and higher only supported). In vB config.php file these entries

Insertar CODE, HTML o PHP:
	// ****** 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'] = '';
the 2 lines you need to modify by uncommenting (removing // from beginning of line) and changing their values

from
Insertar CODE, HTML o PHP:
//  $config['Datastore']['class'] = 'vB_Datastore_Filecache';
//  $config['Datastore']['prefix'] = '';
to
Insertar CODE, HTML o PHP:
$config['Datastore']['class']  = 'vB_Datastore_XCache';
$config['Datastore']['prefix'] = 'forum1';
change forum1 to whatever you want but it must be unqiue to each of your vB forums installed on same server so forum1, forum2, forum3, forum4, forum5 for 5 different vB forums' config files.

Also if you have vBSEO installed, ensure to enable vBSEO caching support for memcached or xcache or one of the supported and highlighted caching systems listed in vBSEO admin cp.

4. Upgrade to vB 3.0.17 vBulletin 3.0.17 Released if you're on vB 3.0.xx or upgrade to vB 3.5.8 vBulletin 3.5.8 Released if you're on vB 3.5.x. Or if on vB 3.6.x, upgrade to vB 3.6.12 PL2 vBulletin 3.8.4 PL1, 3.7.6 PL1 and 3.6.12 PL2 Released.

But ultimately, it's best to upgrade to the latest stable vB 3.8.5 vBulletin 3.8.5 Maintenance Release Now Available!! or at least 3.7.7. You can use my method of upgrading outlined at eva2000's Upgrade method which is essentially same in that you make a copy of your live database and import it into a new empty database and point vB 3.7.0 config.php to that new imported database name, so you essentially do an upgrade on a copy of your database, leaving original database intact in case of any problems. This method also allows you to run the original database on a different directory so to run both original forum/database along side the upgraded forum/database so you can easily revert all changed templates on upgraded forum and then using old forum/database transfer or port your custom style/images etc to the new upgrade database.

For vB 4.0.x upgrade to latest 4.02PL4 Security Patch Release 4.0.2 PL4

Read each versions listed thread to understand the changes that have occured etc.

5. If you just upgraded to vB 3.5.x/3.6.x try to disable these 4 options:

Admin CP -> vBulletin Options -> Forums Home Page Options -> Display Logged in Users?

Admin CP -> vBulletin Options -> Forum Display Options (forumdisplay) -> Show Users Browsing Forums

Admin CP -> vBulletin Options -> Thread Display Options -> Show Users Browsing Thread

Admin CP -> vBulletin Options -> Message Searching Options -> Automatic Similar Thread search

Admin CP -> vBulletin Options -> General Settings -> Thread/Forum Read Marking Type - Database automatic forum marking is very processor intensive compared to Inactivity/Cookie based or Database no automatic forum marking, so if your mysql process is constantly pegged at 100+ % cpu usage, you don't want to be using automatic forum marking Database type.

Or relevant sections in vB 3.7.x or 3.8.x

For vB 4.x try to DISABLE = set to NO these options

Admin CP -> vBulletin Options -> General Settings -> Use Quick Navigation Menu

Admin CP -> vBulletin Options -> General Settings -> Thread/Forum Read Marking Type - Database automatic forum marking is very processor intensive compared to Inactivity/Cookie based or Database no automatic forum marking, so if your mysql process is constantly pegged at 100+ % cpu usage, you don't want to be using automatic forum marking Database type.

Admin CP -> vBulletin Options -> Forums Home Page Options -> Display Logged in Users?

Admin CP -> vBulletin Options -> Forum Home Page Options -> Display Today's Birthdays?

Admin CP -> vBulletin Options -> Forum Home Page Options -> Display Calendar Events?

Admin CP -> vBulletin Options -> Forum Display Options (forumdisplay) -> Show Users Browsing Forums

Admin CP -> vBulletin Options -> Thread Display Options -> Show Users Browsing Thread

Admin CP -> vBulletin Options -> Thread Display Options -> Check Thread Rating

Admin CP -> vBulletin Options -> Thread Display Options -> Check Thread Subscription (disable to check if it's load related if not re-enable it)

Admin CP -> vBulletin Options -> Thread Display Options -> Full Next / Prev Links

Admin CP -> vBulletin Options -> Message Searching Options -> Automatic Similar Thread search

Try to ENABLE = set to YES these options

Admin CP -> vBulletin Options -> Message Searching Options -> Queue Search Updates

Admin CP -> vBulletin Options -> Message Searching Options -> Search Result Sharing

6. Check phpinfo.php url to see if you have mod_gzip (Apache 1.3.x) or mod_deflate (Apache 2.x) loaded/installed (on phpinfo.php url page in browser you can do CTRL+F to bring up find prompt and type in mod_gzip or mod_deflate to quickly see). If you have either mod_gzip or mod_deflate loaded, then ensure vB admincp gzip compression is disabled since it's the same thing as mod_gzip or mod_deflate and double compression will just increase cpu loads. If you don't have mod_gzip or mod_deflate installed, then DO NOT set vB admincp gzip compression to a level higher than 1. Higher than 1, will only increase cpu loads unncessarily.

7. Edit httpd.conf values to following and restart apache for each change to take effect

<IfModule prefork.c>
StartServers 15
MinSpareServers 15
MaxSpareServers 20
ServerLimit 256
MaxClients 180
MaxRequestsPerChild 1000

8. Tune your hard drive/partitions with noatime - read carefully these pages before trying vBulletin Community Forum and The atime and noatime attribute and Anyone using noami? - Web Hosting Talk. Use at your own risk (if any). Note, to remount partition use mount -o remount /partition where /partition is partition name.


La verdad que entre que no entiendo muy bien ingles y demas, no se por donde empezar, e de actualizar mysql y php, no se si esto es totalmente necesario o simplemente recomendable... la verdad que me da un poco de respeto... :)

Tambien habla de convertir las tablas a innodb, en los datos que les puse salen algunas asi:

Insertar CODE, HTML o PHP:
| innodb_additional_mem_pool_size | 1048576                     |
| innodb_autoextend_increment     | 8                           |
| innodb_buffer_pool_awe_mem_mb   | 0                           |
| innodb_buffer_pool_size         | 8388608                     |
| innodb_checksums                | ON                          |
| innodb_commit_concurrency       | 0                           |
| innodb_concurrency_tickets      | 500                         |
| innodb_data_file_path           | ibdata1:10M:autoextend      |
| innodb_data_home_dir            |                             |
| innodb_doublewrite              | ON                          |
| innodb_fast_shutdown            | 1                           |
| innodb_file_io_threads          | 4                           |
| innodb_file_per_table           | OFF                         |
| innodb_flush_log_at_trx_commit  | 1                           |
| innodb_flush_method             |                             |
| innodb_force_recovery           | 0                           |
| innodb_lock_wait_timeout        | 50                          |
| innodb_locks_unsafe_for_binlog  | OFF                         |
| innodb_log_arch_dir             |                             |
| innodb_log_archive              | OFF                         |
| innodb_log_buffer_size          | 1048576                     |
| innodb_log_file_size            | 5242880                     |
| innodb_log_files_in_group       | 2                           |
| innodb_log_group_home_dir       | ./                          |
| innodb_max_dirty_pages_pct      | 90                          |
| innodb_max_purge_lag            | 0                           |
| innodb_mirrored_log_groups      | 1                           |
| innodb_open_files               | 300                         |
| innodb_rollback_on_timeout      | OFF                         |
| innodb_support_xa               | ON                          |
| innodb_sync_spin_loops          | 20                          |
| innodb_table_locks              | ON                          |
| innodb_thread_concurrency       | 8                           |

Habla de que instale xcache, pienso cambiar de servidor en cosa de un par de meses que acaba el contrato con el que tengo, es necesario, o con el resto de config puedo tirar y cuando tenga el nuevo server ya hacerlo todo bien?

Como veis mi intencion es por el momento hacer lo minimo para que funcione medianamente bien, si puede ser solo con una buena config del my.cnf y poco mas mejor que mejor....

Saludos
| innodb_thread_sleep_delay | 10000
 

Beor

Beta
¡Usuario con pocos negocios! ¡Utiliza siempre saldo de Forobeta!
Desde
2 Mar 2006
Mensajes
77
Por favor, ten en cuenta 📝 que si deseas hacer un trato 🤝 con este usuario, está baneado 🔒.
ninguna ayudita?

Con un my.cnf para este mes y parte del que viene me conformo, caduca el servidor y preparare uno nuevo con todo lo que me piden y muuuuxa calma....

Saludos
 
Arriba