ограничение скорости profto

Проблемы установки, настройки и работы Правильной Операционной Системы

Модератор: terminus

Правила форума
Убедительная просьба юзать теги [cоde] при оформлении листингов.
Сообщения не оформленные должным образом имеют все шансы быть незамеченными.
Аватара пользователя
ProFTP
подполковник
Сообщения: 3388
Зарегистрирован: 2008-04-13 1:50:04
Откуда: %&й
Контактная информация:

ограничение скорости profto

Непрочитанное сообщение ProFTP » 2008-05-18 10:30:11

не получаеться ограничить скорсть, точнее оганичивается, но сразу, когда копируеться файлы все клиенты пишут что не возможно определить время завершение, и копирование просто "замирает"... копирование не возможно бред какой-то...

http://www.proftpd.org/docs/directives/ ... rRate.html

тут написано
TransferRate
Name
TransferRate -- Configure upload, download transfer rates
Synopsis

TransferRate [ cmds] [ kilobytes-per-sec[:free-bytes]] [ ["user"|"group"|"class" expression]]

Default

None

Context

server config, <VirtualHost>, <Global>, <Anonymous>, <Directory>, .ftpaccess

Module

mod_xfer

Compatibility

1.2.8rc1 and later

Description

The TransferRate directive is used to set transfer rates limits on the transfer of data. This directive allows for transfer rates to be set in a wide variety of contexts, on a per-command basis, and for certain subsets of users. Note that this limit only applies to a single connection, and not to the overall transfer rate of the server.

The cmds parameter may be an comma-separated list of any of the following commands: APPE, RETR, STOR, and STOU.

The kilobytes-per-sec parameter is the actual transfer rate to be applied.

The free-bytes parameter, if configured, allows that many bytes to be transferred before the rate controls are applied. This allows for clients transferring small files to be unthrottled, but for larger files, such as MP3s and ISO images, to be throttled.

The optional parameters are used to restrict the application of the rate controls only to specific users. If the "user" restriction is given, then expression is a user-expression specifying to which users the rate applies. Similarly for the "group" restriction. For the "class" restriction, the expression is simply the name of connection class for whom the rate will apply.
Examples

# Limit downloads for everyone except the special group of users TransferRate RETR 1.5 group !special-users

# Limit uploads (and appends!) to the prolific users in the # lotsofuploadfiles.net domain. This presumes that a Class has been defined # for that domain, and that that Class has been named "uploaders". Let them # upload small files without throttling, though. TransferRate APPE,STOR 8.0:1024 class uploaders

TransferRate RETR,STOR,APPE 20
добавил - не работает! пробовал по разному тоже самое

кто как делал?

вот конфиг
все остальное работает!

Код: Выделить всё

# ?????? proftpd - 2006-02-19

#TCPServiceName my
#TCPAccessFiles /etc/host.allow /etc/my.deny

# ??? ??????? - ???????????? ????????????? ????????
ServerName              "Main FTP servant :)"
#ServerName thedj.org.ua
# ??? ??????? (???? ?? ??? ?????? ???????, ? ??? ??? ???????,
# standalone/inetd - ??? ??? ????? inetd)

ServerType              standalone

DefaultTransferMode binary

#ServerType              inetd
# ????? ????????? ????????? ?????: ???? ?????? ??????????? ?? ?? ???
# ? ?? IP ??? ?? ??????????? ????, ?? ????????? ? ???????, ?? ???
# ????????? ? `off` ?? ??????? ?????, ???? ?? ??????????? `on` ??
# ?? ????? ???????? `???????? ??-?????????`
#DefaultServer           off
DefaultServer on
# e-mail ?????????????? (?? ???? ??? ??????? ???????????? ??? ?????
# ????????? ?????? - ?? ? ????? ???? ?????? ??? ?????????? ?
# ???????????? ???????)
ServerAdmin             rtyug@ukr.net
# ????? ??? ???????? ???? ? ???????
ScoreboardFile         /var/run/proftpd.scoreboard

AllowFilter ^[-A-Za-z0-9_\.(),/]*$ # ?? ?????? ?????? ;)

AllowForeignAddress off # ????????? ????????? ??????-??????

# ???? ?? ??????? ???????? ??????
PassivePorts 49151 65535
Port                    21
#PassivePorts 1024 65535 


AllowOverride off # ????????? ????????????? .ftpaccess

MaxClientsPerHost 2
MaxClients 20
#MaxClientsPerUser 
#MaxConnectionRate 50000


#TCPAccessFiles /etc/hostsftp

# ????? ? ??????? ????????? ????? ????? (?? ?????? ????? - ????? ??????????
# ?? ????? ????????, ????? ??? ????????? ?? 777 - ?.?. ? ????? ?????? ?????????
# ????? 755)
Umask                   027

# tcpReceiveWindow ???? (32192)
# tcpSendWindow ???? (32192)

#RequireValidShell no # ?? ????, ??????? ?????? ? ftp, ????? shell

# ???????????? ????? `?????` (???????? ?????? ? standalohe ??????)
# ?????????? ??? ?????? ?? ???? ???? `????? ? ????????????` ?? ?
# ?? ?????????? ??????? ??????? :)
MaxInstances            50

# ???? ?? ???????? ???????? ??????
User                    ftp
# ??????, ??? ??????? ???????? ??????
Group                  ftp


# ??? ??????????? (?? ????? ???? - ? ????? ???? ????????
# ?????? ? ?? - ? ?????? ?????? - ???????? ???????)
SQLAuthTypes            Plaintext
# ???? ? ??? ??????????????? - on - ???? ? ??? :)
# ?? - ???? ????????? `on` ?? ?? ??????? ? ?? ?? ????????.
# ??? ?????? ???????. ?????? ???????? `users`
SQLAuthenticate         users
# ???? ??? ?????????? ? MySQL ????????:
# ???_????_??????@????_???_MySQL:???? ???_???????????? ??????
SQLConnectInfo          ftp@localhost:3306 ftp пароль
# ? ????? ??????? ?????? ???? ?????? - ?????? ????, ???
# ??? ???????, ??? ????? ????????????
SQLUserInfo             `users_table` `username` `password` `uid` `gid` \
                        `homedir` `shell`
# ?????? ?? ???? ? ????? (??? ????, ????? ?? ??? ???????????),
# `????????` shell ????????? ? /etc/shells
RequireValidShell off
# ??? ???? ?????? ? SQL
SQLLogFile      /var/log/proftpd.log

# ??? ??? ??? ?????? ???????? ? ??????? ????? ?? ??? ?
# ?? MySQL ?????? ??????????? ?? ?????? ??????? :)
# ?????????? ??????? ?????? ? ??. ????? ????? ????? - ???????
# ?????????? ?????, ? ????????? ??? ?? ?????? ?????????
SQLLog          PASS            counter_login
SQLNamedQuery   counter_login   UPDATE "`last_login`=UNIX_TIMESTAMP(), \
                                `login_count`=`login_count`+1 WHERE \
                                `username`='%u'" `users_table`
# ????? ????????? ?????? ? ??
SQLLog          ERR_PASS        counter_err
SQLNamedQuery   counter_err     UPDATE "`last_err_login`=UNIX_TIMESTAMP(), \
                                `err_login_count`=`err_login_count`+1 WHERE \
                                `username`='%U'" `users_table`

# ???????? ??? ????????? ? ?????? ? ???????:
# ??????????
# %u - ??? ???????????? (? ??????? ???????????)
# %f - ?????? ???? ? ??? ????? ??????? ??? ??????
# %b - ????? ????, ??????? ???? ???????
# %h - ??? ??????? (?? DNS), ???? ?? ??????? ????????? - IP
# %a - IP-????? ???????
# %m - ??? ??????? ?????????? ?? ??????? (RETR/STOR)
# %T - ????? (??????) ??????? ?? ???????? ????? ???????

SQLLog          RETR,STOR               log_story_transfer
SQLNamedQuery   log_story_transfer      INSERT "'',\
                                        UNIX_TIMESTAMP(),'%u',\
                                        '%f', '%b', '%h', \
                                        '%a', '%m', '%T'" \
                                         `xfer_table`
# ?????????? ?????? ??? ?????????? ? ?????? ??????
# (? ???? ?????? ?? ?????? - ?? ???????? ? ? ????? ???? :))
SQLLOG          ERR_RETR,ERR_STOR,ERR_DELE,ERR_RMD,ERR_RNTO\
                                        log_err_modify
SQLNamedQuery   log_err_modify          INSERT "'',\
                                        UNIX_TIMESTAMP(),\
                                        '%u', '%f', '%h', \
                                        '%a', '%m'" `xfer_errors`

# ???? ??????? ????????, ???? ???????? ??? ???????????
# (? ?????? ???????????? ???????? `????????????` ?? 10-20 ??????)
# ?? ???????????????? ????????? ??? ??????
##
UseReverseDNS     off
##
IdentLookups      off


#UseReverseDNS     on
##
#IdentLookups      on





#HideNoAccess on
# HideUser uid
#IgnoreHidden on


# MaxClients 15 "??????? ????? ?????????? ? ????????"
# MaxClientsPerHost 4 "%m ??????? ??? ?????????? ? ?????? ?????, ??????  ?? ?????????"
# MaxLoginAttempts 3 "??????? ????? ??????? ?????"

#???????? ?????????? ? ????? ip ?????????? ????????? ??? ?????????
#UseHostsAllowFile /etc/proftpd.allow
#UseHostsDenyFile /etc/proftpd.deny



#PersistentPasswd on | off 

# Bind IP-????? (??????? ???????? - ???????? ??????, VirtualHost)

#Bind thedj.org.ua

## DefaultAddress IP-????? (??????? ???????? - ???????? ??????)

DefaultAddress 193.201.81.18

#TransferRate 5 ftp !root

# ???? ???? ????? ??? ???????????? ?? ftp ???? ???????????
# ????? ???????? ???????????, ?? ???? ?????????????????
# ????????? ??????:
DefaultRoot            ~
# ? ???? ?????? ??????? - ???? ? ???????? ???????? ?? ????? ???????
# ? ????????? ??`chroot`??. ????, ????????, ???? ????? ????????????
# ????? ?? ??????? ???????? ? ?????????? ???, ?? ???? ??????? !users
# ????? ????? ??????? ???????????? ??????.
#DefaultRoot             ~       !lissyara

PersistentPasswd off # (??????? ?? ????????? ????? /etc/passwd ? /etc/group ?? ????? ?????? proftpd, ??????? chroot)

#56780c

MaxLoginAttempts 2
# ??????????
<Directory ~>
#RequireValidShell       off


#TransferRate    RETR    1.5
#TransferRate    APPE,STOR  8.0


#TransferRate RETR,STOR,APPE 20 

TransferRate RETR,STOR 100 ~



AllowOverwrite          on
AllowOverride off 

<Limit Write>
#TransferRate    RETR    5
#TransferRate    STOR    5


AllowAll
</Limit>
<Limit READ>
#TransferRate    RETR    5
#TransferRate    STOR    5

AllowAll
</Limit>
</Directory>
Pеrl FAQ
perl -e 'print join"",map $$_[rand@$_],([0..9,'a'..'z','A'..'Z'])x30'
ИзображениеИзображение

Хостинговая компания Host-Food.ru
Хостинг HostFood.ru
 

Услуги хостинговой компании Host-Food.ru

Хостинг HostFood.ru

Тарифы на хостинг в России, от 12 рублей: https://www.host-food.ru/tariffs/hosting/
Тарифы на виртуальные сервера (VPS/VDS/KVM) в РФ, от 189 руб.: https://www.host-food.ru/tariffs/virtualny-server-vps/
Выделенные сервера, Россия, Москва, от 2000 рублей (HP Proliant G5, Intel Xeon E5430 (2.66GHz, Quad-Core, 12Mb), 8Gb RAM, 2x300Gb SAS HDD, P400i, 512Mb, BBU):
https://www.host-food.ru/tariffs/vydelennyi-server-ds/
Недорогие домены в популярных зонах: https://www.host-food.ru/domains/

Gnix
мл. сержант
Сообщения: 127
Зарегистрирован: 2008-03-21 2:50:24
Откуда: Ukraine, Kiev
Контактная информация:

Re: ограничение скорости profto

Непрочитанное сообщение Gnix » 2008-05-18 12:34:47

странно - в моем самом простом конфиге proftpd работает ограничение на скачивание для анонимных пользователей ~ 1 Мб/с :)

дабавлял в раздел анонимусов:

Код: Выделить всё

TransferRate    RETR    1000
TransferRate    STOR    5000
http://www.opennet.ru/openforum/vsluhfo ... 71278.html

proftpd.conf

Код: Выделить всё

ServerName "ip"
ServerType standalone
DefaultServer on
Umask 022
ServerAdmin support@microsoft.com
IdentLookups off
UseReverseDNS off
Port 21
PassivePorts 49152 65534
TimesGMT off
MaxInstances 30
MaxLoginAttempts 100
TimeoutLogin 3000
TimeoutNoTransfer 1200
TimeoutIdle 1200
User nobody
Group nogroup
DefaultTransferMode binary
AllowForeignAddress on
AllowRetrieveRestart on
AllowStoreRestart on
DeleteAbortedStores off
SystemLog /var/log/secure.log
TransferLog /var/log/proftpd-tranfer.log
LogFormat xfer_fmt "%t %u %f"
<IfModule mod_tls.c>
TLSEngine off
TLSRequired off
TLSVerifyClient off
TLSProtocol TLSv1
TLSLog /var/log/proftpd_tls.log
</IfModule>

<Anonymous /var/ftp>
User ftp
Group ftp
TransferRate    RETR    1000
TransferRate    STOR    5000
AnonRequirePassword off
UserAlias anonymous ftp
MaxClients 8 "The server is full, hosting %m users"
DisplayLogin welcome.msg
UserRatio anonymous 0 0 0 0
<Limit LOGIN>
Allow from 194.187.48.,194.187.49.,194.187.50.,194.187.51.,91.200.221.
Deny from all
</Limit>
<Limit LIST NLST  RETR  PWD XPWD  SIZE  STAT  CWD XCWD  CDUP XCUP >
 AllowAll
</Limit>
<Limit STOR STOU  APPE  RNFR RNTO  DELE  MKD XMKD SITE_MKDIR  RMD XRMD SITE_RMDIR  SITE  SITE_CHMOD  SITE_CHGRP  MTDM >
 DenyAll
</Limit>
<Directory /var/ftp/incoming>
AllowOverwrite on
<Limit LIST NLST  STOR STOU  APPE  RETR  RNFR RNTO  DELE  MKD XMKD SITE_MKDIR  RMD XRMD SITE_RMDIR  SITE  MTDM  PWD XPWD  SIZE  STAT  CWD XCWD  CDUP XCUP >
 AllowAll
</Limit>
<Limit SITE_CHMOD  SITE_CHGRP >
 DenyAll
</Limit>
</Directory>
</Anonymous>

Аватара пользователя
ProFTP
подполковник
Сообщения: 3388
Зарегистрирован: 2008-04-13 1:50:04
Откуда: %&й
Контактная информация:

Re: ограничение скорости profto

Непрочитанное сообщение ProFTP » 2008-05-18 12:56:05

А какая версия?

я кстате хотел на закакачку ограничениепробовал - глюк всегда...
Pеrl FAQ
perl -e 'print join"",map $$_[rand@$_],([0..9,'a'..'z','A'..'Z'])x30'
ИзображениеИзображение

Gnix
мл. сержант
Сообщения: 127
Зарегистрирован: 2008-03-21 2:50:24
Откуда: Ukraine, Kiev
Контактная информация:

Re: ограничение скорости profto

Непрочитанное сообщение Gnix » 2008-05-18 13:16:27

А какая версия?
proftpd-1.3.1_4

Аватара пользователя
ProFTP
подполковник
Сообщения: 3388
Зарегистрирован: 2008-04-13 1:50:04
Откуда: %&й
Контактная информация:

Re: ограничение скорости profto

Непрочитанное сообщение ProFTP » 2008-05-18 13:17:57

proftpd -v
- ProFTPD Version 1.3.1

:cry:
Pеrl FAQ
perl -e 'print join"",map $$_[rand@$_],([0..9,'a'..'z','A'..'Z'])x30'
ИзображениеИзображение