Warning: Illegal string offset 'region' in /home/mhd-01/www.gabcicala.it/htdocs/wp-content/plugins/mygeopositioncom-geotags-geometatags/mygeopositioncom-geotags-geometatags.php on line 386

Warning: Illegal string offset 'placename' in /home/mhd-01/www.gabcicala.it/htdocs/wp-content/plugins/mygeopositioncom-geotags-geometatags/mygeopositioncom-geotags-geometatags.php on line 390

Warning: Illegal string offset 'position' in /home/mhd-01/www.gabcicala.it/htdocs/wp-content/plugins/mygeopositioncom-geotags-geometatags/mygeopositioncom-geotags-geometatags.php on line 394

Too many open files


Warning: Illegal string offset 'addMap' in /home/mhd-01/www.gabcicala.it/htdocs/wp-content/plugins/mygeopositioncom-geotags-geometatags/mygeopositioncom-geotags-geometatags.php on line 639

Warning: Illegal string offset 'position' in /home/mhd-01/www.gabcicala.it/htdocs/wp-content/plugins/mygeopositioncom-geotags-geometatags/mygeopositioncom-geotags-geometatags.php on line 561

Warning: Illegal string offset 'position' in /home/mhd-01/www.gabcicala.it/htdocs/wp-content/plugins/mygeopositioncom-geotags-geometatags/mygeopositioncom-geotags-geometatags.php on line 603

A volte capita che nel far girare uno script PHP o un applicativo si aprono troppi file o socket con una segnalazione simile a quella in oggetto.
Per rimediare bisogna andare a rivedere le limitazioni mediante ulimit.
In genere con un ulimit -a si ottiene un listato di questo tipo:

host:~# ulimit -a
core file size          (blocks, -c) 0
data seg size           (kbytes, -d) unlimited
scheduling priority             (-e) 0
file size               (blocks, -f) unlimited
pending signals                 (-i) 16372
max locked memory       (kbytes, -l) 32
max memory size         (kbytes, -m) unlimited
open files                      (-n) 1024
pipe size            (512 bytes, -p) 8
POSIX message queues     (bytes, -q) 819200
real-time priority              (-r) 0
stack size              (kbytes, -s) 8192
cpu time               (seconds, -t) unlimited
max user processes              (-u) 16372
virtual memory          (kbytes, -v) unlimited
file locks                      (-x) unlimited

quello di interesse nel nostro caso sono gli open file:
open files                      (-n) 1024
che di sefault sono impostati a 1024.
Per aumentare questo valore in running ci basta lanciare il seguente comando:
host:~# ulimit  -n 2048 www-data
che limita all’utente www-data 2048 open file.

Il secondo step riguarda il file limits.conf all’interno di /etc/security/ che avrà una riga del seguente tipo:
www-data        hard    nofile          2048
L’aver aggiornato questo file dovrebbe consentire, al riavvio della macchina, di non doversi preoccupare di lanciare un nuovo ulimit per reimpostare le limitazioni.
N.B.: questi path riguardano una Debian.

P.S.: come descritto su questo link le limitazioni che vengono indicate nel file limits.conf possono

P.S.: come descritto su questo link (How to: Prevent a fork bomb by limiting user process) le limitazioni che vengono indicate nel file limits.conf possono essere utili per limitare il fork bombTechnorati Tags: , , ,

About the Author: glycerin


Warning: stream_socket_client(): unable to connect to tcp://mail.gabcicala.it:587 (Connection refused) in /home/mhd-01/www.gabcicala.it/htdocs/wp-content/plugins/wp-mail-bank/lib/zend/mail/protocol/class-mail-bank-zend-mail-protocol-abstract.php on line 237