Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    Member
    Join Date
    May 2010
    Posts
    25

    Exclamation Problemas 100% de ocupamiento en /tmp

    Buenas!
    Tengo /tmp lleno no se por qué, mirando por los foros en inglés he recabado alguna información:


    Los ficheros en /tmp du -sk .[!.]* *|sort -n:
    (los más grandes)
    952 cache_4c3357c865d35c05202bb3ad399fd1cc
    1301 impatto8jD50
    5198 impatt1oCZw6
    17540 cache_08dc979336c613e30d298796ea1a2c4a
    17540 cache_495defb7063d18ee5c89c914a1ee11c2
    17540 cache_51de9bf14202f474bc50524463578c2a
    17540 cache_77bb2755dc4bbccd80bd78e6ca478cf0
    17540 cache_970a8ec053cd31e0c29cd03212b85a2e
    17540 cache_ed5b99657ea3cb5f56f10ed41934c904
    17549 cache_211db219a0a325dd827e4252c88725ed
    17549 cache_603e2a3b7e50db9ca2ea795c95519fd3
    17549 cache_76683987b2aed1220883e465d8ecb524
    17549 cache_ab7d8f6f770e2e3cd4d611cb0e638ed0
    17549 cache_b9a4fd78db385d4fa865d4337ff41ebb
    17549 cache_f8e994312b018e64e7e21ec0215f2d7f
    17805 cache_046412452f2258a451e0b8bf1b20f3cb
    17805 cache_36b397bb37152b8ae4f660427fd630b3
    17805 cache_5f01ab3402b8ded73ca8f97cd421a8e3
    17805 cache_645bbb3b78d9e2acbdd716b0b0cb963f
    17805 cache_70bd79d51022a2b48fb6f00f1b910102
    17805 cache_f71237292eae38d41516cc89c74e637f
    17819 cache_0608c8b12742d46d4f99ef86b0ed9195
    17819 cache_1180ba553a6f3f5b264faaa0b4a454f9
    17819 cache_1f5b2370a160aa6bac778d273174352e
    17819 cache_49485def4014dcf501b0c18798d37995
    17819 cache_55e846dc00eb3822a6b2b09050908308
    17819 cache_a7a1c408d3447c34db5a3cfc0e317035
    18619 impattcAvuex

    SI hago:
    ls -lah /tmp:
    Lso más grandes son de cpanlehorde.... ¿¿?¿ Qué quiere decir esto? Como lo arreglo???
    -rw------- 1 cpanelhorde cpanelhorde 18M Jan 25 09:53 cache_0608c8b12742d46d4f99ef86b0ed9195
    -rw------- 1 cpanelhorde cpanelhorde 844 Jan 24 19:57 cache_0629424c4bed59a3dd74dcc6e2b73fdd
    -rw------- 1 cpanelhorde cpanelhorde 18M Jan 25 09:55 cache_08dc979336c613e30d298796ea1a2c4a
    -rw------- 1 cpanelhorde cpanelhorde 18M Jan 25 09:52 cache_1180ba553a6f3f5b264faaa0b4a454f9
    -rw------- 1 cpanelhorde cpanelhorde 17K Jan 25 08:42 cache_125a39255b5ed6fa71fb8c82d569fee5
    -rw------- 1 cpanelhorde cpanelhorde 1 Jan 25 10:52 cache_15c13e1ba9355a791b30e0e7f6267761
    -rw------- 1 cpanelhorde cpanelhorde 18M Jan 25 09:55 cache_1f5b2370a160aa6bac778d273174352e
    -rw------- 1 cpanelhorde cpanelhorde 18M Jan 25 09:52 cache_211db219a0a325dd827e4252c88725ed
    -rw------- 1 cpanelhorde cpanelhorde 1022 Jan 25 09:21 cache_214f86b6af4344a46a4ecde4e108e624


    Y EN:
    /var/lib/mysql/hostname.err tengo muchas entradas es estas MySQL:
    (the las ultimas)
    120125 10:54:27 [ERROR] /usr/sbin/mysqld: Incorrect key file for table '/tmp/#sql_12f1_0.MYI'; try to repair it
    120125 10:55:51 [ERROR] /usr/sbin/mysqld: Incorrect key file for table '/tmp/#sql_12f1_0.MYI'; try to repair it
    120125 10:57:33 [ERROR] /usr/sbin/mysqld: Incorrect key file for table '/tmp/#sql_12f1_0.MYI'; try to repair it
    120125 10:58:04 [ERROR] /usr/sbin/mysqld: Incorrect key file for table '/tmp/#sql_12f1_0.MYI'; try to repair it
    120125 10:58:41 [ERROR] /usr/sbin/mysqld: Incorrect key file for table '/tmp/#sql_12f1_0.MYI'; try to repair it
    120125 10:58:41 [ERROR] /usr/sbin/mysqld: Incorrect key file for table '/tmp/#sql_12f1_0.MYI'; try to repair it
    120125 10:58:58 [ERROR] /usr/sbin/mysqld: Incorrect key file for table '/tmp/#sql_12f1_0.MYI'; try to repair it
    120125 11:00:47 [ERROR] /usr/sbin/mysqld: Incorrect key file for table '/tmp/#sql_12f1_0.MYI'; try to repair it
    120125 11:00:47 [ERROR] /usr/sbin/mysqld: Incorrect key file for table '/tmp/#sql_12f1_0.MYI'; try to repair it
    120125 11:02:03 [ERROR] /usr/sbin/mysqld: Incorrect key file for table '/tmp/#sql_12f1_0.MYI'; try to repair it
    120125 11:03:37 [ERROR] /usr/sbin/mysqld: Incorrect key file for table '/tmp/#sql_12f1_0.MYI'; try to repair it
    120125 11:05:00 [ERROR] /usr/sbin/mysqld: Incorrect key file for table '/tmp/#sql_12f1_0.MYI'; try to repair it
    120125 11:06:00 [ERROR] /usr/sbin/mysqld: Incorrect key file for table '/tmp/#sql_12f1_0.MYI'; try to repair it
    120125 11:07:57 [ERROR] /usr/sbin/mysqld: Incorrect key file for table '/tmp/#sql_446d_0.MYI'; try to repair it

    Qué puedo hacer para arreglarlo? Cual es el problema?
    He reiniciado varios servicios pero sigue igual...

    Muchas gracias por adelantado!!

  2. #2
    cPanel Staff
    Join Date
    Jan 2011
    Location
    Houston, TX
    Posts
    21

    Default Re: Problemas 100% de ocupamiento en /tmp

    Hola,

    Es probable que el problema es debido a las tablas temporales de mysql. Mysql crea estas tablas en /tmp para poder ejecutar ciertos tipos de consultas. Estas tablas pueden ser muy grandes cuando la consulta incluye muchos filas de la tabla. Puede ser difícil saber lo que está pasando porque mysql va borrando los archivos y por eso no siempre aparecen cuando haces un "ls" o "du" en /tmp. Si /tmp no está 100% lleno cuando lo revisas, pero sigues recibiendo errores el contrario, es muy probable que esto sea el problema.

    Una manera para ver el problema es correr un script como el siguiente...

    Code:
    #!/bin/bash
    
    while [ true ]; do
      find /tmp -size +1M -ls
      mysqladmin processlist
      sleep 5
    done
    ...para ver los archivos grandes en /tmp y la lista de procesos en mysql cada cinco segundos. Esto te dirigirá al usuario o el proceso responsable. Normalmente las consultas que generan tablas temporales muy grandes son ineficientes y se puede lograr el mismo objectivo con una consulta mejor.

    - - -

    Si el problema de raíz es que no hay suficiente espacio en /tmp, puedes seguir los siguientes pasos para aumentar su tamaño (esto supone que /tmp está montado como un "loopback device" en el archivo /usr/tmpDSK):

    1. Prevenir que cPanel reinice los servicios durante esta operación:
    Code:
    /scripts/restartsrv_tailwatchd --stop
    2. Parar los servicios principales que usan tmp:
    Code:
    /scripts/restartsrv_mysql --stop
    /scripts/restartsrv_httpd --stop
    3. Asegurar que nada hay otros proceso que están usando /tmp. El siguiente comando muestra una lista de proceso que tienen archivos abiertos dentro de /tmp:
    Code:
    lsof | grep /tmp
    Mata cualquier proceso que todavia está usando /tmp

    4. Desmontar /tmp:
    Code:
    umount /tmp
    5. Editar el script /scripts/securetmp, cambiando el valor de $tmpdsksize al valor deseado:
    Code:
    vi /scripts/securetmp
    Por ejemplo, para crear una partición /tmp que es de 2 digabytes, haría que $tmpdsksiz sea 2097152 como:
    Code:
    my $tmpdsksize = 2097152;
    6. Elminar el archivo que se usa para la partición "loopback" de /tmp:
    Code:
    rm /usr/tmpDSK
    7. Ejecutar el script:
    Code:
    /scripts/securetmp
    8. Recrear el enlace simbólico para mysql.sock:
    Code:
    cd /tmp; ln -s /var/lib/mysql/mysql.sock
    9. Reinciar los servicios que se había detenido anteriormente:
    Code:
    /scripts/restartsrv_tailwatchd --start
    /scripts/restartsrv_mysql --start
    /scripts/restartsrv_httpd --start
    Saludos!
    Last edited by cpbrianw; 02-20-2012 at 09:57 AM. Reason: typo

Similar Threads & Tags
Similar threads

  1. /tmp 100% full
    By fvrioso in forum Optimization
    Replies: 12
    Last Post: 04-22-2010, 01:05 PM
  2. /tmp maxing out 100%
    By cz1179 in forum cPanel and WHM Discussions
    Replies: 15
    Last Post: 07-30-2005, 11:11 AM
  3. /tmp 100 %
    By DjMiX in forum cPanel and WHM Discussions
    Replies: 3
    Last Post: 05-19-2005, 02:04 AM
  4. /tmp filling up 100%
    By cz1179 in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 01-08-2005, 03:09 PM
  5. /tmp says 100%, du says different?
    By myusername in forum cPanel and WHM Discussions
    Replies: 9
    Last Post: 10-18-2004, 08:47 AM
Tags for this Thread
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube