在web2.0网站系统架构中,缓存无处不在。如一个大的CDN平台,一个普通的页面级缓存等。合理的利用缓存可以提高用户下载速度、降低源服务器性能负载。如何高效去维护一个缓存集群?除了提高命中率便是缓存的推送管理。现与大家分享构建一个高性能的缓存推送平台思路及实现。
一、平台架构图

说明:平台使用Django+mysql开发,支持POS/GET两种模式,POST方式用于管理员的手工推送,GET方式则用于接口模式。平台将接收到的URL进行校验、分类后统一向所属缓存服务器组进行telnet pureg请求。遍历完所有主机后返回结果串。
二、平台截图
1、管理UI

2、接口说明

一、平台架构图
说明:平台使用Django+mysql开发,支持POS/GET两种模式,POST方式用于管理员的手工推送,GET方式则用于接口模式。平台将接收到的URL进行校验、分类后统一向所属缓存服务器组进行telnet pureg请求。遍历完所有主机后返回结果串。
二、平台截图
1、管理UI

2、接口说明

之前一直使用Nginx+Fastcgi来搭建python web服务器,本文介绍Nginx+UWSGI组合来实现。uWSGI 是一个快速的、纯C语言开发的、自维护的、对开发者友好的WSGI服务器,旨在提供专业的 Python web应用发布和开发。它更符合python web的标准协议,速度要比Fastcgi要快、性能更加稳定。
一、安装平台
1、安装pcre
cd /home
mkdir -p /home/install/nginx && cd /home/install/nginx
wget http://ftp.exim.llorien.org/pcre/pcre-8.00.tar.gz
tar -zxvf pcre-8.00.tar.gz
cd pcre-8.00
./configure
make && make install
cd ..
2、安装Nginx
wget http://nginx.org/download/nginx-0.8.50.tar.gz
tar -zxvf nginx-0.8.50.tar.gz
cd nginx-0.8.50/
./configure --user=nobody --group=nobody --prefix=/usr/local/nginx --with-http_stub_status_module --with-cc-opt='-O3' --with-cpu-opt=opteron
make && make install
cd ..
一、安装平台
1、安装pcre
引用
cd /home
mkdir -p /home/install/nginx && cd /home/install/nginx
wget http://ftp.exim.llorien.org/pcre/pcre-8.00.tar.gz
tar -zxvf pcre-8.00.tar.gz
cd pcre-8.00
./configure
make && make install
cd ..
2、安装Nginx
引用
wget http://nginx.org/download/nginx-0.8.50.tar.gz
tar -zxvf nginx-0.8.50.tar.gz
cd nginx-0.8.50/
./configure --user=nobody --group=nobody --prefix=/usr/local/nginx --with-http_stub_status_module --with-cc-opt='-O3' --with-cpu-opt=opteron
make && make install
cd ..