摘要:
postgresql的默认最大连接数是200, 如果连接数超过200就会报 So many clients alreay. 当然你可以通过show max_connections;查看当前最大的连接数修改最大连接数, 最重要的就是要修改shmmax(Maximum size of shared memory segment (bytes))http://www.postgresql.org/docs/current/static/kernel-resources.html#SYSVIPC-PARAMETERS这里有讲解这里讲解都什么占用shm,(shared memory segment)ht 阅读全文
摘要:
关于decorator的官方描述如下:(http://docs.python.org/glossary.html)decoratorA function returning another function, usually applied as a function transformation using the@wrappersyntax. Common examples fordecorators areclassmethod()andstaticmethod().Thedecoratorsyntax is merely syntactic sugar, the following t 阅读全文
摘要:
有关python的__call__在官方文档上有这么一句解释 (http://docs.python.org/reference/datamodel.html?highlight=__call__#object.__call__)object.__call__(self[,args...])Called when the instance is “called” as a function; if this method is defined,x(arg1,arg2,...)is a shorthand forx.__call__(arg1,arg2,...).当把一个实例当作方法来调用的时候 阅读全文