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

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
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)

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.

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

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

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.

How to install PHP FFmpeg extension on server? How to install PHP FFmpeg extension on server? Mar 28, 2024 pm 02:39 PM

How to install PHPFFmpeg extension on server? Installing the PHPFFmpeg extension on the server can help us process audio and video files in PHP projects and implement functions such as encoding, decoding, editing, and processing of audio and video files. This article will introduce how to install the PHPFFmpeg extension on the server, as well as specific code examples. First, we need to ensure that PHP and FFmpeg are installed on the server. If FFmpeg is not installed, you can follow the steps below to install FFmpe

How to publish notes tutorial on Xiaohongshu? Can it block people by posting notes? How to publish notes tutorial on Xiaohongshu? Can it block people by posting notes? Mar 25, 2024 pm 03:20 PM

As a lifestyle sharing platform, Xiaohongshu covers notes in various fields such as food, travel, and beauty. Many users want to share their notes on Xiaohongshu but don’t know how to do it. In this article, we will detail the process of posting notes on Xiaohongshu and explore how to block specific users on the platform. 1. How to publish notes tutorial on Xiaohongshu? 1. Register and log in: First, you need to download the Xiaohongshu APP on your mobile phone and complete the registration and login. It is very important to complete your personal information in the personal center. By uploading your avatar, filling in your nickname and personal introduction, you can make it easier for other users to understand your information, and also help them pay better attention to your notes. 3. Select the publishing channel: At the bottom of the homepage, click the &quot;Send Notes&quot; button and select the channel you want to publish.

Caching mechanism and application practice in PHP development Caching mechanism and application practice in PHP development May 09, 2024 pm 01:30 PM

In PHP development, the caching mechanism improves performance by temporarily storing frequently accessed data in memory or disk, thereby reducing the number of database accesses. Cache types mainly include memory, file and database cache. Caching can be implemented in PHP using built-in functions or third-party libraries, such as cache_get() and Memcache. Common practical applications include caching database query results to optimize query performance and caching page output to speed up rendering. The caching mechanism effectively improves website response speed, enhances user experience and reduces server load.

Detailed explanation of the advantages and utility of Golang server Detailed explanation of the advantages and utility of Golang server Mar 20, 2024 pm 01:51 PM

Golang is an open source programming language developed by Google. It is efficient, fast and powerful and is widely used in cloud computing, network programming, big data processing and other fields. As a strongly typed, static language, Golang has many advantages when building server-side applications. This article will analyze the advantages and utility of Golang server in detail, and illustrate its power through specific code examples. 1. The high-performance Golang compiler can compile the code into local code

See all articles