You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ftpserver-users@mina.apache.org by Nitish Bangera <ba...@gmail.com> on 2011/04/12 14:43:59 UTC

Custom Bandwidth Throttling

Apache mina supports throttling at the user level but how do we do it?

Re: Custom Bandwidth Throttling

Posted by Niklas Gustavsson <ni...@protocol7.com>.
On Mon, Apr 18, 2011 at 11:46 AM, Nitish Bangera
<ba...@gmail.com> wrote:
> Is it because of the check of authorites for that particular user are only done
> during the authorization and not during the session?

It's done for each transfer, check:
org.apache.ftpserver.impl.IODataConnection.transferFromClient(FtpSession,
OutputStream)
org.apache.ftpserver.impl.IODataConnection.transferToClient(FtpSession,
InputStream)

/niklas

Re: Custom Bandwidth Throttling

Posted by Nitish Bangera <ba...@gmail.com>.
I implemented a custom user class and set the upload and download rates for
the class. Then in the ftplet, when the required number of files were
uploaded say 10, on the 11th file i changed the upload rate in order to
throttle the upload for that particular user. This change is put in the list
of Authorities assigned to the user but this change is not reflected in the
FTPsession in use. The file gets uploaded with the initial upload rate. Is
it because of the check of authorites for that particular user are only done
during the authorization and not during the session?

On Wed, Apr 13, 2011 at 2:15 PM, Sachin Shetty <ss...@egnyte.com> wrote:

> Thanks a lot,  I guess we will take a look at that and update the list on
> our findings. Thanks once again!
>
> Thanks
> Sachin
>
> -----Original Message-----
> From: Niklas Gustavsson [mailto:niklas@protocol7.com]
> Sent: Wednesday, April 13, 2011 1:47 PM
> To: ftpserver-users@mina.apache.org
> Subject: Re: Custom Bandwidth Throttling
>
> On Wed, Apr 13, 2011 at 10:13 AM, Sachin Shetty <ss...@egnyte.com>
> wrote:
> > How about throttling on the fly based on some events, for e.g. a user has
> > already uploaded ten files in the current ftp session and we want to slow
> > him down on the 11th file onwards? Can we get that work in Apache ftp
> > server.
>
> This is not supported out of the box, but you can use the APi and
> implement your own User class to handle this case.
>
> /niklas
>
>


-- 
Regards,
Nitish S. Bangera

RE: Custom Bandwidth Throttling

Posted by Sachin Shetty <ss...@egnyte.com>.
Thanks a lot,  I guess we will take a look at that and update the list on
our findings. Thanks once again!

Thanks
Sachin

-----Original Message-----
From: Niklas Gustavsson [mailto:niklas@protocol7.com] 
Sent: Wednesday, April 13, 2011 1:47 PM
To: ftpserver-users@mina.apache.org
Subject: Re: Custom Bandwidth Throttling

On Wed, Apr 13, 2011 at 10:13 AM, Sachin Shetty <ss...@egnyte.com> wrote:
> How about throttling on the fly based on some events, for e.g. a user has
> already uploaded ten files in the current ftp session and we want to slow
> him down on the 11th file onwards? Can we get that work in Apache ftp
> server.

This is not supported out of the box, but you can use the APi and
implement your own User class to handle this case.

/niklas


Re: Custom Bandwidth Throttling

Posted by Niklas Gustavsson <ni...@protocol7.com>.
On Wed, Apr 13, 2011 at 10:13 AM, Sachin Shetty <ss...@egnyte.com> wrote:
> How about throttling on the fly based on some events, for e.g. a user has
> already uploaded ten files in the current ftp session and we want to slow
> him down on the 11th file onwards? Can we get that work in Apache ftp
> server.

This is not supported out of the box, but you can use the APi and
implement your own User class to handle this case.

/niklas

RE: Custom Bandwidth Throttling

Posted by Sachin Shetty <ss...@egnyte.com>.
Hi Niklas,

Thanks, this is good info.

How about throttling on the fly based on some events, for e.g. a user has
already uploaded ten files in the current ftp session and we want to slow
him down on the 11th file onwards? Can we get that work in Apache ftp
server.

Setting the throttling levels at login is too early for us to decide it we
want to throttle the user or not.

Thanks
Sachin
-----Original Message-----
From: Niklas Gustavsson [mailto:niklas@protocol7.com] 
Sent: Wednesday, April 13, 2011 1:23 PM
To: Nitish Bangera; ftpserver-users@mina.apache.org
Subject: Re: Custom Bandwidth Throttling

On Tue, Apr 12, 2011 at 4:26 PM, Nitish Bangera
<ba...@gmail.com> wrote:
> Yes i am talking about the ftpserver. As the ftpserver uses the mina in
the
> backend so i addressed mina to be supporting throttling.

Cool, then we know the context. FtpServer supports bandwidth
throttling of data transfers, not control connections. Data transfers
are not done using MINA (control connections uses MINA) and thus,
throttling is not done using MINA.

Back to the question: if using the file base user manager, you
configure the upload/download transfer rates as:
ftpserver.user.<username>.uploadrate=123
ftpserver.user.<username>.downloadrate=123

123 is in bytes per second. Our documentation in this area is lacking,
but you can find the documentation in the Javadocs for
PropertiesUserManager.

/niklas


Re: Custom Bandwidth Throttling

Posted by Niklas Gustavsson <ni...@protocol7.com>.
On Tue, Apr 12, 2011 at 4:26 PM, Nitish Bangera
<ba...@gmail.com> wrote:
> Yes i am talking about the ftpserver. As the ftpserver uses the mina in the
> backend so i addressed mina to be supporting throttling.

Cool, then we know the context. FtpServer supports bandwidth
throttling of data transfers, not control connections. Data transfers
are not done using MINA (control connections uses MINA) and thus,
throttling is not done using MINA.

Back to the question: if using the file base user manager, you
configure the upload/download transfer rates as:
ftpserver.user.<username>.uploadrate=123
ftpserver.user.<username>.downloadrate=123

123 is in bytes per second. Our documentation in this area is lacking,
but you can find the documentation in the Javadocs for
PropertiesUserManager.

/niklas

Re: Custom Bandwidth Throttling

Posted by Niklas Gustavsson <ni...@protocol7.com>.
On Tue, Apr 12, 2011 at 2:43 PM, Nitish Bangera
<ba...@gmail.com> wrote:
> Apache mina supports throttling at the user level but how do we do it?

Assuming your talking about FtpServer since you're sending this email
to the FtpServer users list? If not, please send this email to
users@mina.apache.org.

/niklas