网站计数器 php,网站计数器 php
YouPorn占據(jù)整個互聯(lián)網(wǎng)每秒流量2%, 100Gb/s, 300K queries/s, 是全球訪問量最高的視頻色情網(wǎng)站. HAProxy->Varnish->Nginx-> PHP-FPM->Symfony2->Doctrine->HAProxy->Redis/MySQL 采用HAProxy做負載均衡,智能分發(fā)和后端健康檢查. 采用Syslog-ng來處理集群環(huán)境下的日志,其實就是用來收集頁面瀏覽時的數(shù)據(jù),比如視頻查看計數(shù)器.
Datastore is the most interesting part. Initially they used MySQL but more than 200 million of pageviews and 300K query per second are too much to be handled using only MySQL. First try was to add ActiveMQ to enqueue writes but a separate Java infrastructure is too expensive to be maintained. Finally they add Redis in front of MySQL and use it as main datastore.
Now all reads come from Redis. MySQL is used to allow the building new sorted sets as requirements change and it’s highly normalized because it’s not used directly for the site. After the switchover additional Redis nodes were added, not because Redis was overworked, but because the network cards couldn’t keep up with Redis :D
Lists are stored in a sorted set and MySQL is used as source to rebuild them when needed. Pipelining allows Redis to be faster and Append-only-file (AOF) is an efficient strategy to easily backup data.
總結(jié)
以上是生活随笔為你收集整理的网站计数器 php,网站计数器 php的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: php pcntl扩展下载,linux下
- 下一篇: java点到曲线的距离公式,使用Have