网站性能指标

QPS

每秒查询率(Query Per Second),每秒响应请求数

QPS = 完成Request量/所花时间(单位 Request/s)

吞吐量(Throughput)

吞吐量是指系统在单位时间内响应的数据量

一个系统吞吐量通常由QPS(TPS)、并发数两个因素决定,每套系统这两个值都有一个相对极限值,在应用场景访问压力下,只要某一项达到系统最高值,系统的吞吐量就上不去了,如果压力继续增大,系统的吞吐量反而会下降,原因是系统超负荷工作,上下文切换、内存等等其它消耗导致系统性能下降

阅读更多

How-To-Clear-PHP’s-Opcache

原文链接:https://ma.ttias.be/how-to-clear-php-opcache/

PHP can be configured to store precompiled bytecode in shared memory, called Opcache. It prevents the loading and parsing of PHP scripts on every request. This guide will tell you how to flush that bytecode Opcache, should you need it.

You may want to flush the APC (PHP < 5.5) or Opcache (PHP >= 5.5) in PHP when it has cached code you want to refresh. As of PHP 5.5, the APC cache has been replaced by Opcache and APC only exists as a user key/value cache, no longer a bytecode cache.

阅读更多

计算机术语之开源许可协议与软件版本

开源许可协议

当你给软件附上许可证时,意味着你将保留对软件的所有权利。许可协议用来授权其他人具有某种使用你的作品的权利。

开源许可协议 使人们免去了研究那些专业的许可条款的麻烦,使人们更方便的对开源项目贡献出自己的代码。而且它还能保护你作为作品的原创作者,确保你至少拥有由于贡献参与而带来的署名荣誉。它还能用来阻止其他人企图声明对你的作品拥有所有权的行为。

阅读更多

CentOS下安装Redis以及主从复制测试

Redis是一个高性能的key-value数据库,它支持丰富的数据类型,包括字符串(String), 哈希(Hash), 列表(list), 集合(sets)和有序集合(sorted sets)。本文将从源码安装Redis并配置成系统服务,最后进行主从复制测试,这个流程展开

1. 下载Redis并解压

Redis最新稳定版本是4.0

1
2
wget http://download.redis.io/releases/redis-4.0.2.tar.gz
tar -xzvf redis-4.0.2.tar.gz

阅读更多

Conversation With API Builders

原文链接:http://conversation.bigbinary.com/

Conversation With API Builders

Bad APIs have one thing in common—they do not handle response status codes effectively.
They all use custom solutions while the status code value can be attached to the HTTP resonse.
This ebook covers when to use what status code and much more.

1. Return 200 when it is all good

API user : Hey, I have a problem.

API builder : What’s wrong.

API user : I sent a request to the API to create a user. But I do not see the newly created user.

阅读更多

那些有关人生、爱情、生活的句子

生活中到处有负能量,当你疲倦时、失望时可以看看这些句子,或许能给你一些力量。这些句子从2012年断断续续收集过来,有的是来自书,
有来自一部电影,有的来自歌词,不一而足。


1、人的眼睛是由黑白两部分所组成的,可是神为什么要让人只能通过黑的部分去看东西?因为人生必须透过黑暗,才能看到光明——《塔木德》

2、一个人要获得实在的幸福,就必须既不太要聪明,也不太傻。人们把这种介于聪明和傻之间的状态叫做生活的智慧——周国平

3、每个圣人都有不可告人的过去,每个罪人都有洁白无瑕的未来

阅读更多