IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Tomcat et TomEE Java Discussion :

Too many Open Files


Sujet :

Tomcat et TomEE Java

  1. #1
    Membre confirmé
    Homme Profil pro
    Inscrit en
    Mai 2007
    Messages
    187
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 55
    Localisation : France, Bouches du Rhône (Provence Alpes Côte d'Azur)

    Informations forums :
    Inscription : Mai 2007
    Messages : 187
    Par défaut Too many Open Files
    Bonjour,

    j'obtient régulièrement un "Too many Open Files" dans les logs de mon application web qui plante complètement l'appli.
    Je doit redémarrer mon Tomcat pour m'en sortir.

    - Tomcat 5.5.23
    - Postgres 8.3
    - Java 1.6
    - Ubuntu 9.04

    Je n'arrive pas à comprendre d'ou viens ce "Too Many Open Files"

    j'ai essayé de changer la limite de nombre de fichier ouvert par processus (ulimit -n 99999) mais j'ai toujours le problème. Le nombre de fichier ouvert n'a pas l'air délirant...

    Je soupçonne une contrainte en interne de Java mais je ne trouve rien.

    Des idées?

    Merci,

    P.

  2. #2
    Membre émérite Avatar de noOneIsInnocent
    Homme Profil pro
    Inscrit en
    Mai 2002
    Messages
    1 037
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Ille et Vilaine (Bretagne)

    Informations professionnelles :
    Secteur : High Tech - Multimédia et Internet

    Informations forums :
    Inscription : Mai 2002
    Messages : 1 037
    Par défaut
    Est-ce que tu peux poster la stack trace complète stp ?

  3. #3
    Membre confirmé
    Homme Profil pro
    Inscrit en
    Mai 2007
    Messages
    187
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 55
    Localisation : France, Bouches du Rhône (Provence Alpes Côte d'Azur)

    Informations forums :
    Inscription : Mai 2007
    Messages : 187
    Par défaut
    La trace typique est
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    java.io.FileNotFoundException: /var/apps/apache-tomcat-5.5.23/webapps/fimsTechnicalShip/error.jsp (Too many open files)
            at java.io.FileInputStream.open(Native Method)
            at java.io.FileInputStream.<init>(FileInputStream.java:106)
            at org.apache.naming.resources.FileDirContext$FileResource.streamContent(FileDirContext.java:975)
            at org.apache.naming.resources.DirContextURLConnection.getInputStream(DirContextURLConnection.java:307)
            at org.apache.jasper.compiler.Compiler.isOutDated(Compiler.java:370)
            at org.apache.jasper.compiler.Compiler.isOutDated(Compiler.java:333)
            at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:561)
            at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:299)
            at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315)
            at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
            at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:691)
            at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:471)
            at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:403)
            at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
            at org.apache.catalina.core.StandardHostValve.custom(StandardHostValve.java:364)
            at org.apache.catalina.core.StandardHostValve.status(StandardHostValve.java:285)
            at org.apache.catalina.core.StandardHostValve.throwable(StandardHostValve.java:229)
            at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:135)
            at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
            at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
            at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
            at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:870)
            at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
            at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
            at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
            at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:685)
            at java.lang.Thread.run(Thread.java:662)
    ou bien

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
     
    GRAVE: Le fichier web.xml par défaut est absent, utilisation du fichier web.xml de l'application web.xml seulement conf/web.xml /var/apps/apache-tomcat-5.5.23/conf/web.xml
    java.io.FileNotFoundException: /var/apps/apache-tomcat-5.5.23/conf/web.xml (Too many open files)
            at java.io.FileInputStream.open(Native Method)
            at java.io.FileInputStream.<init>(FileInputStream.java:106)
            at org.apache.catalina.startup.ContextConfig.defaultWebConfig(ContextConfig.java:602)
            at org.apache.catalina.startup.ContextConfig.start(ContextConfig.java:1043)
            at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:261)
            at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:120)
            at org.apache.catalina.core.StandardContext.start(StandardContext.java:4148)
            at org.apache.catalina.core.StandardContext.reload(StandardContext.java:3025)
            at org.apache.catalina.loader.WebappLoader.backgroundProcess(WebappLoader.java:432)
            at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1278)
            at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1570)
            at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1579)
            at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1579)
            at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1559)
            at java.lang.Thread.run(Thread.java:662)
    bref quand ça à commencé à péter... ça peut venir de partout.

  4. #4
    Membre émérite Avatar de noOneIsInnocent
    Homme Profil pro
    Inscrit en
    Mai 2002
    Messages
    1 037
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Ille et Vilaine (Bretagne)

    Informations professionnelles :
    Secteur : High Tech - Multimédia et Internet

    Informations forums :
    Inscription : Mai 2002
    Messages : 1 037
    Par défaut
    Visiblement , tomcat ne trouve pas le fichier web.xml de ton application

  5. #5
    Expert éminent
    Avatar de tchize_
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Avril 2007
    Messages
    25 482
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 45
    Localisation : Belgique

    Informations professionnelles :
    Activité : Ingénieur développement logiciels
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Avril 2007
    Messages : 25 482
    Par défaut
    Citation Envoyé par isma4 Voir le message
    Visiblement , tomcat ne trouve pas le fichier web.xml de ton application
    Rien a voir, comme le dit l'erreur, il y a trop de fichiers ouvert, le ulimit n'est probablement pas assez élevé. Attention qu'il ne suffit pas de tapper une commande pour augmenter le ulimit. Il faut d'abord aller dans /etc/limits changer la limite hard pour tout le monde, redémarrer la machine, et avant de lancer tomcat, utiliser la commande ulimit pour augmenter la limite soft de cet environnement précis (par défaut 1024).

  6. #6
    Membre confirmé
    Homme Profil pro
    Inscrit en
    Mai 2007
    Messages
    187
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 55
    Localisation : France, Bouches du Rhône (Provence Alpes Côte d'Azur)

    Informations forums :
    Inscription : Mai 2007
    Messages : 187
    Par défaut
    Merci tchize_
    Je suis sous Ubuntu,
    mon fichier /etc/security/limits.conf contient :
    * hard nofile 999999
    * soft nofile 999999

    Mais il semble que cela ne résolve pas le problème.

    Est-ce que ca ne peux pas venir d'ailleur... une limitation interne à java ??
    Comment puis-je savoir quel Process/Thread est à l'origine du Message "Too Many Open Files"

    Merci,

    P.

  7. #7
    Membre confirmé
    Homme Profil pro
    Inscrit en
    Mai 2007
    Messages
    187
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 55
    Localisation : France, Bouches du Rhône (Provence Alpes Côte d'Azur)

    Informations forums :
    Inscription : Mai 2007
    Messages : 187
    Par défaut
    suite au reboot, je constate que
    ulimit -n
    retourne toujours 1024.

    il semblerais donc que les limitations de /etc/security/limits.conf ne s'applique pas !!!

    P.

  8. #8
    Expert éminent
    Avatar de tchize_
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Avril 2007
    Messages
    25 482
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 45
    Localisation : Belgique

    Informations professionnelles :
    Activité : Ingénieur développement logiciels
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Avril 2007
    Messages : 25 482
    Par défaut
    je l'ai dit, il faut ET modifier le fichier, et changer le ulimit de l'environnement juste avant l'exécution, pour passer de la valeur par défaut au maximum autorisé:

    Par exemple, pour tomcat

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    $ulimit -n 65000
    $bin/startup.sh
    edit: après véfification, ca déonne, on ne peux pas augmenter, on peut juste descendre. Commencez par mettre une valeur raisonnable dans votre securit (genre 65000).
    ensuite, si quand vous vous logguez votre valeur est toujours 1024, regardez dans votre /etc/profile.d et dans votre ~.bashrc et autres si il n'y a pas une commande qui trainerai pour réduire explicitement à 1024!

  9. #9
    Membre éclairé
    Inscrit en
    Février 2010
    Messages
    38
    Détails du profil
    Informations forums :
    Inscription : Février 2010
    Messages : 38
    Par défaut
    Hello,

    j'ai rencontré aussi ce problème sur du Solaris.
    Pour information les open file peuvent aussi être des connexions à la base de donnée dans un état instable, non fermée, trop de sockets ouvertes etc...

    Ce n'est pas que des fichiers qui sont ouverts.

    Bon courage

  10. #10
    Membre confirmé
    Homme Profil pro
    Inscrit en
    Mai 2007
    Messages
    187
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 55
    Localisation : France, Bouches du Rhône (Provence Alpes Côte d'Azur)

    Informations forums :
    Inscription : Mai 2007
    Messages : 187
    Par défaut
    Citation Envoyé par tchize_ Voir le message
    edit: après véfification, ca déonne, on ne peux pas augmenter, on peut juste descendre.
    Je ne comprend pas la remarque.
    Sinon, je vais effectivement mettre ulimit -n 65000 dans mon script Tomcat... ca me parait plein de bon sens.

    P.

  11. #11
    Expert éminent
    Avatar de tchize_
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Avril 2007
    Messages
    25 482
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 45
    Localisation : Belgique

    Informations professionnelles :
    Activité : Ingénieur développement logiciels
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Avril 2007
    Messages : 25 482
    Par défaut
    Citation Envoyé par pdelorme Voir le message
    Je ne comprend pas la remarque.
    Ben chez moi

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    $ulimit -n
    65535
    $ulimit -n 1024
    ok
    $ulimit -n
    1024
    $ulimit -n 2048
    impossible
    $ulimit -n
    1024
    mais je me suis peut etre gourré dans la manip

  12. #12
    Membre éclairé
    Femme Profil pro
    Inscrit en
    Mai 2012
    Messages
    360
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Localisation : France

    Informations forums :
    Inscription : Mai 2012
    Messages : 360
    Par défaut
    Je me suis trompé

Discussions similaires

  1. Lecture de properties - Too many open files
    Par Romz_Java dans le forum Collection et Stream
    Réponses: 8
    Dernier message: 08/07/2011, 11h39
  2. [Tomcat 5.0.28] ZipException: Too many open files
    Par maloups dans le forum Tomcat et TomEE
    Réponses: 0
    Dernier message: 14/11/2008, 16h47
  3. Too many open files
    Par ppmaster dans le forum Weblogic
    Réponses: 1
    Dernier message: 11/09/2007, 14h17
  4. [Système] failed to open stream: Too many open files
    Par shamanlinks dans le forum Langage
    Réponses: 7
    Dernier message: 23/05/2006, 11h59
  5. Pb avec socket - too many open files
    Par be_tnt dans le forum Réseau
    Réponses: 16
    Dernier message: 17/05/2006, 10h46

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo