Bug 465524 - SQUID_SIZE calculation in configure-proxy.sh is wrong
Summary: SQUID_SIZE calculation in configure-proxy.sh is wrong
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Spacewalk
Classification: Community
Component: Proxy Server
Version: 0.3
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Miroslav Suchý
QA Contact: Red Hat Satellite QA List
URL:
Whiteboard:
Depends On:
Blocks: space05
TreeView+ depends on / blocked
 
Reported: 2008-10-03 18:11 UTC by Rob James
Modified: 2009-09-17 07:08 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-09-17 07:08:22 UTC
Embargoed:


Attachments (Terms of Use)

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.


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