Page 1 of 1
Quota Bug Again!
Posted: Fri Oct 02, 2015 7:47 pm
by SCelik
/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
Re: Quota Bug Again!
Posted: Fri Oct 02, 2015 10:11 pm
by tjebbeke
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
Re: Quota Bug Again!
Posted: Fri Oct 02, 2015 11:41 pm
by SCelik
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
Re: Quota Bug Again!
Posted: Sat Oct 03, 2015 9:07 am
by tjebbeke
Thank you for the explanation!
Re: Quota Bug Again!
Posted: Fri Oct 09, 2015 5:31 pm
by skurudo
SCelik, thanks man!
We're have same rquest to fix quotas -
https://bugs.vestacp.com/responses/kvoty-diskovye
In progress now. Thanks again! ;-)
Re: Quota Bug Again!
Posted: Fri Oct 09, 2015 7:23 pm
by SCelik
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.
Re: Quota Bug Again!
Posted: Sun Oct 11, 2015 6:56 pm
by skurudo
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