In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
Squid cache
Proxy servers cache on local hard disks to improve network efficiency
1 Modify squid configuration file "/etc/squid/squid.conf", parameter "cache_dir_ufs" is to set cache directory
[root@localhost wj]# gedit /etc/squid/squid.conf
# Uncomment and adjust the following to add a disk cache directory.
cache_dir ufs /var/spool/squid 100 16 256 //cache directory var/spool/squid, size 100M
2. Restart squid service
[root@localhost wj]# service squid start
Starting squid: . [OK]
[root@localhost wj]# gedit /etc/squid/squid.conf
[root@localhost wj]# service squid restart
Stop squid: 2018/08/15 11:17:31| WARNING cache_mem is larger than total disk cache space!
................ [OK]
init_cache_dir /var/spool/squid... Starting squid: . [OK]
[root@localhost wj]#
3. Check the squid cache directory, where swap.state will gradually increase with the number of web pages visited.
[root@localhost wj]# ls -al /var/spool/squid/
Total consumption 76
drwxr-x--- 18 squid squid 4096 August 15 11:18 .
drwxr-xr-x. 15 root 4096 Aug 15 10:50..
drwxr-x--- 258 squid squid 4096 August 15 11:18 00
drwxr-x--- 258 squid squid 4096 August 15 11:18 01
drwxr-x--- 258 squid squid 4096 August 15 11:18 02
drwxr-x--- 258 squid squid 4096 August 15 11:18 03
drwxr-x--- 258 squid squid 4096 August 15 11:18 04
drwxr-x--- 258 squid squid 4096 August 15 11:18 05
drwxr-x--- 258 squid squid 4096 August 15 11:18 06
drwxr-x--- 258 squid squid 4096 August 15 11:18 07
drwxr-x--- 258 squid squid 4096 August 15 11:18 08
drwxr-x--- 258 squid squid 4096 August 15 11:18 09
drwxr-x--- 258 squid squid 4096 August 15 11:18 0A
drwxr-x--- 258 squid squid 4096 August 15 11:18 0B
drwxr-x--- 258 squid squid 4096 August 15 11:18 0C
drwxr-x--- 258 squid squid 4096 August 15 11:18 0D
drwxr-x--- 258 squid squid 4096 August 15 11:18 0E
drwxr-x--- 258 squid squid 4096 August 15 11:18 0F
-rw-r---- 1 squid squid 52 August 15 11:18 swap.state
[root@localhost wj]#
4. Clean up the cache regularly
Swap.state grows larger in the squid cache directory and the user needs to clear the file periodically, or do a scheduled task to clear it.
Made a Linux learning platform, currently out of a shape, you can refer to the use
Link: https://pan.baidu.com/s/1GOLVU2CbpBNGtunztVpaCQ Password: n7bk
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.