Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hengfeiyang/queuemessager
use go fetch job from redis send to php fastcgi for execute.
https://github.com/hengfeiyang/queuemessager
Last synced: about 1 month ago
JSON representation
use go fetch job from redis send to php fastcgi for execute.
- Host: GitHub
- URL: https://github.com/hengfeiyang/queuemessager
- Owner: hengfeiyang
- Created: 2015-10-12T14:47:24.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2015-10-12T14:52:53.000Z (about 9 years ago)
- Last Synced: 2023-03-04T04:34:03.745Z (almost 2 years ago)
- Language: Go
- Size: 109 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
#说明
Go语言练习项目。根据工作中的项目需求进行的实践。
**从redis中读取队列数据发送给后端的php fastcgi处理。**
该项目中使用到了redis,fastcgi客户端,使用了json,gorutine和signal信号处理,采用面对对象编程,基本把go中的基础知识都用了一遍。
##注意
其中使用的fcgiclient,需要自己先创建一个fcgiclient项目,项目中就一个文件,请点击下载:
fcgiclient.go https://gist.github.com/9466/5743027##问题
1. 多并发时,系统提示 too many open files
2. fastcgi服务器上,出现大量 TIME_WAIT第一个问题是因为自己的客户端机器限制了open files
可以通过
```
ulimit -a
```查看自己的限制,MAC OS默认为256,修改:
```
ulimit -n 1024
```第二个问题是TCP本身的机制问题,可以通过配置可以大大减少TIME_WAIT的数量:
```
vi /etc/sysctl.conf
```
增加如下几行:```
net.ipv4.tcp_fin_timeout = 30
net.ipv4.tcp_keepalive_time = 1200
net.ipv4.tcp_syncookies = 1
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_tw_recycle = 1
net.ipv4.ip_local_port_range = 1024 65000
net.ipv4.tcp_max_syn_backlog = 8192
net.ipv4.tcp_max_tw_buckets = 5000
```具体解释参考:http://hi.baidu.com/dmkj2008/item/9aa9ea82c3947e5927ebd946
```