存档

文章标签 ‘code’

使用memcached做数据库点击数统计缓冲

2009年12月18日 2 条评论

原理:

  1. 先从数据库读取最新的点击数,更新到缓存中。
  2. 点击动作产生时,在缓冲做自增操作。
  3. 把被点击的ID写入缓存中,以表名为组。表明缓存中有该ID的点击数,需要进行入库操作。
  4. 定时更新缓存数据到数据库。
  5. 如发现入库周期内,点击数无更新,则放弃入库,并山删除表名组中的ID。

阅读全文…

鞋衫各式名品专卖

收藏与分享
分类: Apache, memcache, php 标签: , , ,

memcached: Benchmark of 4 Python libraries

2009年9月19日 没有评论

memcached: Benchmark of 4 Python libraries

Memcached speed

Optimizations, don’t we just love them! Unfortunately most micro optimizations aren’t worth doing. The optimizations that are worth doing are those that affect everything… And if you use memcached, then memcached affects everything ;-) In this blog post I present a benchmark of 4 most popular Python memcached libraries (one of them pure Python, the 3 others C wrappers).

As my benchmark shows, there are lots of gains, basically you can speed up your memcached operations by 2x times – which is REALLY hard to do with any other optimization.

There are currently 4 Python memcached libraries and there aren’t any good benchmarks of these, so I have set a goal to benchmark these. The candidates:

阅读全文…

收藏与分享

TORNADO – THE FASTEST WSGI SERVER?

2009年9月19日 没有评论

Tornado – The fastest WSGI server?

Posted on 13. Sep
· Comments [5]
Tornado Python

Tornado is a non-blocking web server from the FriendFeed hackers. There are different hello world benchmarks, but none that are really interesting to me since all of my web-applications are WSGI applications.

阅读全文…

简单生活。简单运动

收藏与分享
分类: Linux web, 云计算 标签: , ,

nginx 7稳定版发布

2009年5月26日 没有评论

做反向代理的时候加入了cache功能,”caching of proxied and fcgi server “,不知道效果如何,sina搞的ncache用起来太麻烦,还得64位系统。lighttpd的mod_cache竟然连PHP也给cache了-_-,要好好试下nginx 7的cache功能。
下载地址:http://sysoev.ru/nginx/nginx-0.7.59.tar.gz

Changes with nginx 0.7.59 25 May 2009

*) Feature: the “proxy_cache_methods” and “fastcgi_cache_methods”
directives.
阅读全文…

收藏与分享
分类: Linux web 标签: , , , , , , ,