博客园 - yanghuahuiuuid:24b78886-0ed1-41c2-8670-e3f31dcf42c4;id=364632021-02-03T09:24:51Zyanghuahuihttps://www.cnblogs.com/yanghuahui/feed.cnblogs.comhttps://www.cnblogs.com/yanghuahui/p/9640697.htmlpython multiprocessing深度解析 - yanghuahui在写python多线程代码的时候,会用到multiprocessing这个包,这篇文章总结了一些这个包在多进程管理方面的一些原理和代码分析。 1. 问题一:是否需要显式调用pool的close和join方法,不调用的话,子进程是否无法退出? 首先初始化Pool的时候,指定processes的个数,就2018-09-13T07:19:00Z2018-09-13T07:19:00Zyanghuahuihttps://www.cnblogs.com/yanghuahui/【摘要】在写python多线程代码的时候,会用到multiprocessing这个包,这篇文章总结了一些这个包在多进程管理方面的一些原理和代码分析。 1. 问题一:是否需要显式调用pool的close和join方法,不调用的话,子进程是否无法退出? 首先初始化Pool的时候,指定processes的个数,就 <a href="https://www.cnblogs.com/yanghuahui/p/9640697.html" target="_blank">阅读全文</a>https://www.cnblogs.com/yanghuahui/p/9474603.html好用的shell可以事半功倍 - yanghuahuiReference 安装zsh,以及选择一种framework 'Oh My Zsh' https://sourabhbajaj.com/mac-setup/iTerm/zsh.html 然后推荐一些插件: 自动补齐command插件 https://github.com/zsh-users/zsh2018-08-14T06:53:00Z2018-08-14T06:53:00Zyanghuahuihttps://www.cnblogs.com/yanghuahui/【摘要】Reference 安装zsh,以及选择一种framework 'Oh My Zsh' https://sourabhbajaj.com/mac-setup/iTerm/zsh.html 然后推荐一些插件: 自动补齐command插件 https://github.com/zsh-users/zsh <a href="https://www.cnblogs.com/yanghuahui/p/9474603.html" target="_blank">阅读全文</a>https://www.cnblogs.com/yanghuahui/p/9473609.htmllinux overcommit flag - yanghuahuilinux中有一个overcomit的配置,这个配置关系到进程在过多申请memory资源的时候,系统的表现(启发式允许,不检查,or 阻止) 详细的理解可以参见这个博客: http://linuxperf.com/?p=102 在实际项目中,如果机器是跑redis的一般都会把overcomit开成12018-08-14T03:35:00Z2018-08-14T03:35:00Zyanghuahuihttps://www.cnblogs.com/yanghuahui/【摘要】linux中有一个overcomit的配置,这个配置关系到进程在过多申请memory资源的时候,系统的表现(启发式允许,不检查,or 阻止) 详细的理解可以参见这个博客: http://linuxperf.com/?p=102 在实际项目中,如果机器是跑redis的一般都会把overcomit开成1 <a href="https://www.cnblogs.com/yanghuahui/p/9473609.html" target="_blank">阅读全文</a>https://www.cnblogs.com/yanghuahui/p/9381857.htmlmesos支持gpu代码分析以及capos支持gpu实现 - yanghuahui这篇文章涉及mesos如何在原生的mesoscontainerizer和docker containerizer上支持gpu的,以及如果自己实现一个mesos之上的framework capos支持gpu调度的实现原理,(capos是hulu内部的资源调度平台 refer to https://ww2018-07-28T06:07:00Z2018-07-28T06:07:00Zyanghuahuihttps://www.cnblogs.com/yanghuahui/【摘要】这篇文章涉及mesos如何在原生的mesoscontainerizer和docker containerizer上支持gpu的,以及如果自己实现一个mesos之上的framework capos支持gpu调度的实现原理,(capos是hulu内部的资源调度平台 refer to https://ww <a href="https://www.cnblogs.com/yanghuahui/p/9381857.html" target="_blank">阅读全文</a>https://www.cnblogs.com/yanghuahui/p/9304302.htmlHulu大规模容器调度系统Capos - yanghuahuiHulu是美国领先的互联网专业视频服务平台,目前在美国拥有超过2000万付费用户。Hulu总部位于美国洛杉矶,北京办公室是仅次于总部的第二大研发中心,也是从Hulu成立伊始就具有重要战略地位的分支办公室,独立负责播放器开发,搜索和推荐,广告精准投放,大规模用户数据处理,视频内容基因分析,人脸识别,视2018-07-13T04:27:00Z2018-07-13T04:27:00Zyanghuahuihttps://www.cnblogs.com/yanghuahui/【摘要】Hulu是美国领先的互联网专业视频服务平台,目前在美国拥有超过2000万付费用户。Hulu总部位于美国洛杉矶,北京办公室是仅次于总部的第二大研发中心,也是从Hulu成立伊始就具有重要战略地位的分支办公室,独立负责播放器开发,搜索和推荐,广告精准投放,大规模用户数据处理,视频内容基因分析,人脸识别,视 <a href="https://www.cnblogs.com/yanghuahui/p/9304302.html" target="_blank">阅读全文</a>https://www.cnblogs.com/yanghuahui/p/9085461.html关于数据库存储过程和函数的区别,优缺点以及各家之言 - yanghuahui摘抄观点: 引用出处: Mysql 存储过程和函数区别 http://www.cnblogs.com/youxin/p/3568379.html MySQL存储过程_创建-调用-参数 http://www.cnblogs.com/geaozhang/p/6797357.html 存储过程在实际项目中2018-05-24T14:22:00Z2018-05-24T14:22:00Zyanghuahuihttps://www.cnblogs.com/yanghuahui/【摘要】摘抄观点: 引用出处: Mysql 存储过程和函数区别 http://www.cnblogs.com/youxin/p/3568379.html MySQL存储过程_创建-调用-参数 http://www.cnblogs.com/geaozhang/p/6797357.html 存储过程在实际项目中 <a href="https://www.cnblogs.com/yanghuahui/p/9085461.html" target="_blank">阅读全文</a>https://www.cnblogs.com/yanghuahui/p/8394885.html闭包,函数式编程学习小记 - yanghuahui对象是包含行为的数据,闭包是包含数据的行为。 闭包就是能够读取其他函数内部变量的函数,也可以让内部的局部变量通过闭包暴露给外部函数,所以本质上闭包就是将函数内部和函数外部连接起来的一座桥梁。 一个介绍js函数式编程的gitbook https://llh911001.gitbooks.io/most2018-05-15T15:18:00Z2018-05-15T15:18:00Zyanghuahuihttps://www.cnblogs.com/yanghuahui/【摘要】对象是包含行为的数据,闭包是包含数据的行为。 闭包就是能够读取其他函数内部变量的函数,也可以让内部的局部变量通过闭包暴露给外部函数,所以本质上闭包就是将函数内部和函数外部连接起来的一座桥梁。 一个介绍js函数式编程的gitbook https://llh911001.gitbooks.io/most <a href="https://www.cnblogs.com/yanghuahui/p/8394885.html" target="_blank">阅读全文</a>https://www.cnblogs.com/yanghuahui/p/9043631.htmlgoroutine和线程区别 - yanghuahui从调度上看,goroutine的调度开销远远小于线程调度开销。 OS的线程由OS内核调度,每隔几毫秒,一个硬件时钟中断发到CPU,CPU调用一个调度器内核函数。这个函数暂停当前正在运行的线程,把他的寄存器信息保存到内存中,查看线程列表并决定接下来运行哪一个线程,再从内存中恢复线程的注册表信息,最后继2018-05-15T15:12:00Z2018-05-15T15:12:00Zyanghuahuihttps://www.cnblogs.com/yanghuahui/【摘要】从调度上看,goroutine的调度开销远远小于线程调度开销。 OS的线程由OS内核调度,每隔几毫秒,一个硬件时钟中断发到CPU,CPU调用一个调度器内核函数。这个函数暂停当前正在运行的线程,把他的寄存器信息保存到内存中,查看线程列表并决定接下来运行哪一个线程,再从内存中恢复线程的注册表信息,最后继 <a href="https://www.cnblogs.com/yanghuahui/p/9043631.html" target="_blank">阅读全文</a>https://www.cnblogs.com/yanghuahui/p/6195260.html分布式一致性算法 - yanghuahuipaxos paxos use in mesos http://mesos.apache.org/documentation/latest/replicated-log-internals/ zab use in zookeeper, zab v.s. paxos https://cwiki.apa2016-12-18T11:09:00Z2016-12-18T11:09:00Zyanghuahuihttps://www.cnblogs.com/yanghuahui/【摘要】paxos paxos use in mesos http://mesos.apache.org/documentation/latest/replicated-log-internals/ zab use in zookeeper, zab v.s. paxos https://cwiki.apa <a href="https://www.cnblogs.com/yanghuahui/p/6195260.html" target="_blank">阅读全文</a>https://www.cnblogs.com/yanghuahui/p/5923449.htmlsome useful linux commands - yanghuahui# best way to see log file less +F /var/log/syslog (equals: less /var/log/syslog, then shift+f) # see dmesg when it changes watch -n 0.1 "dmesg | tail -n 30" # use xargs with find find . -type x...2016-09-30T04:19:00Z2016-09-30T04:19:00Zyanghuahuihttps://www.cnblogs.com/yanghuahui/【摘要】# best way to see log file less +F /var/log/syslog (equals: less /var/log/syslog, then shift+f) # see dmesg when it changes watch -n 0.1 "dmesg | tail -n 30" # use xargs with find find . -type x... <a href="https://www.cnblogs.com/yanghuahui/p/5923449.html" target="_blank">阅读全文</a>https://www.cnblogs.com/yanghuahui/p/5821895.htmltwitter.common.concurrent deadline and defer - yanghuahui此defer非golang中的defer https://tour.golang.org/flowcontrol/12 这个代码是不会抛出exception的,twitter中defer主要用途是并发启动一些命令,不会相互block。 refer to: https://github.com/twi2016-08-30T06:30:00Z2016-08-30T06:30:00Zyanghuahuihttps://www.cnblogs.com/yanghuahui/【摘要】此defer非golang中的defer https://tour.golang.org/flowcontrol/12 这个代码是不会抛出exception的,twitter中defer主要用途是并发启动一些命令,不会相互block。 refer to: https://github.com/twi <a href="https://www.cnblogs.com/yanghuahui/p/5821895.html" target="_blank">阅读全文</a>https://www.cnblogs.com/yanghuahui/p/5581556.htmlgit 开发merge rebase 记录 - yanghuahuigenerate a patch and apply a patch, refer to https://ariejan.net/2009/10/26/how-to-create-and-apply-a-patch-with-git/2016-06-13T10:13:00Z2016-06-13T10:13:00Zyanghuahuihttps://www.cnblogs.com/yanghuahui/【摘要】generate a patch and apply a patch, refer to https://ariejan.net/2009/10/26/how-to-create-and-apply-a-patch-with-git/ <a href="https://www.cnblogs.com/yanghuahui/p/5581556.html" target="_blank">阅读全文</a>https://www.cnblogs.com/yanghuahui/p/5168640.htmljava function retry wrapper - yanghuahuiimport java.util.concurrent.Callable; /** * Created by huahui.yang on 1/29/16. */ public class RetryWrapper<A> { public A retry(Callable<A> callable) 2016-01-29T04:47:00Z2016-01-29T04:47:00Zyanghuahuihttps://www.cnblogs.com/yanghuahui/【摘要】import java.util.concurrent.Callable; /** * Created by huahui.yang on 1/29/16. */ public class RetryWrapper<A> { public A retry(Callable<A> callable) <a href="https://www.cnblogs.com/yanghuahui/p/5168640.html" target="_blank">阅读全文</a>https://www.cnblogs.com/yanghuahui/p/5091861.htmlfiles list file for package 'xxx' is missing final newline - yanghuahui#!/usr/bin/python# 8th November, 2009# update manager failed, giving me the error:# 'files list file for package 'xxx' is missing final newline'...2015-12-31T07:24:00Z2015-12-31T07:24:00Zyanghuahuihttps://www.cnblogs.com/yanghuahui/【摘要】#!/usr/bin/python# 8th November, 2009# update manager failed, giving me the error:# 'files list file for package 'xxx' is missing final newline'... <a href="https://www.cnblogs.com/yanghuahui/p/5091861.html" target="_blank">阅读全文</a>https://www.cnblogs.com/yanghuahui/p/4911276.htmlyarn关于app max attempt深度解析,针对长服务appmaster平滑重启 - yanghuahui在YARN上开发长服务,需要注意fault-tolerance,本篇文章对appmaster的平滑重启的一个参数做了解析,如何设置可以有助于达到appmaster平滑重启。在yarn-site.xml有个参数/** * The maximum number of application atte...2015-10-26T07:07:00Z2015-10-26T07:07:00Zyanghuahuihttps://www.cnblogs.com/yanghuahui/【摘要】在YARN上开发长服务,需要注意fault-tolerance,本篇文章对appmaster的平滑重启的一个参数做了解析,如何设置可以有助于达到appmaster平滑重启。在yarn-site.xml有个参数/** * The maximum number of application atte... <a href="https://www.cnblogs.com/yanghuahui/p/4911276.html" target="_blank">阅读全文</a>https://www.cnblogs.com/yanghuahui/p/4874937.htmldocker 1.8+之后ubuntu安装指定版本docker-engine - yanghuahui这边记录ubuntu安装过程,首先是官网文档If you haven’t already done so, log into your Ubuntu instance.Open a terminal window.Add the newgpgkey.$ apt-key adv --keyserver...2015-10-13T08:09:00Z2015-10-13T08:09:00Zyanghuahuihttps://www.cnblogs.com/yanghuahui/【摘要】这边记录ubuntu安装过程,首先是官网文档If you haven’t already done so, log into your Ubuntu instance.Open a terminal window.Add the newgpgkey.$ apt-key adv --keyserver... <a href="https://www.cnblogs.com/yanghuahui/p/4874937.html" target="_blank">阅读全文</a>https://www.cnblogs.com/yanghuahui/p/4861619.htmlinstall hdp 2.2 on ubuntu 14.04 - yanghuahuihttp://www.swiss-scalability.com/2014/12/install-hdp-22-on-ubuntu-1404-trusty.html在新加节点上运行sed -e "s/14.04/12.04/g" -i /etc/*-release2015-10-08T09:25:00Z2015-10-08T09:25:00Zyanghuahuihttps://www.cnblogs.com/yanghuahui/【摘要】http://www.swiss-scalability.com/2014/12/install-hdp-22-on-ubuntu-1404-trusty.html在新加节点上运行sed -e "s/14.04/12.04/g" -i /etc/*-release <a href="https://www.cnblogs.com/yanghuahui/p/4861619.html" target="_blank">阅读全文</a>https://www.cnblogs.com/yanghuahui/p/4757151.htmlNodemanager Out of heap memory[fix bug全过程] - yanghuahui问题:自己写了一个yarn上的application,发现nodemanager过段时间,会out of memory退出,把nodemanager的heap memory从1G增大到2G也是无法避免NM程序OOM开启NM的jmx监控-Dcom.sun.management.jmxremote -D...2015-08-25T05:20:00Z2015-08-25T05:20:00Zyanghuahuihttps://www.cnblogs.com/yanghuahui/【摘要】问题:自己写了一个yarn上的application,发现nodemanager过段时间,会out of memory退出,把nodemanager的heap memory从1G增大到2G也是无法避免NM程序OOM开启NM的jmx监控-Dcom.sun.management.jmxremote -D... <a href="https://www.cnblogs.com/yanghuahui/p/4757151.html" target="_blank">阅读全文</a>https://www.cnblogs.com/yanghuahui/p/4731552.htmlDocker on YARN在Hulu的实现 - yanghuahui这篇文章是我来Hulu这一年做的主要工作,结合当下流行的两个开源方案Docker和YARN,提供了一套灵活的编程模型,目前支持DAG编程模型,将会支持长服务编程模型。基于Voidbox,开发者可以很容易的写出一个分布式的框架,Docker作为运行的执行引擎,YARN作为集群资源的管理系统。同时这篇文...2015-08-14T16:03:00Z2015-08-14T16:03:00Zyanghuahuihttps://www.cnblogs.com/yanghuahui/【摘要】这篇文章是我来Hulu这一年做的主要工作,结合当下流行的两个开源方案Docker和YARN,提供了一套灵活的编程模型,目前支持DAG编程模型,将会支持长服务编程模型。基于Voidbox,开发者可以很容易的写出一个分布式的框架,Docker作为运行的执行引擎,YARN作为集群资源的管理系统。同时这篇文... <a href="https://www.cnblogs.com/yanghuahui/p/4731552.html" target="_blank">阅读全文</a>https://www.cnblogs.com/yanghuahui/p/4645878.htmlHBase change split policy on an existing table - yanghuahuihbase(main):006:0> create 'test_table_region', 'username'0 row(s) in 1.2150 secondshbase(main):009:0> put 'test_table_region', '1', 'username:nick' ,'...2015-07-14T08:46:00Z2015-07-14T08:46:00Zyanghuahuihttps://www.cnblogs.com/yanghuahui/【摘要】hbase(main):006:0> create 'test_table_region', 'username'0 row(s) in 1.2150 secondshbase(main):009:0> put 'test_table_region', '1', 'username:nick' ,'... <a href="https://www.cnblogs.com/yanghuahui/p/4645878.html" target="_blank">阅读全文</a>