LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 08-12-2015, 07:29 AM   #1
kikinovak
MLED Founder
 
Registered: Jun 2011
Location: Montpezat (South France)
Distribution: CentOS, OpenSUSE
Posts: 3,453

Rep: Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154
Squid cache and file size


Hi,

I'm currently doing some maintenance in a network with Slackware64 14.1 on the server and Slackware 14.1 on all desktop clients. Among other things, the server is running Squid as caching and filtering proxy. The cache is configured to only use the server's RAM (maximum 1 GB) without writing anything to disk.

The Internet connection is not very fast here. When I'm running slackpkg upgrade-all on several desktop clients, some packages seem to be kept in Squid's cache, judging from the very fast download speed. On the other hand, bigger packages don't seem to be kept in the cache and are re-downloaded from the package mirror.

Is there a way to configure Squid so it also keeps bigger files in the cache? Here's my local server's squid.conf file:

Code:
# /etc/squid/squid.conf

# Nom d'hôte du serveur Squid
visible_hostname niklabox.scholae.lan

# Définitions
acl localnet src 192.168.2.0/24 # Réseau local
acl SSL_ports port 443
acl Safe_ports port 80          # http
acl Safe_ports port 21          # ftp
acl Safe_ports port 443         # https
acl Safe_ports port 70          # gopher
acl Safe_ports port 210         # wais
acl Safe_ports port 1025-65535  # unregistered ports
acl Safe_ports port 280         # http-mgmt
acl Safe_ports port 488         # gss-http
acl Safe_ports port 591         # filemaker
acl Safe_ports port 777         # multiling http
acl CONNECT method CONNECT

# Règles d'accès
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access allow localhost manager
http_access deny manager
http_access allow localnet
http_access allow localhost
http_access deny all

# Port du proxy
http_port 3128 transparent

# Taille du cache dans la RAM
cache_mem 1024 MB

# Emplacement et taille du cache sur le disque
# cache_dir ufs /var/cache/squid 256 16 256
# cache_dir ufs /var/cache/squid 4096 16 256

# Fichier PID
pid_filename /var/run/squid/squid.pid

# Vidage système
coredump_dir /var/log/squid/cache/squid

# Durée de vie des fichiers sans date d'expiration
refresh_pattern ^ftp:           1440    20%     10080
refresh_pattern ^gopher:        1440    0%      1440
refresh_pattern -i (/cgi-bin/|\?) 0     0%      0
refresh_pattern .               0       20%     4320

# SquidGuard
url_rewrite_program /usr/bin/squidGuard -c /etc/squidguard/squidguard.conf
url_rewrite_children 5
Cheers,

Niki
 
Old 08-12-2015, 07:43 AM   #2
Mark Pettit
Member
 
Registered: Dec 2008
Location: Cape Town, South Africa
Distribution: Slackware 15.0
Posts: 619

Rep: Reputation: 299Reputation: 299Reputation: 299
At the risk of insulting your intelligence (and I know you're a smart fellow ...:-), why are you only you using a memory cache ? Surely the solution is to use a disk cache of (say ) 10 GB !
 
Old 08-12-2015, 07:55 AM   #3
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,849

Rep: Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309
squid config processing is a bit buggy (or at least I found it annoying), hard to configure cache sizes.
see cache_mem, maximum_object_size_in_memory and other size related config parameters (like cache_dir, maximum_object_size).
 
1 members found this post helpful.
Old 08-12-2015, 10:33 AM   #4
kikinovak
MLED Founder
 
Registered: Jun 2011
Location: Montpezat (South France)
Distribution: CentOS, OpenSUSE
Posts: 3,453

Original Poster
Rep: Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154
Quote:
Originally Posted by Mark Pettit View Post
At the risk of insulting your intelligence (and I know you're a smart fellow ...:-), why are you only you using a memory cache ? Surely the solution is to use a disk cache of (say ) 10 GB !
I'm doing this for two reasons.
  1. Cache operations to and from RAM are sensibly faster.
  2. With approximately 100 simultaneous user connections, disks would be working constantly, so this is to reduce disk operation.

Cheers,

Niki
 
Old 08-12-2015, 10:36 AM   #5
kikinovak
MLED Founder
 
Registered: Jun 2011
Location: Montpezat (South France)
Distribution: CentOS, OpenSUSE
Posts: 3,453

Original Poster
Rep: Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154
Quote:
Originally Posted by pan64 View Post
squid config processing is a bit buggy (or at least I found it annoying), hard to configure cache sizes.
see cache_mem, maximum_object_size_in_memory and other size related config parameters (like cache_dir, maximum_object_size).
These look like the parameters I have to edit. I'll give it a try tomorrow. Thanks!
 
  


Reply

Tags
squid



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Standard Squid Cache dir size allocation diablo046 Linux - Server 1 07-08-2014 11:37 AM
squid cache directory size amartlk Linux - Newbie 1 09-24-2013 09:01 AM
how to optimize performance of squid by cache size and refresh pattern ashpos Linux - Newbie 1 03-01-2013 10:50 PM
Squid cache size not increasing navinchotia Linux - Networking 1 06-03-2009 09:49 AM
Using Active directory Authentication of parent non-squid cache to child squid cache espiya7 Linux - Server 0 05-05-2009 08:04 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 07:11 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration