2012年3月24日星期六

Coach OutletI can remember from my childhood family visits to Lincolnshire and the East Coast were h



I can remember from my childhood family visits to Lincolnshire and the East Coast were highlights of my summer holidays from school in my Grandads car. He always took the route through Boston and onwards to Skegness,Coach Outlet, Ingoldmells or Chapel St Leonards.

One of the little bits of fun was looking for the Lincolnshire Imp. Grandad used to tell us the story that the imp would pick up the Boston Stump (St Botolph's Church) and run across the road to the other side to confuse you when travelling to Boston. Unknown to the children my siblings and I were at the time,Moncler Vest, the road approaching Boston had bends in it so that in the distance the Stump did in fact change sides of the road. The tower of St Botolph's Church is 272 feet 6 inches (83.06 m) high,Vibram Five Finger, making it the tallest parish church in England to its roof. The tower was used as a marker for travellers on The Fens and in The Wash so can be seen from many miles away.
Related articles:

Vibram Sale本博客(http://blog

本博客(http://blog.csdn.net/livelylittlefish)贴出作者(三二一、小鱼)相关研究、学习内容所做的笔记,Vibram 5 Finger,欢迎广大朋友指正,Vibram Sale!                                                                                               虚基类                ...
Related articles:

Beats By Dre本博客http://blog

本博客http://blog.csdn.net/livelylittlefish 贴出作者(三二一@小鱼)相关研究、学习内容所做的笔记,Moncler Outlet,欢迎广大朋友指正! 在Win32平台如何编译单元测试的代码?(readme文件并没有明确指出,UGG Boots UK,我们需要自行配置)   1. 单元测试从何处运行?   利用Google test编写单元测试,Beats By Dr Dre,我们只需要使用其提供的宏来定义测试,Beats By Dre,不需像CppUnit那样还要编写运行测试的代码,Moncler Jackets,从“Linux平台如何编译使用Google test写的单元测试?”也可以看出,我们并没有编写...
Related articles:

Monster CrossfadeB50611c University Girls Clothes 21 law Author: 2004-10-29 9: 45: 28 source: [] Wan

B50611c University Girls Clothes 21 law Author: 2004-10-29 9: 45: 28 source: [] Wangyao network containing 1 pure students from the shallower to the deeper, dress has three levels: the first layer is harmonious, the second layer is the third layer is the beauty, personality; college students should do it all.
2 smart, sensible when you buy clothes can be based on the following three criteria for choosing, does not comply with any one of them is not out of the wallet: you love, for you,Beats By Dre Headphones, you need.3 classic is very important, fashion is also very important,Christian Louboutin Sale, but must not forget is a little have great originality chic.
4 clothes and as a boyfriend, for their own is the best.5 do not pay too much attention to the brand, it will often make you ignore something inside.6 clothes can give a lot of girls of a curve, one of the most beautiful still is X shape, bring out the female slim, slim figure, the woman taste full (Doll type except for girls).
7 should spend more time and energy in the clothing collocation (of course, it is more important to study), not only allow you to 10 pieces of clothes out of 20 matches, but also exercise their aesthetic taste.
8 if your clothes are washed, but also in the conditions permit to fight daily change, two sets of clothes take turns in one week than the one set of clothes even wearing 3 days will be more let a person feel you neat, orderly.
9 choose the best material warm coat, which is put on a thin sweater or shirt, this international principles of dressing will be more and more popular.10 no so-called fashion, to show their own personality is the true prevalence.
11 whether in color or the details, although the use of similar elements of safety but not dull, proper use of opposing elements, skillfully combined, would be better nice effect.12 elegant dress with gentle flavor, but longing for the mature charm girls, the most essential is elegant and calm.
13 fashion development to today, its maturity has embodied the perfect mix instead of single piece.14 shiny dress at dinner and Admiral party will always be popular, but the whole body except the jewelry outside the window does not exceed 2, otherwise than none at all.
15 a good quality white shirt is your wardrobe can not lack, without any clothing than it can more the myriads of changes.16.mixmatch principle is not only reflected in the costumes, the same can be cheap and expensive, the old and the new with the dress up.
Each of the 17 season will have new pop elements come, do not blindly follow the trend (go to school during the original silver is not much), let oneself become the trend forecaster, but lost their own style.
The key is to buy the classic styles of clothing, durable, attractive, while also adding in some fashion elements, not too boring.18 black city is always colour,Monster Headphones, but if you look is not too good, it is best to avoid adding gray color is bright,Five Fingers Shoes, too won't jump, do not pick the person is the right choice.
19 searching for their skin color, attention must be paid to the garment is worn in themselves, rather than black or white models racks.20 attached accessories, clothes is only the first step, in the budget set aside space for accessories, accessories not essential that there is no one grade.
21 steps to build their own aesthetic orientation and color system,Monster Crossfade, don't let the chest into a color kingdom.Choice of white, black, beige, the basic color as everyday dress main colors, and in the jewelry active color.
Related articles:

Monster Diddy beats

流量集中

大部分bbs的流量都是冷热不均,相差很大,热帖一天可达数百万访问,冷贴就是一个访问量也没有。热帖主要是在列表第一版的帖子,和精华贴,这些帖子的流量加起来至少占到整个bbs流量的50%以上。虽然热帖占了很大流量,但这些热帖的数量不会太多,所以用缓存架构的话对这些热帖优化程度就很大,对热帖优化程度大相当于对整个系统优化程度大。

实时性

每发或回复一张贴,就必须让这张贴立刻发布出去,用户能马上看到。所以用到缓存架构的话,这个缓存要能实时更新。

回帖少,看帖多

因为bbs也是由人来组成,所以这个现象是不可改变的,1/10是比较保守,估计大部分都在1/100以下吧。虽然有实时性,但是因为回帖少看帖多,意味着触发更新缓存的频率少,比率越小,优化效果越大。


系统主要解决问题

bbs因为是实时系统,所以常规上都是设计为纯动态+直读数据库架构,纯动态架构的性能问题是一个突出问题,在达到一定访问量或受到一些攻击时,系统就容易挂掉,严重的时候数据库还会损坏,数据库坏掉的话服务恢复时间就很长。更困惑人的是,以往即使知道性能是个问题,但是去解决这个问题的风险很大,需要对系统进行很大的变动。做很大的变动就难免会引发很多新的bug,这样很容易导致大量的网友流失。

今天讲的这个架构基本可以解决性能问题,而且对程序部分的修改不算很多,而且有一个成形的实施步骤,按步骤就能做完。

架构图

前面是lvs负载均衡,lvs下面挂几台squid,squid的配置统一指向到中层代理nginx,由nginx负载均衡到几台应用服务器,后面就是数据库。其中lvs安装调试起来可能麻烦一些,可以用haproxy替换,Beats By Dre Pro,haproxy是目前7层纯代理中性能最好的,安装配置和出问题时处理也相对简单。squid的配置比较特别的是缓存时间可以尽可能长,对单贴的缓存时间可以配到一天以上,Coach Outlet,目的是让帖子尽量不要过期,只有后端发来更新的请求才会更新。

高性能

因为有了缓存,很多帖子都被缓存住了,请求的时候当然直接从缓存出去,不会触及到应用服务器,所以效率很高。

gzip压缩可以减少页面流量80%左右,100k的页面可以压到20k这样,一方面减少了带宽,另一方面用户访问起来感觉也会快很多。这个是在中层代理的nginx上完成的,用nginx做这个事情在效率方面没有任何感觉。

应用服务器可以看作一个很慢的,很容易挂掉的系统,中层代理的负载均衡可以将它们保护起来,在这里用nginx作负载均衡有几个优点:
1,可以用多端口,这样在一台服务器上可以多开几个应用服务器。
2、nginx可以在访问一个后端出错之后,将这个请求再发到另一个后端,这样基本可以保证每个请求都能返回正确的数据。

实时性静态化

因为用到了缓存,所以页面中有不少要修改的地方:
1、用rewrite把帖子变成一个.html结尾的文件,虽然squid也可以缓存带?的链接,但是rewrite技术可以使链接固定并且简洁,比如帖子有两个参数帖子id和分页的页数,用?有两个参数,如果把这两个参数的顺序调过来,那么squid就认为是两个链接,有两份缓存,更新缓存时就会漏掉一个。
2、squidclient是squid自带的一个程序,可以用它来观察squid的运行状态,和更新缓存,更新缓存的机制就是向squid发送一个特殊的请求让squid去删掉对应的缓存链接,然后下一次访问到这个链接的时候,squid就会重新去后端取这个链接的内容。
3、因为用到了缓存,页面上是不能直接放一些信息,比如用户登录状态,在动态程序中可以直接用程序语言读取显示,但在这个架构中只能把它从页面中除去,然后用javascript读取cookie来显示。有其它需求的话,还要用到ajax或json技术。
4、同样是因为有缓存,每次更新缓存都要花去一些时间,为了加快速度,所以会用到异步更新缓存的机制。用到异步更新会出一个问题,当用户得到发帖成功的响应的时候,事实上这张贴还没有更新,Moncler Men Jackets,如果让用户直接访问这张帖子,那他往往看不到自己刚发表的回帖,这会让用户联想到“审核”这个动作,感觉非常不好。所以这个发帖成功这个动作应该让用户看到“5秒后跳到某某页面”这样的提示,让他缓冲一下,这样程序就有足够的时间来执行更新缓存的动作了。另外一个是更新缓存时遇到分页帖子就不好处理,所以应让页面尽可能长,像猫扑天涯的帖子都很长,就是这个原因。
5、因为脱离了动态程序,所以之前如果是用动态程序直接统计点击量的话,点击量就会有问题,这时可以通过统计squid的log来统计帖子的点击量,然后再更新到后台的一个接口里。


二级缓存的优点是可以进一步减少请求量,这里配置了4台缓存,意味着一个热门帖子每次更新都会更新这4台机器,这4台机器就会发出4个请求,用一台二级缓存就可以化为1个请求,理论上可以将请求优化掉3/4。另外是squid这个服务器在一些情况下会出现某台机请求全部穿透的现象,这时二级缓存就可以拦截住这些量很大的请求。一般来说,一个系统用到二级缓存就基本足够了,没有必要用到三级。

缓存过期时间在nginx或squid做,比较方便,比如有个没有被缓存的页面,访问量突然很大,Monster Diddy beats,这时可以立刻调整它让它暂时被缓存住。

在nginx可以通过log观察,屏蔽掉一些ip和访问,比如一些设计不良的爬虫来爬页面,造成系统负载突增,可以直接将它的ip或user-agent屏蔽掉。

权重和分流调节是lvs和nginx都有的功能,如果机器性能不均造成负载不均,或者有机器处于调试状态,可以调整他们的访问权重。lvs因为工作在http的第4层,所以分流功能不算太强,除了可以调权重,另外就是可以根据客户端ip分,还有根据后端负载动态分。nginx是7层代理,分配方式就更多,可以实现基于ip/url/header/后端响应速度等等来分。

高可用性就是说系统的稳固状态,最好的就是这个系统永远都能正常访问,无论什么时候访问都绝对能打得开,当然这世界上根本没有永远都能打开的系统了,所以我们也只能让它尽可能访问正常。在计算机系统中某一台单机的可用性都是不可靠的,单机即使软件性能做到很强,但是硬件也会有问题,所以要用到集群架构。

lvs通过双机热备,实时切换,可保证有故障时会自动换到备机。
squid直接利用lvs的故障屏蔽
nginx可利用自己写的程序来实现热备,也可以用lvs分到两台nginx上
应用服务器就是nginx集群
数据库就麻烦一些,现用的方案是通过程序判断来做双机热备

因为用到缓存架构,大量的流量都是通过缓存直接输出的,Dr Dre Beats,这样就可以轻松实现流量分配,一般的分流问题有两种,电信网通的分流和双线路分流,都可以做。

电信网通,在电信机房和网通机房各架一组缓存,中层代理和应用服务器都用一套。
多线路分流和电信网通分流差不多,就是比如两条100M的带宽,怎么一起服务。

权限划分,这个是大公司才会有的问题了,大公司分工比较细,比如我就是做运维的,所以我就主要管理前面的squid和nginx这个部分,应用服务器和数据库就让产品维护的兄弟去做,在性能优化有什么问题需要他们帮忙的,我只提供方案,让他们去实施。有部分要合作的,要想办法减少耦合度,像点击量统计这部分,他们设计一个接口,然后我去写统计log的脚本,然后往接口发。反过来也一样,我设计接口,然后他们发来。
Related articles:

Monster Beats Tour

原文:

你在使用UIWebview显示网页时,Moncler Coats,可能会注意到,ugg clearance uk,UIWebView所支持的缩放倍率是很有限的。而在Safari自己所支持的缩放系数比UIWebview要大得多。本文解释了如何加大UIWebView的缩放系数。

UIWebView类没有修改缩放系数的方法,我们只能用HTML代码来做。Meta标签可以设置viewport,而viewport就包含了初始化缩放系数的参数。

META标签如下所示:

可以使用的参数有:

    JavaScript代码如下:

    IncreaseZoomFactor.js:

    在webViewDidFinishLoad:委托方法中,你可以把这段JS代码加到web页中:

    当从web加载web页时,你需要小心,因为许多web页已经使用META标签去改变了缩放系数或其他的viewport参数。如果你加入了新的META标签,UGG Boots Sale,你会覆盖这些缩放系数以及其他未参数。也就是说,如果在多个META标签中定义同一参数,那么最后一个定义生效。大部分时候这不会产生什么问题,但某些时候例外,Monster Beats Tour。

    例如,如果web页定义了初始缩放系数4,由于web页没有定义maximum-scale参数,那么默认值1.6将限制初始缩放系数只能是1.6。现在,你加大了maximum-scale,initialzoom也会加大,因为原来的maximum-scale参数不能再限制它了。这会带来一个严重的后果,你需要检查其他参数并根据它们的值进行重新定义(例如,你需要将initial-scale定义为1.6以防止maximum-scale将页面缩放得过多),Vibram Sale。


    Related articles:

    Vibram Five FingersNicktoons is THE place for

    Related articles: