2. TCP keepalive overview In order to understand what TCP keepalive (which we will just call keepalive) does, you need do nothing more than read the name: keep TCP alive. This means that you will be able to check your connected socket (also known as…
一.nginx之tcp_nopush.tcp_nodelay.sendfile 1.TCP_NODELAY你怎么可以强制 socket 在它的缓冲区里发送数据?一个解决方案是 TCP 堆栈的 TCP_NODELAY选项.这样就可以使缓冲区中的数据立即发送出去. Nginx的 TCP_NODELAY 选项使得在打开一个新的 socket 时增加了TCP_NODELAY选项.但这时会造成一种情况:终端应用程序每产生一次操作就会发送一个包,而典型情况下一个包会拥有一个字节的数据以及40个字节长的包头,…
# client和nginx简易交互过程- step1:client发起http请求- step2:dns服务器解析域名得到主机ip- step3:默认端口为80,通过ip+port建立tcp/ip链接- step4:建立连接的tcp/ip三次握手,建立成功发送数据包- step5:nginx匹配请求  - case .html: 静态内容,分发静态内容响应  - case .php: php脚本,转发请求内容到php-fpm进程,分发php-fpm返回的内容响应- step6:断开连接的tcp…
当然,在nginx中,对于http1.0与http1.1也是支持长连接的.什么是长连接呢?我们知道,http请求是基于TCP协议之上的,那么,当客户端在发起请求前,需要先与服务端建立TCP连接,而每一次的TCP连接是需要三次握手来确定的,如果客户端与服务端之间网络差一点,这三次交互消费的时间会比较多,而且三次交互也会带来网络流量.当然,当连接断开后,也会有四次的交互,当然对用户体验来说就不重要了.而http请求是请求应答式的,如果我们能知道每个请求头与响应体的长度,那么我们是可以在一个连接上面执…
原文地址:http://nginx.com/resources/admin-guide/web-server/ NGINX Web Server Nginx web server This section describes: the most common configuration of a web server how to set up virtual servers and define locations for request processing how to use varia…
综述 最近笔者阅读并研究redis源码,在redis客户端与服务器端交互这个内容点上,需要参考网上一些文章,但是遗憾的是发现大部分文章都断断续续的非系统性的,不能给读者此交互流程的整体把握.所以这里我尝试,站在源码的角度,将redis client/server 交互流程尽可能简单地展现给大家,同时也站在DBA的角度给出一些日常工作中注意事项. Redis client/server 交互步骤分为以下6个步骤: 一.Client 发起socket 连接 二.Server 接受socket连接 三…
virtualbox搭建ubuntu server nginx+mysql+tomcat web服务器1 (未完待续) 第一次接触到 linux,不知道linux的确很强大,然后用virtualbox装了服务器,在命令行的东西实在是太多了,感觉还是记录在自己的博客里面感觉踏实点,同时也为广大的朋友提供意见和参考.感觉搭建整个服务器真的很难,首先要安装ubuntu,64位.这个比较简单,首先你要有个ubuntu的Ubuntu12.04.1 的ISO.http://download.chinauni…
<Beginning Linux Programming_4th>  chapter 15 Sockets 1  A simple local client/server 1)  client.c // 1) header files // int socket(int domain, int type, int protocol); #include <sys/types.h> // int connect(int socket, const struct sockaddr*ad…
ubuntu server nginx 安装与配置 一:关于nginx http://wiki.ubuntu.org.cn/Nginx http://nginx.org/cn http://wiki.nginx.org/NginxChs 二:ubuntu server 安装 如果你之前安装了 apache2服务,请先停止掉 sudo service apache2 stop sudo apt-get install nginx #安装 安装完成之后,打开  localhost测试 安装成功之后,…
Client–server model From Wikipedia, the free encyclopedia The client–server model of computing ] Often clients and servers communicate over a computer network on separate hardware, but both client and server may reside in the same system. A server ho…