Coder Social home page Coder Social logo

post大数据丢失问题 about lor HOT 4 CLOSED

lcstore avatar lcstore commented on June 1, 2024
post大数据丢失问题

from lor.

Comments (4)

lcstore avatar lcstore commented on June 1, 2024

lor/lib/lor/lib/request.lua 这个类中,读取请求体相关代码存在问题:
1)请求体小于client_body_buffer_size,读取请求体代码:
local json_str = ngx.req.get_body_data()
2)请求体的size大于nginx配置里的client_body_buffer_size,则会导致请求体被缓冲到磁盘临时文件里,client_body_buffer_size默认是8k或者16k。
local datafile = ngx.req.get_body_file()

lor/lib/lor/lib/request.lua的代码没覆盖到2)的情况

from lor.

lcstore avatar lcstore commented on June 1, 2024

@sumory 帮忙看看呢

from lor.

ms2008 avatar ms2008 commented on June 1, 2024

request body 太大了,不建议 lor 去直接读文件,or 读文件的操作都是阻塞的,建议根据你的需求调大 client_body_buffer_size 的大小

from lor.

lcstore avatar lcstore commented on June 1, 2024

嗯,调大client_body_buffer_size是一种解决的办法,不过请求体慢慢增大可能就丢失数据了。

from lor.

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.