Greenev-Python Asynchronous Network Service Framework, greenevpython
Greenev is a Python network service framework based on greenlet coroutine, event-driven, and non-blocking socket model. It enables synchronous code writing, but achieves the advantages of asynchronous execution.
This project was inspired by gevent, openresty, alilua, skynet, clowwindy/ssloop, and I would like to express my gratitude here.
- The reactor mode adopts IO multiplexing based on epoll, kqueue, poll, and select.
- Schedule the greenlet coroutine on the upper layer based on the underlying reactor
- Tested on CentOS6.5, Ubuntu12.04, FreeBSD10.1, and Windows7
- You only need to call g. parent. switch to suspend the current coroutine without managing the details.
Modify the following system parameters (CentOS) before testing ):
Cmd code
- Net. ipv4.tcp _ syncookies = 1
- Net. ipv4.tcp _ tw_reuse = 1
- Net. ipv4.tcp _ tw_recycle = 1
- Net. ipv4.tcp _ fin_timeout = 30
- Net. ipv4.tcp _ keepalive_time = 1200
- Net. ipv4.ip _ local_port_range = 1024 65000
- Net. ipv4.tcp _ max_syn_backlog = 8192
- Fs. file-max = 65535
- Net. ipv4.tcp _ max_tw_buckets = 20000
- Net. nf_conntrack_max = 65000
- Net. netfilter. nf_conntrack_tcp_timeout_established = 1200
Managed address: https://github.com/Hevienz/greenev