Out of swapping space?

Discussion in 'LSWS 4.1 Release' started by sniperd, Aug 7, 2008.

  1. sniperd

    sniperd New Member

    Im using the cache feature and keep getting the following error, anyone know why?

    [xx.xx.xx.xx:38749-0#proxy-cache] out of swapping space while terminating GZIP stream!
  2. mistwang

    mistwang LiteSpeed Staff

    Should change the static gzip cache directory under "server"->"tuning" tab. By default it uses /tmp/lshttpd/swap . I recommend using "$SERVER_ROOT/cache" or any directory you want to use, just make sure the partition has enough free space.
  3. DangerD

    DangerD New Member

    Same problem. Changing dir's doesn't helped. 10GB of free space.

    Filesystem 1K-blocks Used Avail Capacity Mounted on
    /dev/vd0 102400000 91597412 10802588 89% /


    using php script for compression
    PHP:
    <?php
    global $GZIP;
    if(
    $GZIP == and $indexphp == 1) {
    header("Content-Encoding: gzip");
    ob_start(); 
    ob_implicit_flush(0); 
    function 
    CheckCanGzip(){
        global 
    $HTTP_ACCEPT_ENCODING
        if (
    headers_sent() || connection_aborted()){
            return 
    0
        }
        if (
    strpos($HTTP_ACCEPT_ENCODING,  'x-gzip') !== false) return "x-gzip"
        if (
    strpos($HTTP_ACCEPT_ENCODING'gzip') !== false) return "gzip"
        return 
    0
    }

    function 
    GzDocOut($level=3$debug=0){
        
    $ENCODING CheckCanGzip(); 
        if (
    $ENCODING){
            
    $Contents ob_get_contents(); 
            
    ob_end_clean(); 
            if (
    $debug){
                
    $s "<br style=\"clear: both\"><center><font style='color:#C0C0C0;
                      font-size:9px; font-family:tahoma'>Not compress
                      length: "
    .strlen($Contents).";  "
                
    $s .= "Compressed length: ".
                       
    strlen(gzcompress($Contents$level)).
                       
    "</font></center>"
                
    $Contents .= $s
            }
            
    header("Content-Encoding: $ENCODING"); 
            print 
    "\x1f\x8b\x08\x00\x00\x00\x00\x00"
            
    $Size strlen($Contents); 
            
    $Crc crc32($Contents); 
            
    $Contents gzcompress($Contents$level); 
            
    $Contents substr($Contents,  0,  strlen($Contents) - 4); 
            print 
    $Contents
            print 
    pack('V'$Crc); 
            print 
    pack('V'$Size); 
            exit; 
        }else{
            
    ob_end_flush(); 
            exit; 
        }
    }

    }

    ?>
  4. mistwang

    mistwang LiteSpeed Staff

  5. rahg0zar

    rahg0zar New Member

    Same problem
    none of answers helped me
    Litespeed Enterprise v4.2.9
  6. NiteWave

    NiteWave Administrator

    about free i-nodes ?
    #df -hi
  7. rahg0zar

    rahg0zar New Member

    total used free shared buffers cached
    Mem: 49415496 47558976 1856520 0 1074120 41267960
    -/+ buffers/cache: 5216896 44198600
    Swap: 8189936 22380 8167556

    **************************
    Filesystem Inodes IUsed IFree IUse% Mounted on
    rootfs 117M 872K 116M 1% /
    devtmpfs 5.9M 848 5.9M 1% /dev
    tmpfs 5.9M 29 5.9M 1% /dev/shm
    /dev/md3 117M 872K 116M 1% /
    /dev/md2 128K 47 128K 1% /boot
  8. NiteWave

    NiteWave Administrator

    "out of swapping space while terminating GZIP stream" comes from lsws.
    your code is in PHP and try to gzip something.
    so It looks lsws try to gzip something already gzipped by php.

    to identify the issue, can you disable gzip in php code. if the request headers contains "Accept-Encoding: gzip", lsws will gzip the response body automatically, no need php do the compression.

    on the other hand, if the response headers contains "Content-Encoding: gzip" from backend php process, lsws should stop gzip response body one more time. --- if it does, should be a bug. need further confirmation.
  9. rahg0zar

    rahg0zar New Member

    php.ini >> zlib.output_compression = off
    phpinfo >> gzip compression: enabled
    I tried to re compile php without '--with-zlib' in Configure Parameters; in phpinfo the gzip compression status changed to: "disabled (install ext/zlib)" but my site do not load completely and js files has problem
  10. NiteWave

    NiteWave Administrator

    how about just change the php a bit ?
    let function CheckCanGzip() always return 0

Share This Page