Quota Bug Again! Topic is solved
Quota Bug Again!
/bin/v-update-user-quota
Code: Select all
.
.
.
# Updating disk quota
quota=$(get_user_value '$DISK_QUOTA')
soft=$((quota * 1000))
hard=$((quota + 50000))
.
.
.
-
- Collaborator
- Posts: 783
- Joined: Mon May 11, 2015 8:43 am
- Contact:
- Os: CentOS 6x
- Web: apache + nginx
Re: Quota Bug Again!
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
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!
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.
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
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))
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
-
- Collaborator
- Posts: 783
- Joined: Mon May 11, 2015 8:43 am
- Contact:
- Os: CentOS 6x
- Web: apache + nginx
Re: Quota Bug Again!
Thank you for the explanation!
Re: Quota Bug Again!
SCelik, thanks man!
We're have same rquest to fix quotas - https://bugs.vestacp.com/responses/kvoty-diskovye
In progress now. Thanks again! ;-)
We're have same rquest to fix quotas - https://bugs.vestacp.com/responses/kvoty-diskovye
In progress now. Thanks again! ;-)
Re: Quota Bug Again!
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.
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!
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: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?
Yeah, it's pretty logical commit: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.
https://github.com/SCelik/vesta/commit/ ... 2763e6a1fd