Autor Thema: SWAP-Speicher läuft voll bzw. "verschwindet"  (Gelesen 2693 mal)

vasquesbc

  • Gast
SWAP-Speicher läuft voll bzw. "verschwindet"
« am: 04. Juli 2006, 16:29:20 »
Hallo zusammen,

ich beobachte seit einiger Zeit ein seltsames Verhalten auf meiner SPARCstation 4 (TurboSPARC 110MHz, 160MB RAM)

Der SWAP-Bereich ist 128MB groß - damit gab es auch nie Probleme...
Auf der Maschine läuft Solaris 8 (Aktueller RPC), OpenSSL/OpenSSH sowie xampp für Solaris in der aktuellen Version.

Nun zum Problem:

Nach einiger Zeit im Betrieb (XHTML/PHP Programmierung, Logins per SSH, PHP-Sessions, PHP-Dateiuploads, SFTP) streikt das System mit der Meldung, dass kein Plattenplatz mehr zur Verfügung steht - das betrifft in dem Fall den SWAP-Bereich. Somit sind z.B. keine SSH-Logins mehr möglich, es können keine PHP-Sessions mehr erstellt werden etc.

Ich habe mir daraufhin per "df -k" mal den freien Speicher auf den einzelnen Mountpoints angesehen und entdeckt, dass der SWAP-Speicher nicht einfach vollgelaufen ist, sondern kleiner wurde(!), bis schließlich nur noch ca. 1kb Gesamtspeicher zur Verfügung stand.

Das ganze ist mir nun zwei mal passiert - ich konnte mich nur noch an der Konsole anmelden und nach einem Reboot war das Problem vorerst gelöst.

Nun weis ich nicht so recht, wie ich den Grund bzw. Übeltäter herausfinden kann und hoffe auf eure Hilfe.

Ich habe bereits das TMP-Verzeichnis für PHP auf "/opt/xampp/tmp" gesetzt - trotzdem wird der SWAP-Speicher kleiner (ich schau hin und wieder mal per "df -k") nach...

Hier die Ausgabe von "df -k" von vor einigen Minuten:

Filesystem            kbytes    used   avail capacity  Mounted on
/dev/dsk/c0t3d0s0    1015430  174628  779877    19%    /
/dev/dsk/c0t3d0s1    7622631  160659 7385746     3%    /usr
/proc                      0       0       0     0%    /proc
fd                         0       0       0     0%    /dev/fd
mnttab                     0       0       0     0%    /etc/mnttab
swap                   14456       8   14448     1%    /var/run
swap                   14460      12   14448     1%    /tmp

Zwischenzeitlich wurde mir eine SSH-Verbindung von der Firewall (ich bin gerade nicht zu Hause an der Sun, sondern arbeite remote übers Internet) gekillt - nach einer neuen SSH-Verbindung wieder "df -k" gemacht mit folgendem Ergebnis:

Filesystem            kbytes    used   avail capacity  Mounted on
/dev/dsk/c0t3d0s0    1015430  174629  779876    19%    /
/dev/dsk/c0t3d0s1    7622631  160659 7385746     3%    /usr
/proc                      0       0       0     0%    /proc
fd                         0       0       0     0%    /dev/fd
mnttab                     0       0       0     0%    /etc/mnttab
swap                   10304       8   10296     1%    /var/run
swap                   10308      12   10296     1%    /tmp

Da sind schon wieder über 4000kbytes flöten gegangen... Spricht dafür, dass es mit SSH zu tun hat (?)
Ich weis absolut nicht weiter...

sonnenblen.de - Das unabhängige Sun User Forum

SWAP-Speicher läuft voll bzw. "verschwindet"
« am: 04. Juli 2006, 16:29:20 »

sun-man

  • Gast
Re: SWAP-Speicher läuft voll bzw. "verschwindet"
« Antwort #1 am: 06. Juli 2006, 01:32:38 »
Hi,

ist mir unverständlich weil ich es nicht nachspielen kann.
Was ist swap bei Dir? Eine Partition/Slice?
Was sagt swap -l
Vermutlich ist die Lösung völlig einfach, nur ohen System fällt mir einfach nix ein - könnte auch an der Zeit liegen :D

Hilft dir das?
Zitat
The TMPFS file system is activated automatically in the Solaris environment by an entry in the /etc/vfstab file. The TMPFS file system stores files and their associated information in memory (in the /tmp directory) rather than on disk, which speeds access to those files. This feature results in a major performance enhancement for applications such as compilers and DBMS products that use /tmp heavily.

The TMPFS file system allocates space in the /tmp directory from the system's swap resources. This feature means that as you use up space in the /tmp directory, you are also using up swap space. So if your applications use the /tmp directory heavily and you do not monitor swap space usage, your system could run out of swap space.

Use the following if you want to use TMPFS but your swap resources are limited:

    *Mount the TMPFS file system with the size option (-o size) to control how much swap resources TMPFS can use.
    *Use your compiler's TMPDIR environment variable to point to another larger directory.

Using your compiler's TMPDIR variable only controls whether the compiler is using the /tmp directory. This variable has no effect on other programs' use of the /tmp directory.

vasquesbc

  • Gast
Re: SWAP-Speicher läuft voll bzw. "verschwindet"
« Antwort #2 am: 06. Juli 2006, 11:22:50 »
Zitat
Was ist swap bei Dir? Eine Partition/Slice?

Ist ein Slice - hab mich in der Terminologie vergriffen ;-)

Zitat
Was sagt swap -l

swapfile             dev  swaplo blocks   free
/dev/dsk/c0t3d0s2   32,26      8 262168 262168

Das die von "df -k" angezeigte Größe des swap-Bereichs kleiner wird, scheint normal zu sein, wenn das System selbst auslagert. - Dann bleibt natürlich weniger platz für /tmp und /var/run
Das Problem scheint schlicht entstanden zu sein, weil sich Apache 2 zu sehr "ausbreitete" - ich habe ihn jetzt ein wenig geknebelt und es geht.
(160MB RAM sind für Apache2+PHP5, MySQL, SSH doch etwas mager - da läuft schonmal der swap voll *g*)

sun-man

  • Gast
Re: SWAP-Speicher läuft voll bzw. "verschwindet"
« Antwort #3 am: 06. Juli 2006, 11:32:49 »
Mhmm, mit dem SE Toolkit kannst Du evtl sowas auch recht nett ansehen oder verfolgen. Zumindest gibts nen Popup welches nicht im "iostat" geborenen ;) hilft das etwas besser zu sehen.
http://www.sunfreeware.com/setoolkit.html

müsste unter bin dann ./se zoom.se aufgerufen werden

Offline Jonny

  • Global Moderator
  • Sobl Guru
  • *****
  • Beiträge: 1063
Re: SWAP-Speicher läuft voll bzw. "verschwindet"
« Antwort #4 am: 07. Juli 2006, 17:19:39 »
Was ich auf alle Fälle machen würde, ist die Größe des /tmp per mount Option in der
/etc/vfstab zu limitieren (guckst du man Page).
Bei dem knappen Virtuellen Speicher kannst du dir auch überlegen /tmp in das Root Filesystem
auf Platte zu legen. Auch bei dieser Möglichkeit bietet sich eine Limitierung der Größe an.
Auf keinen Fall per Link oder so auf eine andere Partition legen (sonst hast du im Single User
ein großes Problem).

Gruß
Jonny
solaris is like a wigwam :
no windows, no gates and a apache inside !