Vesta Control Panel - Forum

Community Forum

Skip to content

Advanced search
  • Quick links
    • Main site
    • Github repo
    • Google Search
  • FAQ
  • Login
  • Register
  • Board index Main Section General Discussion
  • Search

Quota Bug Again! Topic is solved

General questions about VestaCP
Post Reply
  • Print view
Advanced search
7 posts • Page 1 of 1
SCelik

Quota Bug Again!
  • Quote

Post by SCelik » Fri Oct 02, 2015 7:47 pm

/bin/v-update-user-quota

Code: Select all

.
.
.
# Updating disk quota
quota=$(get_user_value '$DISK_QUOTA')
soft=$((quota * 1000))
hard=$((quota + 50000))
.
.
.
This calculation is wrong. Hard quota must be soft + 50000 not quota + 50000
Top

tjebbeke
Collaborator
Posts: 783
Joined: Mon May 11, 2015 8:43 am
Contact:
Contact tjebbeke
Website

Os: CentOS 6x
Web: apache + nginx
Re: Quota Bug Again!
  • Quote

Post by tjebbeke » Fri Oct 02, 2015 10:11 pm

Why don't you fix it yourself? You can create a pull request.
I don't think it's wrong now. The variable has simply changed its name.
https://github.com/serghey-rodin/vesta/ ... 24142d1b67
Top

SCelik

Re: Quota Bug Again!
  • Quote

Post by SCelik » Fri Oct 02, 2015 11:41 pm

I fixed it on my server ofcourse.

It is still wrong in vesta's repo. How do i know? Becouse i couldn't upload a tiny file to my server becouse of hardlimit. :)

Let's think about code on vesta repo.

Code: Select all

-soft=$(get_user_value '$DISK_QUOTA')
-soft=$((soft * 1000))
-hard=$((soft + 50000))
+quota=$(get_user_value '$DISK_QUOTA')
+soft=$((quota * 1000))
+hard=$((quota + 50000))
DISK_QUOTA = 100 MB (For example)

New quota variable set to 100,
Then soft is set to 100 * 1000 = 100.000
then hard is set to 100 + 50000 = 50.100

So, your soft quota becomes 100.000, but your hard quoata is set to 50.100.

https://github.com/serghey-rodin/vesta/pull/453
Top

tjebbeke
Collaborator
Posts: 783
Joined: Mon May 11, 2015 8:43 am
Contact:
Contact tjebbeke
Website

Os: CentOS 6x
Web: apache + nginx
Re: Quota Bug Again!
  • Quote

Post by tjebbeke » Sat Oct 03, 2015 9:07 am

Thank you for the explanation!
Top

skurudo
VestaCP Team
Posts: 8099
Joined: Fri Dec 26, 2014 2:23 pm
Contact:
Contact skurudo
Website Facebook Google+ Skype
Twitter

Re: Quota Bug Again!
  • Quote

Post by skurudo » Fri Oct 09, 2015 5:31 pm

SCelik, thanks man!
We're have same rquest to fix quotas - https://bugs.vestacp.com/responses/kvoty-diskovye
In progress now. Thanks again! ;-)
Top

SCelik

Re: Quota Bug Again!
  • Quote

Post by SCelik » Fri Oct 09, 2015 7:23 pm

You're welcome skurudo, but i wonder why developrs calculating quotas with multipling by 1000?

1MB != 1000KB != 1000000B

My customers complains about this. If i set 10GB disk quota to my customer, he can just use 9,31GB actually.

So i edited v-update-user-quota file, but in next update it will be overrided.

Can not it be standart to use multiples of 1024 for quota calculations on Vesta?

I send another pull request. This time, disk qouta calculated with real values (x1024). And i've set hard quota to more than 10% of soft quota. Becouse this is more meaningfull with big values or very small values.

But in my opinion, the best way to manage quotas; soft quota must be 90% percent of hard quoata (and hard quote must be equal to package value). Becouse we promises to our users that x much of disk space. When they reach soft value, there can be warning. After reaching hard quota we keep our promises and, user can not write any extra bytes to disk.
Top

skurudo
VestaCP Team
Posts: 8099
Joined: Fri Dec 26, 2014 2:23 pm
Contact:
Contact skurudo
Website Facebook Google+ Skype
Twitter

Re: Quota Bug Again!
  • Quote

Post by skurudo » Sun Oct 11, 2015 6:56 pm

SCelik wrote:You're welcome skurudo, but i wonder why developrs calculating quotas with multipling by 1000?
Can not it be standart to use multiples of 1024 for quota calculations on Vesta?
I said about it imperio, I think it's right to calculate quotas that way. Dunno, why devs make this in wrong way ;(
SCelik wrote:I send another pull request. This time, disk qouta calculated with real values (x1024). And i've set hard quota to more than 10% of soft quota. Becouse this is more meaningfull with big values or very small values.
Yeah, it's pretty logical commit:
https://github.com/SCelik/vesta/commit/ ... 2763e6a1fd
Top


Post Reply
  • Print view

7 posts • Page 1 of 1

Return to “General Discussion”



  • Board index
  • All times are UTC
  • Delete all board cookies
  • The team
Powered by phpBB® Forum Software © phpBB Limited
*Original Author: Brad Veryard
*Updated to 3.2 by MannixMD
 

 

cron

Login  •  Register

I forgot my password