Home Database Mysql Tutorial 学习笔记-Squid基础

学习笔记-Squid基础

Jun 07, 2016 pm 03:11 PM
s acting Base study technology server notes cache

服务器代理缓存技术:Squid Squid 用一个单独,非模块,i/o驱动来处理客户请求,支持协议有:HTTP.FTP.SSL.WAIS 简单原理: 1.结构:若干磁盘==》若干分区==》若干目录 2.查询:请求==》hash table ==》 Digest table ==》 文件 Hash table:类似提纲 Digest

服务器代理缓存技术:Squid

 

Squid 用一个单独,非模块,i/o驱动来处理客户请求,支持协议有:HTTP.FTP.SSL.WAIS

 

简单原理:

 

1. 结构:若干磁盘==》若干分区==》若干目录

2. 查询:请求==》hash table ==》 Digest table ==》 文件

Hash table:类似提纲   Digest table:类似目录

3. 工作关系: child-parent 和 sibling

Sibling:邻居关系

 

<ol class="dp-sql">
<li class="alt"><span><span>常用命令:  </span></span></li>
<li>
<span>#/usr/</span><span class="keyword">local</span><span>/squid/sbin/squid -z // 初始化缓存空间  </span>
</li>
<li class="alt"><span>  Ps:有问题,常见是目录权限问题 chown –R squid:squid /cacheX  </span></li>
<li>
<span>#/usr/</span><span class="keyword">local</span><span>/squid/sbin/squid -k parse //检查squid.conf语法配置  </span>
</li>
<li class="alt">
<span>#/usr/</span><span class="keyword">local</span><span>/squid/sbin/squid -N -d1 //前台输出  </span>
</li>
<li>
<span>#/usr/</span><span class="keyword">local</span><span>/squid/sbin/squid –s //后台运行  </span>
</li>
<li class="alt">
<span>#/usr/</span><span class="keyword">local</span><span>/squid/sbin/squid -k shutdown //关闭服务  </span>
</li>
<li>
<span>#/usr/</span><span class="keyword">local</span><span>/squid/sbin/squid -k reconfigure // 载入新的配置文件  </span>
</li>
<li class="alt">
<span>#/usr/</span><span class="keyword">local</span><span>/squid/sbin/squid -k rotate 轮循日志  </span>
</li>
<li><span>把squid 添加到系统启动项  </span></li>
<li class="alt">
<span>编辑 /etc/rc.d/rc.</span><span class="keyword">local</span><span> </span>
</li>
<li>
<span>添加如下行: /usr/</span><span class="keyword">local</span><span>/squid/sbin/squid –s  </span>
</li>
<li class="alt"><span> </span></li>
<li>
<span>#more /usr/</span><span class="keyword">local</span><span>/squid/var/logs/access.log | grep TCP_MEM_HIT  </span>
</li>
<li class="alt"><span>该指令可以看到在squid 运行过程中,有哪些文件被squid 缓存到内存中,  </span></li>
<li><span>并返回给访问用户。  </span></li>
<li class="alt">
<span>#more /usr/</span><span class="keyword">local</span><span>/squid/var/logs/access.log | grep TCP_HIT  </span>
</li>
<li><span>该指令可以看到在squid 运行过程中,有哪些文件被squid 缓存到cache  </span></li>
<li class="alt"><span>目录中,并返回给访问用户。  </span></li>
<li>
<span>#more /usr/</span><span class="keyword">local</span><span>/squid/var/logs/access.log | grep TCP_MISS  </span>
</li>
<li class="alt"><span>该指令可以看到在squid 运行过程中,有那些文件没有被squid 缓存,而  </span></li>
<li><span>是向原始服务器获取数据并返回给访问用户。  </span></li>
<li class="alt"><span> </span></li>
<li><span>squid命中率分析  </span></li>
<li class="alt"><span>squid/bin/squidclient -p 80 mgr:info //一些运行状态信息  </span></li>
<li><span>squid/bin/squidclient -p 80 mgr:5min //5分钟信息  </span></li>
<li class="alt"><span>取得squid 内存使用情况:  </span></li>
<li><span>squidclient -p 80 mgr:mem  </span></li>
<li class="alt"><span>#取得squid 已经缓存的列表:  </span></li>
<li><span>#squidclient -p 80 mgr:objects  </span></li>
<li class="alt"><span>取得squid 的磁盘使用情况:  </span></li>
<li><span>squidclient -p 80 mgr:diskd  </span></li>
<li class="alt"><span>强制更新某个url :  </span></li>
<li>
<span>squidclient -p 80 -m PURGE http://www<font color="#000000">.xxxx</font>.com/  </span><span class="keyword">static</span><span>.php</span>
</li>
<li class="alt"><span>更多的请查看:  </span></li>
<li><span>squidclient-h 或者 squidclient -p 80 mgr:  </span></li>
<li class="alt"><span>查命中率:  </span></li>
<li>
<span>/usr/</span><span class="keyword">local</span><span>/squid/bin/squidclient -h 1.1.1.1 -p80 mgr:info  </span>
</li>
<li class="alt">
<span>/usr/</span><span class="keyword">local</span><span>/squid/bin/squidclient -h 具体的IP -p80 mgr:info  </span>
</li>
</ol>
Copy after login
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Roblox: Bubble Gum Simulator Infinity - How To Get And Use Royal Keys
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Nordhold: Fusion System, Explained
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Mandragora: Whispers Of The Witch Tree - How To Unlock The Grappling Hook
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Hot Topics

Java Tutorial
1666
14
PHP Tutorial
1273
29
C# Tutorial
1255
24
How to delete Xiaohongshu notes How to delete Xiaohongshu notes Mar 21, 2024 pm 08:12 PM

How to delete Xiaohongshu notes? Notes can be edited in the Xiaohongshu APP. Most users don’t know how to delete Xiaohongshu notes. Next, the editor brings users pictures and texts on how to delete Xiaohongshu notes. Tutorial, interested users come and take a look! Xiaohongshu usage tutorial How to delete Xiaohongshu notes 1. First open the Xiaohongshu APP and enter the main page, select [Me] in the lower right corner to enter the special area; 2. Then in the My area, click on the note page shown in the picture below , select the note you want to delete; 3. Enter the note page, click [three dots] in the upper right corner; 4. Finally, the function bar will expand at the bottom, click [Delete] to complete.

How to configure Dnsmasq as a DHCP relay server How to configure Dnsmasq as a DHCP relay server Mar 21, 2024 am 08:50 AM

The role of a DHCP relay is to forward received DHCP packets to another DHCP server on the network, even if the two servers are on different subnets. By using a DHCP relay, you can deploy a centralized DHCP server in the network center and use it to dynamically assign IP addresses to all network subnets/VLANs. Dnsmasq is a commonly used DNS and DHCP protocol server that can be configured as a DHCP relay server to help manage dynamic host configurations in the network. In this article, we will show you how to configure dnsmasq as a DHCP relay server. Content Topics: Network Topology Configuring Static IP Addresses on a DHCP Relay D on a Centralized DHCP Server

What should I do if the notes I posted on Xiaohongshu are missing? What's the reason why the notes it just sent can't be found? What should I do if the notes I posted on Xiaohongshu are missing? What's the reason why the notes it just sent can't be found? Mar 21, 2024 pm 09:30 PM

As a Xiaohongshu user, we have all encountered the situation where published notes suddenly disappeared, which is undoubtedly confusing and worrying. In this case, what should we do? This article will focus on the topic of &quot;What to do if the notes published by Xiaohongshu are missing&quot; and give you a detailed answer. 1. What should I do if the notes published by Xiaohongshu are missing? First, don't panic. If you find that your notes are missing, staying calm is key and don't panic. This may be caused by platform system failure or operational errors. Checking release records is easy. Just open the Xiaohongshu App and click &quot;Me&quot; → &quot;Publish&quot; → &quot;All Publications&quot; to view your own publishing records. Here you can easily find previously published notes. 3.Repost. If found

DualBEV: significantly surpassing BEVFormer and BEVDet4D, open the book! DualBEV: significantly surpassing BEVFormer and BEVDet4D, open the book! Mar 21, 2024 pm 05:21 PM

This paper explores the problem of accurately detecting objects from different viewing angles (such as perspective and bird's-eye view) in autonomous driving, especially how to effectively transform features from perspective (PV) to bird's-eye view (BEV) space. Transformation is implemented via the Visual Transformation (VT) module. Existing methods are broadly divided into two strategies: 2D to 3D and 3D to 2D conversion. 2D-to-3D methods improve dense 2D features by predicting depth probabilities, but the inherent uncertainty of depth predictions, especially in distant regions, may introduce inaccuracies. While 3D to 2D methods usually use 3D queries to sample 2D features and learn the attention weights of the correspondence between 3D and 2D features through a Transformer, which increases the computational and deployment time.

Review! Deep model fusion (LLM/basic model/federated learning/fine-tuning, etc.) Review! Deep model fusion (LLM/basic model/federated learning/fine-tuning, etc.) Apr 18, 2024 pm 09:43 PM

In September 23, the paper "DeepModelFusion:ASurvey" was published by the National University of Defense Technology, JD.com and Beijing Institute of Technology. Deep model fusion/merging is an emerging technology that combines the parameters or predictions of multiple deep learning models into a single model. It combines the capabilities of different models to compensate for the biases and errors of individual models for better performance. Deep model fusion on large-scale deep learning models (such as LLM and basic models) faces some challenges, including high computational cost, high-dimensional parameter space, interference between different heterogeneous models, etc. This article divides existing deep model fusion methods into four categories: (1) "Pattern connection", which connects solutions in the weight space through a loss-reducing path to obtain a better initial model fusion

More than just 3D Gaussian! Latest overview of state-of-the-art 3D reconstruction techniques More than just 3D Gaussian! Latest overview of state-of-the-art 3D reconstruction techniques Jun 02, 2024 pm 06:57 PM

Written above & The author’s personal understanding is that image-based 3D reconstruction is a challenging task that involves inferring the 3D shape of an object or scene from a set of input images. Learning-based methods have attracted attention for their ability to directly estimate 3D shapes. This review paper focuses on state-of-the-art 3D reconstruction techniques, including generating novel, unseen views. An overview of recent developments in Gaussian splash methods is provided, including input types, model structures, output representations, and training strategies. Unresolved challenges and future directions are also discussed. Given the rapid progress in this field and the numerous opportunities to enhance 3D reconstruction methods, a thorough examination of the algorithm seems crucial. Therefore, this study provides a comprehensive overview of recent advances in Gaussian scattering. (Swipe your thumb up

Equipped with AMD EPYC 4004 series processors, ASUS launches a variety of server and workstation products Equipped with AMD EPYC 4004 series processors, ASUS launches a variety of server and workstation products Jul 23, 2024 pm 09:34 PM

According to news from this website on July 23, ASUS has launched a variety of server and workstation-level products powered by AMD EPYC 4004 series processors. Note from this site: AMD launched the AM5 platform and Zen4 architecture EPYC 4004 series processors in May, offering up to 16-core 3DV-Cache specifications. ASUSProER100AB6 server ASUSProER100AB6 is a 1U rack server product equipped with EPYC Xiaolong 4004 series processor, suitable for the needs of IDC and small and medium-sized enterprises. ASUSExpertCenterProET500AB6 workstation ASUSExpertCenterProET500AB6 is a

Learn the main function in Go language from scratch Learn the main function in Go language from scratch Mar 27, 2024 pm 05:03 PM

Title: Learn the main function in Go language from scratch. As a simple and efficient programming language, Go language is favored by developers. In the Go language, the main function is an entry function, and every Go program must contain the main function as the entry point of the program. This article will introduce how to learn the main function in Go language from scratch and provide specific code examples. 1. First, we need to install the Go language development environment. You can go to the official website (https://golang.org

See all articles