ПРОЕКТЫ 


  АРХИВ 


Apache-Talk @lexa.ru 

Inet-Admins @info.east.ru 

Filmscanners @halftone.co.uk 

Security-alerts @yandex-team.ru 

nginx-ru @sysoev.ru 


  СТАТЬИ 


  ПЕРСОНАЛЬНОЕ 


  ПРОГРАММЫ 



ПИШИТЕ
ПИСЬМА












     АРХИВ :: nginx-ru
Nginx-ru mailing list archive (nginx-ru@sysoev.ru)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: try_files random


  • To: nginx-ru@xxxxxxxxx
  • Subject: Re: try_files random
  • From: Валентин Бартенев <ne@xxxxxxxx>
  • Date: Sat, 21 Jul 2012 02:19:40 +0400
  • Dkim-signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=vbart.ru; s=mail; h=Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:In-Reply-To:References:Date:Subject:To:From; bh=Z/u7XFg299aDm5s3rfVzYeb1zAsxdjN+T+ZSofF5qP4=; b=QLVmQ1ottqbk73Bas+AtP0oJ2j8Z2Mg2BBe8jUBeZV9ffRRwooSNAQr1qz8MxpUunu3XuD2tBeVqYeuia38DarMzoVJTxtPBCWXkdDdvlc36ym+3AbuoQXwj6Jz/6p3yZe4OvWqVhmjCe87LFzA4qbo+Kw3eCXlXMXG1s+r7ykJc9E3vrY5D+LdJMe/IJE8lXPASHznBzpBRjkiwqUAK10DkVvJEyyhI36PH7YA2KKoOaV8my876/hMGSEDvVf8+P3o2ioE/58vjCHRU/efs1H0oAAnkQI8TnKIAGYlEbgfnCn14tHqzH8hdM4GLiqQHb1N2RuyEmuRCXX/jW1fJ0A==;
  • In-reply-to: <c7b71dada178873379f1f69f55755bab.NginxMailingListRussian@forum.nginx.org>
  • References: <c7b71dada178873379f1f69f55755bab.NginxMailingListRussian@forum.nginx.org>

On Friday 20 July 2012 19:36:18 arty777 wrote:
> location ~ ^/media(.+)$ {
> root /raid;
> 
> try_files
> /raid1$1
> /raid2$1
> /raid3$1
> /raid4$1
> /raid5$1
> /raid6$1
> /raid7$1
> /raid8$1
> /ssd1$1
> 
> =404;
> 

    split_clients "1$date_gmt$remote_addr" $v1 {
        12.5%  /raid1;
        12.5%  /raid2;
        12.5%  /raid3;
        12.5%  /raid4;
        12.5%  /raid5;
        12.5%  /raid6;
        12.5%  /raid7;
        12.5%  /raid8;
    }

    split_clients "2$date_gmt$remote_addr" $v2 {
        12.5%  /raid1;
        12.5%  /raid2;
        12.5%  /raid3;
        12.5%  /raid4;
        12.5%  /raid5;
        12.5%  /raid6;
        12.5%  /raid7;
        12.5%  /raid8;
    }

    ...

    split_clients "8$date_gmt$remote_addr" $v8 {
        12.5%  /raid1;
        12.5%  /raid2;
        12.5%  /raid3;
        12.5%  /raid4;
        12.5%  /raid5;
        12.5%  /raid6;
        12.5%  /raid7;
        12.5%  /raid8;
    }


    server {
         location ~ ^/media(.+)$ {
             try_files $v1$1 $v2$1 $v3$1 $v4$1 $v5$1 $v6$1 $v7$1 $v8$1
                       /ssd1$1 =404;
         }
    }

Но лучше все-таки данные по дискам распределять не рандомно, а по определенному 
правилу.

--
Валентин Бартенев

_______________________________________________
nginx-ru mailing list
nginx-ru@xxxxxxxxx
http://mailman.nginx.org/mailman/listinfo/nginx-ru


 




Copyright © Lexa Software, 1996-2009.