MRatWork Forum by Mustafa Ramadhan

Sawo Project - Kloxo-MR Discussions => Kloxo-MR Technical Helps => Topic started by: Viking on 2013-02-16, 00:31:15

Title: Limiting bandwidth?
Post by: Viking on 2013-02-16, 00:31:15
How can the user or domain bandwidth. For example, to limit a user or domain specific bandwidth of 10GB/s to 5gb/s?
Title: Re: Limiting bandwidth?
Post by: MRatWork on 2013-02-16, 06:54:29
Only able per-user. Click 'Limit' on panel but better set when creating 'resource plan'.
Title: Re: Limiting bandwidth?
Post by: Viking on 2013-02-16, 21:17:06
Quote from: "MRatWork"
Only able per-user. Click 'Limit' on panel but better set when creating 'resource plan'.
Where is the option to limit the speed of the link because I can not find it?
Title: Re: Limiting bandwidth?
Post by: MRatWork on 2013-02-16, 21:36:20
No limit bandwidth but quota/month per-client.
Title: Re: Limiting bandwidth?
Post by: Viking on 2013-02-16, 22:25:05
Quote from: "MRatWork"
No limit bandwidth but quota/month per-client.
This is a monthly limit. I ask you to limit the speed of internet user (X MB/s).
(http://www.zimagez.com/miniature/przechwycenieobrazuekranu-16022013-172800.php) (http://www.zimagez.com/zimage/przechwycenieobrazuekranu-16022013-172800.php)
Title: Re: Limiting bandwidth?
Post by: MRatWork on 2013-02-16, 23:27:20
Quote from: "Viking"
Quote from: "MRatWork"
No limit bandwidth but quota/month per-client.
This is a monthly limit. I ask you to limit the speed of internet user (X MB/s).
(http://www.zimagez.com/miniature/przechwycenieobrazuekranu-16022013-172800.php) (http://www.zimagez.com/zimage/przechwycenieobrazuekranu-16022013-172800.php)
My question is how to limition speed?. Do you have information or link about it?.

It's more hard rather than limition vps by host because limition able detect/config via vps ips.
Title: Re: Limiting bandwidth?
Post by: Viking on 2013-02-16, 23:48:20
Quote from: "MRatWork"
Quote from: "Viking"
Quote from: "MRatWork"
No limit bandwidth but quota/month per-client.
This is a monthly limit. I ask you to limit the speed of internet user (X MB/s).
(http://www.zimagez.com/miniature/przechwycenieobrazuekranu-16022013-172800.php) (http://www.zimagez.com/zimage/przechwycenieobrazuekranu-16022013-172800.php)
My question is how to limition speed?. Do you have information or link about it?.

It's more hard rather than limition vps by host because limition able detect/config via vps ips.

OK. Here topics about what I'm asking:
http://forum.lxcenter.org/index.php?t=m ... #msg_32512 (http://forum.lxcenter.org/index.php?t=msg&goto=32512&&srch=connection+speed+limit#msg_32512)
http://forum.directadmin.com/showthread.php?t=45189 (http://forum.directadmin.com/showthread.php?t=45189)
Just as practically used in Kloxo-MR?
Now I understand what I'm asking?
Title: Re: Limiting bandwidth?
Post by: MRatWork on 2013-02-17, 01:03:36
Nginx have built-in bandwidth limitation. Read http://wiki.nginx.org/HttpLimitReqModule (http://wiki.nginx.org/HttpLimitReqModule)
Title: Re: Limiting bandwidth?
Post by: Viking on 2013-02-17, 01:50:32
Quote from: "MRatWork"
Nginx have built-in bandwidth limitation. Read http://wiki.nginx.org/HttpLimitReqModule (http://wiki.nginx.org/HttpLimitReqModule)
OK. I'll do the test. But how to use Kloxo-MR for 1 user or domain?
Where and how do I insert?
Title: Re: Limiting bandwidth?
Post by: MRatWork on 2013-02-17, 01:55:32
Modified custom.domains.conf.tpl inside /home/nginx/tpl.
Title: Re: Limiting bandwidth?
Post by: Viking on 2013-02-17, 02:16:25
Quote from: "MRatWork"
Modified custom.domains.conf.tpl inside /home/nginx/tpl.
I know nginx poorly so if you would write as correctly put it asked me to show you how.
Title: Re: Limiting bandwidth?
Post by: MRatWork on 2013-02-17, 07:41:46
Ok, you can try with:

1. Modified /home/nginx/etc/conf.d/custom.~lxcenter.conf:
Code: [Select]
...
    limit_conn_zone $binary_remote_addr zone=addr:10m;
...
to:
Code: [Select]
...
    limit_conn_zone $binary_remote_addr zone=addr:10m;
    limit_req_zone  $server_name  zone=one:10m rate=100r/s;
...

2. /home/nginx/tpl/custom.domains.conf.tpl
Code: [Select]
...
## web for '<?php echo $domainname?>'
server {
    listen <?php echo $ip?>:<?php echo $port?>;
<?php
        
if ($count !== 0) {
?>

...

to:

for limitation for domain 'level'
Code: [Select]
...
## web for '<?php echo $domainname?>'
server {
    listen <?php echo $ip?>:<?php echo $port?>;

<?php
    
if ($domainname === 'yourdomain.com') {
?>

    limit_req one;
<?php
    
}
?>

<?php
        
if ($count !== 0) {
?>

...

or:
for limitation for user 'level'
Code: [Select]
...
## web for '<?php echo $domainname?>'
server {
    listen <?php echo $ip?>:<?php echo $port?>;

<?php
    
if ($user === 'admin') {
?>

    limit_req one;
<?php
    
}
?>

<?php
        
if ($count !== 0) {
?>

...
Adjustment value of 'rate=100r/s' (permit 100 request/second) and 'yourdomain.com' (just example yourdomain.com is domain you want to limitation) or 'admin'.

Don't forget running 'sh /script/fixweb; service nginx restart' after that.
Title: Re: Limiting bandwidth?
Post by: Viking on 2013-02-17, 08:29:14
Quote from: "MRatWork"
Ok, you can try with:

1. Modified /home/nginx/etc/conf.d/custom.~lxcenter.conf:
Code: [Select]
...
    limit_conn_zone $binary_remote_addr zone=addr:10m;
...
to:
Code: [Select]
...
    limit_conn_zone $binary_remote_addr zone=addr:10m;
    limit_req_zone  $server_name  zone=one:10m rate=100r/s;
...

2. /home/nginx/tpl/custom.domains.conf.tpl
Code: [Select]
...
## web for '<?php echo $domainname?>'
server {
    listen <?php echo $ip?>:<?php echo $port?>;
<?php
        
if ($count !== 0) {
?>

...

to:

for limitation for domain 'level'
Code: [Select]
...
## web for '<?php echo $domainname?>'
server {
    listen <?php echo $ip?>:<?php echo $port?>;

<?php
    
if ($domainname === 'yourdomain.com') {
?>

    limit_req one;
<?php
    
}
?>

<?php
        
if ($count !== 0) {
?>

...

or:
for limitation for user 'level'
Code: [Select]
...
## web for '<?php echo $domainname?>'
server {
    listen <?php echo $ip?>:<?php echo $port?>;

<?php
    
if ($user === 'admin') {
?>

    limit_req one;
<?php
    
}
?>

<?php
        
if ($count !== 0) {
?>

...
Adjustment value of 'rate=100r/s' (permit 100 request/second) and 'yourdomain.com' (just example yourdomain.com is domain you want to limitation) or 'admin'.

Don't forget running 'sh /script/fixweb; service nginx restart' after that.
MRatWork thank you. For you can always count on and not revived anyone looking for somewhere to on other forums or in google like everyone else. How to check what you've written.