Bug 465524 - SQUID_SIZE calculation in configure-proxy.sh is wrong
SQUID_SIZE calculation in configure-proxy.sh is wrong
Product: Spacewalk
Classification: Community
Component: Proxy Server (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Miroslav Suchý
Red Hat Satellite QA List
Depends On:
Blocks: space05
  Show dependency treegraph
Reported: 2008-10-03 14:11 EDT by Rob James
Modified: 2009-09-17 03:08 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2009-09-17 03:08:22 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Rob James 2008-10-03 14:11:16 EDT
There's a line in configure-proxy.sh to set the maximum disk cache size to 60% disk size:

SQUID_SIZE=$(( `df -P /var/spool/squid |tail -n1 | awk '{print $4 }'` / 100 * 6 ))

but this should really be:

SQUID_SIZE=$(( `df -P /var/spool/squid |tail -n1 | awk '{print $4 }'` / 10240 * 6 ))

it may well also be wise to set a maximum value too since the squid cache is probably never going to fill over say 50GB anyway. If the user really finds they need a bigger than 50GB cache they can always edit squid.conf later.
Comment 1 Miroslav Suchý 2008-10-07 09:19:35 EDT
Hmm yes and no. The formula is wrong. 100 * 6 means 6% and it should be 60 %. Correct formula should be then 100 * 60.
Commited as a72034907565c306a416e318d34b47d540c67f4a
How did you come to 10240?
Comment 2 Rob James 2008-10-07 11:56:44 EDT
The Squid cache size is in MB but the value you're getting from df is in kB.

Using your new calculation, with the ~27GB free I have here you end up with a result of 1662594 MB which isn't right :) Using my calculation you end up with 16236 MB (15GB). The / 10240 * 6 instead of / 1024 * 0.6 is to get around the fact we can't floating point maths in bash.
Comment 3 Miroslav Suchý 2008-10-07 12:35:41 EDT
Commited as 621e010d2d88558a2bcc65ee4e8a93950a302a6b.
Comment 4 Jesus M. Rodriguez 2009-04-14 10:11:35 EDT
Spacewalk 0.5 released.
Comment 5 Miroslav Suchý 2009-09-17 03:08:22 EDT
Spacewalk 0.5 has been released for long time ago.

Note You need to log in before you can comment on or make changes to this bug.