Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 465524

Summary: SQUID_SIZE calculation in configure-proxy.sh is wrong
Product: [Community] Spacewalk Reporter: Rob James <rssjames>
Component: Proxy ServerAssignee: Miroslav Suchý <msuchy>
Status: CLOSED CURRENTRELEASE QA Contact: Red Hat Satellite QA List <satqe-list>
Severity: medium Docs Contact:
Priority: medium    
Version: 0.3CC: jesusr
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-09-17 07:08:22 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 456553    

Description Rob James 2008-10-03 18:11:16 UTC
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 13:19:35 UTC
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 15:56:44 UTC
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 16:35:41 UTC
Commited as 621e010d2d88558a2bcc65ee4e8a93950a302a6b.

Comment 4 Jesus M. Rodriguez 2009-04-14 14:11:35 UTC
Spacewalk 0.5 released.

Comment 5 Miroslav Suchý 2009-09-17 07:08:22 UTC
Spacewalk 0.5 has been released for long time ago.