如何量化安装一个鱿鱼代理后的应用程序性能的改善

我们对我们的Web应用程序进行了负载testing,发现一旦负载超过40个用户,服务器响应时间将大幅增加。 (这是一个256MB的RAM云机)。

所以我们在apache服务器前面安装了squid反向代理。 有趣的是,当我们开始加载testing时,我们意识到服务器即使对于更大的负载也performance相当好。 我们有理由感到高兴,但是我们想知道究竟是什么导致了这种性能的改善。

我们想知道以下事情

  1. 哪些请求被caching,哪些不是。
  2. caching命中:caching小姐

我应该在哪里查找这些信息?

Squid访问/caching日志parsing是一种方法,但也有其他的方法。

您应该使用Squid SNMP MIB (如果您已经使用SNMP来监视您的服务器),以获取有关命中率的常规统计信息。

squidclient是查询squid状态的一个很好的命令行工具。 它可以显示你caching的对象,Squid进程状态,caching的IP地址,磁盘子系统状态,打开文件描述符等等。 尝试squidclient -h your_squid_host -p your_squid_port -u your_user -w your_password mgr:menu为所有可能的选项。 用户和密码可以在squid.confconfiguration。

这里是squidclient的可能选项:

  mem Memory Utilization public cbdata Callback Data Registry Contents public events Event Queue public squidaio_counts Async IO Function Counters public coss COSS Stats public diskd DISKD Stats public config Current Squid Configuration hidden ipcache IP Cache Stats and Contents public fqdncache FQDN Cache Stats and Contents public idns Internal DNS Statistics public external_acl External ACL stats public http_headers HTTP Header Statistics public menu This Cachemanager Menu public shutdown Shut Down the Squid Process hidden reconfigure Reconfigure the Squid Process hidden offline_toggle Toggle offline_mode setting hidden info General Runtime Information public filedescriptors Process Filedescriptor Allocation public objects All Cache Objects public vm_objects In-Memory and In-Transit Objects public openfd_objects Objects with Swapout files open public pending_objects Objects being retreived from the network public client_objects Objects being sent to clients public io Server-side network read() size histograms public counters Traffic and Resource Counters public peer_select Peer Selection Algorithms public digest_stats Cache Digest and ICP blob public 5min 5 Minute Average of Counters public 60min 60 Minute Average of Counters public utilization Cache Utilization public histograms Full Histogram Counts public active_requests Client-side Active Requests public store_digest Store Digest public storedir Store Directory Stats public store_check_cachable_stats storeCheckCachable() Stats public store_io Store IO Interface Stats public pconn Persistent Connection Utilization Histograms public refresh Refresh Algorithm Statistics public delay Delay Pool Levels public forward Request Forwarding Statistics public client_list Cache Client List public asndb AS Number Database public server_list Peer Cache Statistics public non_peers List of Unknown sites sending ICP messages public 

获取Calamaris软件包( http://cord.de/tools/squid/calamaris/ )。 这读取你的鱿鱼日志文件(假设你打开日志logging),并输出报告应该给你你在找什么。

超过40个用户

这对于web服务器负载是一个毫无意义的措施。

(这是一个256MB的RAM云机)所以我们安装了鱿鱼反向代理

在没有看到大量有关系统运行情况的数据的情况下,我猜测性能问题是服务器内存有限的结果。 join鱿鱼将进一步减less这一点。

服务器performance相当不错

天哪。 这是非常意外的 – 你确定你先优化了networking服务器吗?

Calamaris会给你很多有关鱿鱼做什么的细节。