Coder Social home page Coder Social logo

获取useragent错误 about alilua HOT 11 CLOSED

oneoo avatar oneoo commented on July 24, 2024
获取useragent错误

from alilua.

Comments (11)

millken avatar millken commented on July 24, 2024

我把sandbox去掉了,改了一个openresty的框架,使用同样的压力测试,反复测试了几次。
weighttp -n 10000 -c 2000 -t 4 -k http://127.0.0.1:4567/

在并发小(20)的情况下,效果比openresty要好1-5%,但是打到2000时,openresty1.4.28没有报错

[root@localhost lua]# weighttp -n 10000 -c 2000 -t 4 -k http://127.0.0.1:4567/
weighttp - a lightweight and simple webserver benchmarking tool

starting benchmark...
spawning thread #1: 500 concurrent requests, 2500 total requests
spawning thread #2: 500 concurrent requests, 2500 total requests
spawning thread #3: 500 concurrent requests, 2500 total requests
spawning thread #4: 500 concurrent requests, 2500 total requests
progress:  10% done
progress:  20% done
progress:  30% done
progress:  40% done
progress:  50% done
progress:  60% done
progress:  70% done
progress:  80% done
progress:  90% done
progress: 100% done

finished in 6 sec, 37 millisec and 95 microsec, 1656 req/s, 302 kbyte/s
requests: 10000 total, 10000 started, 10000 done, 10000 succeeded, 0 failed, 0 errored
status codes: 10000 2xx, 0 3xx, 0 4xx, 0 5xx
traffic: 1869815 bytes total, 1649815 bytes http, 220000 bytes data

alilua 0.31 到90%后变慢,最后出现很多下面的错误。

error: connect() failed: Connection timed out (110)
error: read() failed: Connection reset by peer (104)

from alilua.

oneoo avatar oneoo commented on July 24, 2024

刚修正了header的bug,但暂时未发布更新

对于你说的压力测试问题,我检测过 alilua 本身是正常工作的。用 weighttp 测试确实会有说连接失败的情况
而我使用 ab 和 siege 压力测试,都是 100% 正确的,即使 5000 个并发

我仔细检查过为何会被 alilua 关闭连接,是因为 weighttp 触发到 0 字节的 read 事件。而 alilua 这里一概认为这是要关闭连接了。因不是标准请求,故不做修改

from alilua.

oneoo avatar oneoo commented on July 24, 2024

非常感谢你的详细测试 :)

另外要注意下 sandbox 的作用,我是出于简化 echo () 这些方法,不使用 echo (__epd ...) 这个方式而特殊加上的
其实对整体性能影响不大,而剥除这个 sandbox 的话,得注意 __epd 千万别跟其他并发请求混在一起了。

from alilua.

millken avatar millken commented on July 24, 2024

原本打算用sandbox的,不过在require文件后,在require的文件里,echo都不能使用,提示epd丢失。
如果连require都不能使用的话,是很难做项目的。

在 2013年10月17日下午10:09,oneoo [email protected]写道:

非常感谢你的详细测试 :)

另外要注意下 sandbox 的作用,我是出于简化 echo () 这些方法,不使用 echo (__epd ...) 这个方式而特殊加上的
其实对整体性能影响不大,而剥除这个 sandbox 的话,得注意 __epd 千万别跟其他并发请求混在一起了。


Reply to this email directly or view it on GitHubhttps://github.com//issues/8#issuecomment-26508710
.

from alilua.

oneoo avatar oneoo commented on July 24, 2024

所噶,这个问题我跟进下,把 require 支持起来

from alilua.

oneoo avatar oneoo commented on July 24, 2024

得麻烦你提供一个例子,我好测试

from alilua.

millken avatar millken commented on July 24, 2024

我fork了一个分支https://github.com/millken/alilua/tree/single

发自 Windows 邮件

发件人: oneoo
发送时间: ‎2013‎年‎10‎月‎17‎日, ‎星期四 ‎22‎:‎43
收件人: yo2oneoo/alilua
抄送: millken

得麻烦你提供一个例子,我好测试


Reply to this email directly or view it on GitHub.

from alilua.

oneoo avatar oneoo commented on July 24, 2024

这两天研究了一下 require 的实现,基本上无解。无法做入到沙箱中
是否可以用 dofile 来做模块功能呢?dofile在沙箱环境中代码可被缓存的,跟 require 类似,且支持自动更新缓存
稍后还会加入 dofiles 支持读入一个目录的代码并缓存

from alilua.

millken avatar millken commented on July 24, 2024

沙箱这玩意如果不是做类sae这种云的话,完全用不到。从其他程序(ngx_lua)移植过来也麻烦。
我现在是考虑不用沙箱,alilua应该支持配置文件,这样虚拟主机,多端口绑定,资源限制等等这些才好实现。

在 2013年10月20日下午7:50,oneoo [email protected]写道:

这两天研究了一下 require 的实现,基本上无解。无法做入到沙箱中
是否可以用 dofile 来做模块功能呢?dofile在沙箱环境中代码可被缓存的,跟 require 类似,且支持自动更新缓存
稍后还会加入 dofiles 支持读入一个目录的代码并缓存


Reply to this email directly or view it on GitHubhttps://github.com//issues/8#issuecomment-26671528
.

from alilua.

oneoo avatar oneoo commented on July 24, 2024

因为 Lua 默认变量是全局模式,脚本代码量大的情况下,会有函数被覆盖等问题出现
如果把每个页面的代码限制在一个环境中,可避免很多不必要的问题。万一出现函数覆盖问题,尤其是多人参与开发,则很难发现问题原因。尽最大的努力简化脚本开发,并提供一个稳定的运行环境是我主要考虑的

另外沙箱确实是为 sae 类做准备工作,其实 aLiLua 的早身 yo2lua 就是以 paas 平台形式来做的。

对于你现在的做法,可获得更高的性能~ 建议你单独起一个Lua Web 开发框架的项目,类似 node.js 的 expressjs
另外这个模式下,请注意并发情况下的变量是否会冲突,否则会产生意想不到的问题。

另外你说的多端口绑定,暂时不会考虑加入
而资源限制,你是指哪些方面?目前在 config.h 文件有些可以配置。但仍不全面,其实默认设置就是比较好的配置。对于共享内存的大小倒是有必要单独出来让用户可自由设置

from alilua.

oneoo avatar oneoo commented on July 24, 2024

v0.32 已修正 useragent 的BUG

from alilua.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.