[PATCH] multiple $mogilefs_path variables

Valery Kholodkov valery+nginxen at grid.net.ru
Fri Mar 5 13:50:55 MSK 2010


Greetings!

This patch for nginx mogilefs module implements multiple $mogilefs_path variables.

They names are $mogilefs_path, $mogilefs_path1 ... $mogilefs_path9

This allows to implement failover in nginx when a storage node fails.

Example:

location /download/ {
    [...]

    mogilefs_noverify on;
    mogilefs_pass {
        proxy_pass $mogilefs_path;
        proxy_buffering off;
        error_page 502 503 504 = @failover1;
    }
}

location @failover1 {
    if($mogilefs_path1 = "") {
        return 503;
    }

    proxy_pass $mogilefs_path1;
    proxy_buffering off;
    error_page 502 503 504 = @failover2;
}

location @failover2 {
    if($mogilefs_path2 = "") {
        return 503;
    }

    proxy_pass $mogilefs_path2;
    proxy_buffering off;

    [ ... and so on ... ]
}

When mogilefs_noverify on directive is accompanied with such configuration, MogileFS tracker will be able to return paths to file without verifying storage node's live status, which theoretically makes it reply faster.

It will be nice if someone can test it.

-- 
Regards,
Valery Kholodkov
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mogilefs_multiple_vars.patch
Type: text/x-patch
Size: 5282 bytes
Desc: not available
URL: <http://nginx.org/pipermail/nginx/attachments/20100305/47aa9df2/attachment.bin>


More information about the nginx mailing list