fabio10 10 Report post Posted January 8, 2009 PS:Usi PHP attraverso CGI? Si, php è attraverso CGI P.s. il suPhp è configurato standard o lo hai ritoccato? Standard Abbassa i limiti dei vari demoni (Apache, MySQL, etc.) perchè non ce la fai con la memoria. Si la memoria viene sforata, però credo sia dovuto perchè ormai il crash ha saturato tutto. Per limiti di Apache cosa intendi ? Questo è quello che ho settato in httpd.conf e non credo siano troppo alti (comunque adesso provo ad abbarli un po'): <IfModule prefork.c> StartServers 5 MinSpareServers 5 MaxSpareServers 20 MaxClients 100 MaxRequestsPerChild 256 </IfModule> Questo è invece il my.conf: anche qui cosa potrei modificare per abbassare i limiti ? # /etc/mysql/my.cnf: The global mysql configuration file. # $Header: /var/cvsroot/gentoo-x86/dev-db/mysql/files/my.cnf-4.1,v 1.3 2006/05/05 19:51:40 chtekk Exp $ # The following options will be passed to all MySQL clients [client] #password = your_password port = 3306 socket = /var/run/mysqld/mysqld.sock character-sets-dir=/usr/share/mysql/charsets default-character-set=latin1 [php-cgi] character-sets-dir=/usr/share/mysql/charsets default-character-set=latin1 [mysql] character-sets-dir=/usr/share/mysql/charsets default-character-set=latin1 [mysqladmin] character-sets-dir=/usr/share/mysql/charsets default-character-set=latin1 [mysqlcheck] character-sets-dir=/usr/share/mysql/charsets default-character-set=latin1 [mysqldump] character-sets-dir=/usr/share/mysql/charsets default-character-set=latin1 [mysqlimport] character-sets-dir=/usr/share/mysql/charsets default-character-set=latin1 [mysqlshow] character-sets-dir=/usr/share/mysql/charsets default-character-set=latin1 [myisamchk] character-sets-dir=/usr/share/mysql/charsets [myisampack] character-sets-dir=/usr/share/mysql/charsets # use [safe_mysqld] with mysql-3 [mysqld_safe] err-log = /var/log/mysql/mysql.err # add a section [mysqld-4.1] or [mysqld-5.0] for specific configurations [mysqld] character-set-server = latin1 init-connect='SET NAMES latin1' default-character-set = latin1 user = mysql port = 3306 socket = /var/run/mysqld/mysqld.sock pid-file = /var/run/mysqld/mysqld.pid log-error = /var/log/mysql/mysqld.err basedir = /usr datadir = /var/lib/mysql skip-locking key_buffer = 16M max_allowed_packet = 1M table_cache = 64 sort_buffer_size = 512K net_buffer_length = 8K read_buffer_size = 256K read_rnd_buffer_size = 512K myisam_sort_buffer_size = 8M language = /usr/share/mysql/english query_cache_type = 1 query_cache_size = 26214400 # security: # using "localhost" in connects uses sockets by default skip-networking #bind-address = 127.0.0.1 log-bin server-id = 1 # point the following paths to different dedicated disks tmpdir = /tmp/ #log-update = /path-to-dedicated-directory/hostname # you need the debug USE flag enabled to use the following directives, # if needed, uncomment them, start the server and issue # #tail -f /tmp/mysqld.sql /tmp/mysqld.trace # this will show you *exactly* what's happening in your server ;) #log = /tmp/mysqld.sql #gdb #debug = d:t:i:o,/tmp/mysqld.trace #one-thread # uncomment the following directives if you are using BDB tables #bdb_cache_size = 4M #bdb_max_lock = 10000 # the following is the InnoDB configuration # if you wish to disable innodb instead # uncomment just the next line skip-innodb # # the rest of the innodb config follows: # don't eat too much memory, we're trying to be safe on 64Mb boxes # you might want to bump this up a bit on boxes with more RAM innodb_buffer_pool_size = 16M # this is the default, increase it if you have lots of tables innodb_additional_mem_pool_size = 2M # # i'd like to use /var/lib/mysql/innodb, but that is seen as a database :-( # and upstream wants things to be under /var/lib/mysql/, so that's the route # we have to take for the moment #innodb_data_home_dir = /var/lib/mysql/ #innodb_log_arch_dir = /var/lib/mysql/ #innodb_log_group_home_dir = /var/lib/mysql/ # you may wish to change this size to be more suitable for your system # the max is there to avoid run-away growth on your machine innodb_data_file_path = ibdata1:10M:autoextend:max:128M # we keep this at around 25% of of innodb_buffer_pool_size # sensible values range from 1MB to (1/innodb_log_files_in_group*innodb_buffer_pool_size) innodb_log_file_size = 5M # this is the default, increase it if you have very large transactions going on innodb_log_buffer_size = 8M # this is the default and won't hurt you # you shouldn't need to tweak it set-variable = innodb_log_files_in_group=2 # see the innodb config docs, the other options are not always safe innodb_flush_log_at_trx_commit = 1 innodb_lock_wait_timeout = 50 [mysqldump] quick max_allowed_packet = 16M [mysql] # uncomment the next directive 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 Comunque si cercando in rete sembra essere un problema SOLO di Ovh e si suoi dedicati quindi sto cercando di capire in tutti i modi se questi crash sono causati da errori miei oppure è un problema di Ovh. Adesso infatti chiamo l'assistenza e poi vi faccio sapere.... P.S. Grazie a tutti per il prezioso aiuto :approved:! Share this post Link to post Share on other sites
EvolutionCrazy 31 Report post Posted January 9, 2009 chi è che si prende tutta la ram? php? apache? altro? PS: non penso sia un problema "solo di ovh"... casomai è un problema di quella specifica distribuzione che tu hai scelto di usare (che rende disponibile solo ovh) ... :/ Share this post Link to post Share on other sites
Shazan 44 Report post Posted January 9, 2009 Intanto puoi provare a vedere con MySQLTuner - MySQLTuner quanta RAM hai assegnato a MySQL, che è la cosa più facile. Poi su Apache: - abbassa MaxSpareServers a 10 - abbassa il timeout a 60 - disattiva keepalive oppure lascialo attivo ma imposta il relativo timeout a 3 e vedi come va. Share this post Link to post Share on other sites
fabio10 10 Report post Posted January 9, 2009 chi è che si prende tutta la ram? php? apache? altro? PS: non penso sia un problema "solo di ovh"... casomai è un problema di quella specifica distribuzione che tu hai scelto di usare (che rende disponibile solo ovh) ... :/ A saperlo ! Purtroppo appena iniziano i problemi non faccio mai in tempo a fare un top prima che si blocchi tutto :( Comunque credo che cambierò distribuzione...sta Gentoo è un disastro Share this post Link to post Share on other sites
EvolutionCrazy 31 Report post Posted January 9, 2009 eventualmente fai swap su file.... ti fai un bel file swap da 20gb.... e vedi.... se è qualche memory leak (io penso sia qualcosa del genere su qualche demone...) nemmeno i 20gb di bastano... se invece sono solo limiti troppo alti non crasha tutto........ quanta ram e quanto swap hai ora? Share this post Link to post Share on other sites
fabio10 10 Report post Posted January 9, 2009 eventualmente fai swap su file.... ti fai un bel file swap da 20gb.... e vedi.... se è qualche memory leak (io penso sia qualcosa del genere su qualche demone...) nemmeno i 20gb di bastano... se invece sono solo limiti troppo alti non crasha tutto........ quanta ram e quanto swap hai ora? Adesso ho 2 Gb di ram e 512 Mb di swap. Adesso comunque cerco di controllare il più possibile top per beccare qualche processo che impazzisce.... Per fare il test con lo swap a 20 Gb però c'è un modo per non riformattare il disco? Non voglio cancellare tutti i siti che sono davvero tanti gb. Se volete dare un'occhiata qui ci sono tutte le statistiche di mrtg https://ks21798.kimsufi.com/cgi-bin/mrtg.cgi Intanto puoi provare a vedere con MySQLTuner - MySQLTuner quanta RAM hai assegnato a MySQL, che è la cosa più facile. Poi su Apache: - abbassa MaxSpareServers a 10 - abbassa il timeout a 60 - disattiva keepalive oppure lascialo attivo ma imposta il relativo timeout a 3 Adesso provo ad abbassare i MaxSpareServers a 10Il timeout è già a 60 e anche keepalive è attivo con timeout a 3. Ora controllo con mysqlTuner la ram di MySQL P.S. Questa immagine è molto esplicativa Share this post Link to post Share on other sites
EvolutionCrazy 31 Report post Posted January 9, 2009 per creare un file da 2gb e farci swap sopra: dd if=/dev/zero of=/swapfile bs=1K count=2097152 mkswap /swapfile swapon /swapfile ovviamente le prestazioni di uno swap su un filesystem rispetto ad uno su partizione dedicata sono inferiori :) Share this post Link to post Share on other sites
fabio10 10 Report post Posted January 9, 2009 per creare un file da 2gb e farci swap sopra: dd if=/dev/zero of=/swapfile bs=1K count=2097152 mkswap /swapfile swapon /swapfile ovviamente le prestazioni di uno swap su un filesystem rispetto ad uno su partizione dedicata sono inferiori :) Ok appena ho tempo proverò ad aumentare lo swap. Ah, una cosa, per ritornare poi allo swap su disco come faccio :)?? Share this post Link to post Share on other sites
EvolutionCrazy 31 Report post Posted January 9, 2009 Ok appena ho tempo proverò ad aumentare lo swap. Ah, una cosa, per ritornare poi allo swap su disco come faccio :)?? bella domanda :D reboot? :D (o prova a vedere man swapon :P) Share this post Link to post Share on other sites
fabio10 10 Report post Posted January 10, 2009 Trovato il colpevole: php ! Qualche ora fa la memoria era di nuovo piena e sono riuscito a fare un ps aux ed era pieno di questi processi(più di 30) che riempivano la ram. Ora mi chiedo: come faccio ad evitare che si creino tutti questi processi php uno dietro l'altro fino a saturare la ram?? USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMANDuser1 7838 0.0 1.4 81724 29596 ? S Jan09 0:00 /usr/local/php5/bin/php user1 7844 0.0 1.4 81724 29596 ? S Jan09 0:00 /usr/local/php5/bin/php user1 7857 0.0 1.4 81724 29568 ? S Jan09 0:00 /usr/local/php5/bin/php user1 7859 0.0 1.4 81724 29592 ? S Jan09 0:00 /usr/local/php5/bin/php user1 7942 0.0 1.4 81984 29816 ? S Jan09 0:00 /usr/local/php5/bin/php user1 7944 0.0 1.4 81984 29816 ? S Jan09 0:00 /usr/local/php5/bin/php user1 14465 0.0 1.4 81724 29388 ? S 01:01 0:00 /usr/local/php5/bin/php user1 14771 0.0 1.4 81420 29120 ? S 01:03 0:00 /usr/local/php5/bin/php user1 14984 0.0 1.4 81420 29104 ? S 01:05 0:00 /usr/local/php5/bin/php user1 14989 0.0 1.4 81420 29104 ? S 01:05 0:00 /usr/local/php5/bin/php user1 15056 0.0 1.4 81420 29104 ? S 01:06 0:00 /usr/local/php5/bin/php user1 15063 0.0 1.4 81420 29104 ? S 01:06 0:00 /usr/local/php5/bin/php user1 15698 0.0 1.4 81420 29108 ? S 01:12 0:00 /usr/local/php5/bin/php user1 15951 0.0 1.4 81420 29144 ? S 01:14 0:00 /usr/local/php5/bin/php user1 16138 0.0 1.4 81420 29144 ? S 01:15 0:00 /usr/local/php5/bin/php user1 16244 0.0 1.4 81420 29144 ? S 01:16 0:00 /usr/local/php5/bin/php user1 16283 0.0 1.4 81420 29144 ? S 01:16 0:00 /usr/local/php5/bin/php user1 16287 0.0 1.4 81420 29144 ? S 01:16 0:00 /usr/local/php5/bin/php Share this post Link to post Share on other sites