Too many open files in system, Cannot allocate memory

Diese Fehlermeldungen ist insbesondere bei vServern anzutreffen und ist i.d.R. mit dem (unregelmäßigen) Ausfall von einzelnen Diensten (z.B. Mail) verbunden.

Im Log sieht es z.B. wie folgt aus:

Oct 12 10:09:59 server master[21679]: fatal: master_spawn: exec /usr/lib/postfix/bounce: Resource temporarily unavailable
Oct 12 10:09:59 server master[21680]: fatal: master_spawn: exec /usr/lib/postfix/smtp: Resource temporarily unavailable
Oct 12 10:09:59 server postfix/qmgr[3212]: fatal: qmgr_active_defer: rename 0C57D1EC31026 from active to deferred: Cannot allocate memory
Oct 12 13:01:03 server postfix/qmgr[14244]: fatal: socket: Cannot allocate memory
Oct 12 13:01:03 server postfix/smtp[32170]: fatal: accept connection: Cannot allocate memory
Oct 12 13:01:45 server master[7680]: fatal: master_spawn: exec /usr/lib/postfix/cleanup: Resource temporarily unavailable
Oct 12 13:01:45 server postfix/master[3203]: fatal: event_loop: select: Cannot allocate memory
Oct 12 13:01:46 server postfix/smtpd[7652]: fatal: unable to connect to the public cleanup service
Oct 12 13:03:27 server postfix/smtpd[7651]: fatal: connect #11 to subsystem public/cleanup: Connection refused
Oct 12 13:03:27 server postfix/smtpd[7653]: fatal: connect #11 to subsystem public/cleanup: Connection refused
Oct 12 15:08:23 server postfix/smtp[5599]: fatal: open active 966EA1EC3004C: Too many open files in system


Oct 12 16:31:34 server master[7935]: fatal: master_spawn: exec /usr/lib/postfix/bounce: Resource temporarily unavailable
Oct 12 16:31:34 server postfix/smtp[7934]: fatal: socket: Cannot allocate memory
Oct 12 16:31:34 server postfix/smtp[7920]: fatal: socket: Cannot allocate memory
Oct 12 16:31:34 server postfix/qmgr[5433]: fatal: qmgr_active_defer: rename 789751ED38132 from active to deferred: Cannot allocate memory
Oct 12 16:33:15 server postfix/smtp[7927]: fatal: select: Cannot allocate memory
Oct 12 16:33:15 server postfix/bounce[30009]: fatal: open file defer 250F01EC30004: Cannot allocate memory
Oct 12 16:33:15 server postfix/smtp[28426]: fatal: select: Cannot allocate memory
Oct 12 16:33:15 server postfix/smtp[30007]: fatal: socket: Cannot allocate memory
Oct 12 17:56:35 server postfix/master[5423]: fatal: event_loop: select: Cannot allocate memory
Oct 12 17:56:35 server postfix/qmgr[28416]: fatal: socket: Too many open files in system
Oct 12 17:56:35 server postfix/smtp[22455]: fatal: accept connection: Cannot allocate memory
Oct 12 17:56:35 server postfix/bounce[22423]: fatal: accept connection: Cannot allocate memory
Oct 12 21:34:45 server postfix/postfix-script: fatal: the Postfix mail system is not running
Oct 12 21:34:46 server postfix/master[32168]: fatal: event_loop: select: Cannot allocate memory
Oct 12 21:34:46 server postfix/smtp[32194]: fatal: unknown user: postfix
Oct 12 21:36:37 server postfix/pickup[32170]: fatal: connect #11 to subsystem public/cleanup: Connection refused
Oct 12 21:36:37 server postfix/qmgr[32171]: fatal: connect #11 to subsystem private/defer: Connection refused

Bei V-Servern sind die Ressourcen je nach Ausstattung des gewählten Paketes beschränkt. Als Ressourcen sind dabei nicht nur Arbeitsspeicher (RAM) und Festplattenspeicher zu verstehen, sondern u.a. auch Kernel-Speicher, Anzahl der Prozesse und (TCP-) Sockets und somit eben auch die Anzahl der der Dateien, die maximal geöffnet werden können.

Im o.g. Beispiel ist es der Mailserver Postfixx, der aufgrund der Überschreitung der offenen Dateien nicht mehr korrekt läuft und die Fehlermeldungen bringt.

Die Anzahl der Dateien, die ein bestimmter Prozess geöffnet hat, lässt sich in der Konsole wie folgt feststellen:

server:~# lsof -i | grep [Dienst] | wc -l

Beispiele:
server:~# lsof -i | grep postfix | wc -l
338

server:~# lsof -i | grep apache | wc -l
587

So lässt sich relativ einfach herausfinden, welcher Prozess die meisten Dateien belegt und ob sich dies ggf. durch Änderung der Konfiguration beheben lässt. Wenn sich allerdings herausstellt, dass die Probleme durch eine hohe Auslastung des vServers entstehen, hilft nur noch ein Upgrade auf ein größeres VPS bzw. VDS (virtuell dedizierter Server) System :(

Tags: , , , , , , , ,

Einen Kommentar schreiben