rtyug

rtyug
Рейтинг
263
Регистрация
13.05.2009
Должность
perl,php,sql,javascript(jquery),freebsd/linux
Интересы
perl,php,sql,javascript(jquery),freebsd/linux
https://minfin.com.ua/blogs/94589307/115366/

alex545, а какие Ваши предложение? эти файлы должны будут отдаваться одиним куском? какая посещаемость?

проблема в том что очень много маленьких файлов и в том что на одном сервере все это... сколько файлов размера 1-20метр?

6000000/100=60000 файлов

6000000/1= 6000000 файлов

  • может быть файлы действительно в PgSQL/Oracle/DB\2 поставить? (советовать не будут, такую связки не было :) )
  • можно посмотреть на MogileFS
  • и т.д.

в одном проекте где было 10млн файлов и даже только у некоторых пользователей по 4Тб :)

когда пользователь хотел скачать через httpd, то переходил на страницу http://super-site.ru/file/we32swrs3/porn.avi , скрипт принимал название, смотрел в бд есть ли этот файл и его ид, после кнопки скачать, скрипт отправлял в nginx через внутрений редирект данные (время жизни ссылки и т.д.) и пользовтаь получал эту ссылку через которую можно было скачать файл...

файлы дедились по каталогам, именно так, по 1000 файлов...

узнать какой файл в каком каталоге должен быть и в каком он есть, можно было так:

$f->{new_id_file} - id файла

$c->{files_per_folder} - число файлов в каталоге

название каталога:

sprintf("%05d",$f->{new_id_file}/$c->{files_per_folder});

# perl -e 'print sprintf("%05d",100/10)'

00010
# perl -e 'print sprintf("%05d",101/10)'
00010
# perl -e 'print sprintf("%05d",111/10)'
00011

Кстати, на perl можно такую кроссплатформенность замутить :)



our $loaded_syscall = 0;

sub _load_syscall {
# props to Gaal for this!
return if $loaded_syscall++;
my $clean = sub {
delete @INC{qw<syscall.ph asm/unistd.ph bits/syscall.ph
_h2ph_pre.ph sys/syscall.ph>};
};
$clean->(); # don't trust modules before us
my $rv = eval { require 'syscall.ph'; 1 } || eval { require 'sys/syscall.ph'; 1 };
$clean->(); # don't require modules after us trust us
return $rv;
}

our ($sysname, $nodename, $release, $version, $machine) = POSIX::uname();

our (
$SYS_epoll_create,
$SYS_epoll_ctl,
$SYS_epoll_wait,
$SYS_sendfile,
$SYS_readahead,
);

if ($^O eq "linux") {
# whether the machine requires 64-bit numbers to be on 8-byte
# boundaries.
my $u64_mod_8 = 0;

# if we're running on an x86_64 kernel, but a 32-bit process,
# we need to use the i386 syscall numbers.
if ($machine eq "x86_64" && $Config{ptrsize} == 4) {
$machine = "i386";
}

if ($machine =~ m/^i[3456]86$/) {
$SYS_epoll_create = 254;
$SYS_epoll_ctl = 255;
$SYS_epoll_wait = 256;
$SYS_sendfile = 187; # or 64: 239
$SYS_readahead = 225;
} elsif ($machine eq "x86_64") {
$SYS_epoll_create = 213;
$SYS_epoll_ctl = 233;
$SYS_epoll_wait = 232;
$SYS_sendfile = 40;
$SYS_readahead = 187;
} elsif ($machine eq "ppc64") {
$SYS_epoll_create = 236;
$SYS_epoll_ctl = 237;
$SYS_epoll_wait = 238;
$SYS_sendfile = 186; # (sys32_sendfile). sys32_sendfile64=226 (64 bit processes: sys_sendfile64=186)
$SYS_readahead = 191; # both 32-bit and 64-bit vesions
$u64_mod_8 = 1;
} elsif ($machine eq "ppc") {
$SYS_epoll_create = 236;
$SYS_epoll_ctl = 237;
$SYS_epoll_wait = 238;
$SYS_sendfile = 186; # sys_sendfile64=226
$SYS_readahead = 191;
$u64_mod_8 = 1;
} elsif ($machine eq "ia64") {
$SYS_epoll_create = 1243;
$SYS_epoll_ctl = 1244;
$SYS_epoll_wait = 1245;
$SYS_sendfile = 1187;
$SYS_readahead = 1216;
$u64_mod_8 = 1;
} elsif ($machine eq "alpha") {
# natural alignment, ints are 32-bits
$SYS_sendfile = 370; # (sys_sendfile64)
$SYS_epoll_create = 407;
$SYS_epoll_ctl = 408;
$SYS_epoll_wait = 409;
$SYS_readahead = 379;
$u64_mod_8 = 1;
} else {
# as a last resort, try using the *.ph files which may not
# exist or may be wrong
_load_syscall();
$SYS_epoll_create = eval { &SYS_epoll_create; } || 0;
$SYS_epoll_ctl = eval { &SYS_epoll_ctl; } || 0;
$SYS_epoll_wait = eval { &SYS_epoll_wait; } || 0;
$SYS_readahead = eval { &SYS_readahead; } || 0;
}

if ($u64_mod_8) {
*epoll_wait = \&epoll_wait_mod8;
*epoll_ctl = \&epoll_ctl_mod8;
} else {
*epoll_wait = \&epoll_wait_mod4;
*epoll_ctl = \&epoll_ctl_mod4;
}
}

elsif ($^O eq "freebsd") {
if ($ENV{FREEBSD_SENDFILE}) {
# this is still buggy and in development
$SYS_sendfile = 393; # old is 336
}
}

Buenos, это со всем детская база в 400Mb, надо оптимизировать запросы...

Romka_Kharkov, что будет в качестве fs?

может распределённую файловую систему с репликацией? (без огранчений и с высокой производительностью)

Buenos:

Использую: CentOS 5 x64, PHP5+MySQL.

нагрузку создает MySQL?

Бардо:

Прошу у всех пардона за некоторый идиотизм, но попробуйте резко бросьте пить - сразу превратитесь в бойцового дельфина, ломающего карму и вызывающие непереносимые моральные страдания.

Вы еще траву не курили)

Бардо, вот фотография про это, наверное

http://gnwp.ru/uploads/posts/2010-12/1291808998_nihil.jpg

есть

Pidgin 2.5.6

(libpurple 2.5.6)

Pidgin is a graphical modular messaging client based on libpurple which is capable of connecting to AIM, MSN, Yahoo!, XMPP, ICQ, IRC, SILC, SIP/SIMPLE, Novell GroupWise, Lotus Sametime, Bonjour, Zephyr, MySpaceIM, Gadu-Gadu, and QQ all at once. It is written using GTK+.

You may modify and redistribute the program under the terms of the GPL (version 2 or later). A copy of the GPL is contained in the 'COPYING' file distributed with Pidgin. Pidgin is copyrighted by its contributors. See the 'COPYRIGHT' file for the complete list of contributors. We provide no warranty for this program.

URL: http://pidgin.im/

FAQ: http://developer.pidgin.im/wiki/FAQ

Help via e-mail: support@pidgin.im

IRC Channel: #pidgin on irc.freenode.net

XMPP MUC: devel@conference.pidgin.im

Ужик, была похожая проблема в jquery с этим браузером (там геморой большой)

обновите jquery до последне версии :)

у меня решился вопрос обновлением до jquery-1.4.4

rtyug добавил 25-01-2011 в 14:43

вот эта тема /ru/forum/562265

... до jquery-1.4.3, кажется, или до jquery-1.4.4

Yuji, есть ли статика? сколько файлов всего?

Всего: 2055