推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
chewuhe
V2EX  ›  Python

python 如何单节点 1s 内生成 10000 个 http 请求?

  •  
  •   chewuhe · Apr 23, 2016 · 6412 views
    This topic created in 3675 days ago, the information mentioned may be changed or developed.
    gevent 生成 1024 个以上就报错了 IOError: cannot watch more than 1024 sockets
    9 replies    2018-05-29 00:05:39 +08:00
    9hills
        1
    9hills  
       Apr 23, 2016 via Android
    这个和 python 无关,关键词 linux fd limit 搜一搜
    chewuhe
        2
    chewuhe  
    OP
       Apr 23, 2016
    @9hills windows 上有没有解决办法?
    neoblackcap
        3
    neoblackcap  
       Apr 23, 2016
    @chewuhe windows 没有这个 fd 的限制,在 windows 上你操作的 sockets 仅跟你的机器资源有关
    资料来源: https://msdn.microsoft.com/en-us/library/windows/desktop/ms739169(v=vs.85).aspx
    leavic
        4
    leavic  
       Apr 24, 2016
    aiohttp?
    chewuhe
        5
    chewuhe  
    OP
       Apr 24, 2016
    @neoblackcap 1024 这个限制怎么弄大点呢?有没有办法?
    neoblackcap
        6
    neoblackcap  
       Apr 24, 2016
    @chewuhe 都说 windows 没有 fd 的限制,你看看你是不是耗光了内存了。 linux 等 Unix-like 系统才会有 fd 的数量限制,那个我记得是去改在 /etc/ssyctl.conf 里面的 net.core.somaxconn 参数(没有就自己加)
    zerofiny
        7
    zerofiny  
       Apr 24, 2016
    windows 非 Server 版本有并发连接数问题, Server 版没有这个限制
    百度搜 windows 并发连接数
    lbp0200
        8
    lbp0200  
       Apr 25, 2016 via Android
    windows 有端口号限制,一个端口需要 4 分钟才能释放
    lifeishort
        9
    lifeishort  
       May 29, 2018 via iPhone
    @neoblackcap
    事实上 windows 桌面版是有 1024 限制的
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2915 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 53ms · UTC 06:48 · PVG 14:48 · LAX 23:48 · JFK 02:48
    ♥ Do have faith in what you're doing.