CAP定理

CAP 定义在一个分布式系统中,当涉及读写操作时,只能保证一致性(Consistency)、可用性(Availability )、分区容忍性(Partition tolerance)三者中的两个,另一个必须有所牺牲(不是完全放弃)。Partition tolerance 分区容忍性定义:当出现网络分区后,系统能够继续“履行职责”。分区容忍性没有要求分区发生时返回数据的正确性,也没有要求不能回复客户

- 阅读全文 -

Linux dd+grep 大文件二分查找

Linux dd 命令用于读取、转换并输出数据。dd 可从标准输入或文件中读取数据,根据指定的格式来转换数据,再输出到文件、设备或标准输出。参数说明(dd --help)Usage: dd [OPERAND]... or: dd OPTION Copy a file, converting and formatting according to the operands. bs=BYT

- 阅读全文 -

MySQL 连接数

查看连接数配置(MySQL 服务器允许的最大连接数 16384)mysql -u root -proot -e "show variables like '%max_connections%'"查看当前连接数方法1:mysql -u root -proot -e "show full processlist"(需要用管理员帐号)方法2:mysql -u root -proot -e "status

- 阅读全文 -

MySQL 乐观锁与悲观锁,解决库存问题

乐观锁使用条件限制,实现乐观锁假设库存 num=5 情况1(减库存成功)update 库存表 set num=num-5 where num-5 >= 0 and id=1; // 减5库存,影响行数1情况2(减库存失败)update 库存表 set num=num-6 where num-6 >= 0 and id=1; // 减6库存,影响行数0数据表加 version 字段,实现

- 阅读全文 -

centos ntpdate 时间同步

yum install ntpdatentpdate ntp.sjtu.edu.cn # 上海交大的 ntp 服务器vi /etc/sysconfig/clockZONE="Asia/Shanghai" UTC=false # 设置为false,硬件时钟不于utc时间一致 ARC=falseln -sf /usr/share/zoneinfo/Asia/Shanghai

- 阅读全文 -

swoole 安装

1.安装 gcc gcc-c++ 4.8 (swoole 依赖)https://my.oschina.net/u/583362/blog/682123 安装 gcc gcc-c++ 4.8 yum --enablerepo=testing-devtools-2-centos-6 install devtoolset-2-gcc devtoolset-2-gcc-c++ yum -y insta

- 阅读全文 -

ag 比 grep 更快的搜索工具

安装1) unixhttps://github.com/ggreer/the_silver_searcher2) windowshttps://github.com/k-takata/the_silver_searcher-win321.下载 release 包2.安装 git bash 3.把 ag.exe 移动到 git 的 PATH 目录下 (which git && mv ag.exe /

- 阅读全文 -

vim 插件管理 Vundle

vim 插件管理 Vundle [https://github.com/VundleVim/Vundle.vim]:1.下载 Vundle 仓库git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim2.vim ~/.vimrc 在最上面,添加以下配置" =================

- 阅读全文 -

php 性能分析工具 xhprof

php 安装 xhprof 扩展 (兼容php5、7)https://github.com/longxinH/xhprofgit clone git@github.com:longxinH/xhprof.git cd xhprof/extension/ /usr/local/php7/bin/phpize ./configure --with-php-config=/usr/local/php7

- 阅读全文 -

最新文章

最近回复

  • in3omnia: 评论把换行吞了,应该是sshfs user@host:/remo...
  • in3omnia: MAC 执行sshfs user@host:/remote/pa...
  • 大白: 这个插件自1.0.5版本开始,评论通过审核的邮件无法发送,我查了...
  • 酷小呵: 真是大佬,文章浏览量好高,羡慕
  • 小轲: 是不是好久没冒泡了~~~
  • 软件下载: 感谢站长分享。
  • 小轲博客: hi,我的博客已托管到GitHub。所以部分线路可能偶尔抽风~
  • gh0stoo1: 已恢复 感谢保留
  • secondlife: 站名:墨迹心空站点链接:https://www.secondli...
  • aya: 既不应该用数组,也不应该允许一个函数有过多的(无名)参数。1)可...

标签

其它